The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/dtrace_bsd.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 2007-2008 John Birrell (jb@freebsd.org)
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  *
   14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   24  * SUCH DAMAGE.
   25  *
   26  * $FreeBSD: releng/10.0/sys/sys/dtrace_bsd.h 238366 2012-07-11 16:27:02Z gnn $
   27  *
   28  * This file contains BSD shims for Sun's DTrace code.
   29  */
   30 
   31 #ifndef _SYS_DTRACE_BSD_H
   32 #define _SYS_DTRACE_BSD_H
   33 
   34 /* Forward definitions: */
   35 struct mbuf;
   36 struct trapframe;
   37 struct thread;
   38 struct vattr;
   39 struct vnode;
   40 struct reg;
   41 struct devstat;
   42 struct bio;
   43 
   44 /*
   45  * Cyclic clock function type definition used to hook the cyclic
   46  * subsystem into the appropriate timer interrupt.
   47  */
   48 typedef void (*cyclic_clock_func_t)(struct trapframe *);
   49 extern cyclic_clock_func_t      cyclic_clock_func;
   50 
   51 void clocksource_cyc_set(const struct bintime *t);
   52 
   53 /*
   54  * The dtrace module handles traps that occur during a DTrace probe.
   55  * This type definition is used in the trap handler to provide a
   56  * hook for the dtrace module to register it's handler with.
   57  */
   58 typedef int (*dtrace_trap_func_t)(struct trapframe *, u_int);
   59 
   60 int     dtrace_trap(struct trapframe *, u_int);
   61 
   62 extern dtrace_trap_func_t       dtrace_trap_func;
   63 
   64 /* Used by the machine dependent trap() code. */
   65 typedef int (*dtrace_invop_func_t)(uintptr_t, uintptr_t *, uintptr_t);
   66 typedef void (*dtrace_doubletrap_func_t)(void);
   67 
   68 /* Global variables in trap.c */
   69 extern  dtrace_invop_func_t     dtrace_invop_func;
   70 extern  dtrace_doubletrap_func_t        dtrace_doubletrap_func;
   71 
   72 /* Pid provider hooks */
   73 typedef int (*dtrace_fasttrap_probe_ptr_t)(struct reg *);
   74 extern  dtrace_fasttrap_probe_ptr_t     dtrace_fasttrap_probe_ptr;
   75 typedef int (*dtrace_pid_probe_ptr_t)(struct reg *);
   76 extern  dtrace_pid_probe_ptr_t  dtrace_pid_probe_ptr;
   77 typedef int (*dtrace_return_probe_ptr_t)(struct reg *);
   78 extern  dtrace_return_probe_ptr_t       dtrace_return_probe_ptr;
   79 
   80 /* Virtual time hook function type. */
   81 typedef void (*dtrace_vtime_switch_func_t)(struct thread *);
   82 
   83 extern int                      dtrace_vtime_active;
   84 extern dtrace_vtime_switch_func_t       dtrace_vtime_switch_func;
   85 
   86 /* The fasttrap module hooks into the fork, exit and exit. */
   87 typedef void (*dtrace_fork_func_t)(struct proc *, struct proc *);
   88 typedef void (*dtrace_execexit_func_t)(struct proc *);
   89 
   90 /* Global variable in kern_fork.c */
   91 extern dtrace_fork_func_t       dtrace_fasttrap_fork;
   92 
   93 /* Global variable in kern_exec.c */
   94 extern dtrace_execexit_func_t   dtrace_fasttrap_exec;
   95 
   96 /* Global variable in kern_exit.c */
   97 extern dtrace_execexit_func_t   dtrace_fasttrap_exit;
   98 
   99 /* The dtmalloc provider hooks into malloc. */
  100 typedef void (*dtrace_malloc_probe_func_t)(u_int32_t, uintptr_t arg0,
  101     uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4);
  102 
  103 extern dtrace_malloc_probe_func_t   dtrace_malloc_probe;
  104 
  105 /* dtnfsclient NFSv[34] access cache provider hooks. */
  106 typedef void (*dtrace_nfsclient_accesscache_flush_probe_func_t)(uint32_t,
  107     struct vnode *);
  108 extern dtrace_nfsclient_accesscache_flush_probe_func_t
  109     dtrace_nfsclient_accesscache_flush_done_probe;
  110 extern dtrace_nfsclient_accesscache_flush_probe_func_t
  111     dtrace_nfscl_accesscache_flush_done_probe;
  112 
  113 typedef void (*dtrace_nfsclient_accesscache_get_probe_func_t)(uint32_t,
  114     struct vnode *, uid_t, uint32_t);
  115 extern dtrace_nfsclient_accesscache_get_probe_func_t
  116     dtrace_nfsclient_accesscache_get_hit_probe,
  117     dtrace_nfsclient_accesscache_get_miss_probe;
  118 extern dtrace_nfsclient_accesscache_get_probe_func_t
  119     dtrace_nfscl_accesscache_get_hit_probe,
  120     dtrace_nfscl_accesscache_get_miss_probe;
  121 
  122 typedef void (*dtrace_nfsclient_accesscache_load_probe_func_t)(uint32_t,
  123     struct vnode *, uid_t, uint32_t, int);
  124 extern dtrace_nfsclient_accesscache_load_probe_func_t
  125     dtrace_nfsclient_accesscache_load_done_probe;
  126 extern dtrace_nfsclient_accesscache_load_probe_func_t
  127     dtrace_nfscl_accesscache_load_done_probe;
  128 
  129 /* dtnfsclient NFSv[234] attribute cache provider hooks. */
  130 typedef void (*dtrace_nfsclient_attrcache_flush_probe_func_t)(uint32_t,
  131     struct vnode *);
  132 extern dtrace_nfsclient_attrcache_flush_probe_func_t
  133     dtrace_nfsclient_attrcache_flush_done_probe;
  134 extern dtrace_nfsclient_attrcache_flush_probe_func_t
  135     dtrace_nfscl_attrcache_flush_done_probe;
  136 
  137 typedef void (*dtrace_nfsclient_attrcache_get_hit_probe_func_t)(uint32_t,
  138     struct vnode *, struct vattr *);
  139 extern dtrace_nfsclient_attrcache_get_hit_probe_func_t
  140     dtrace_nfsclient_attrcache_get_hit_probe;
  141 extern dtrace_nfsclient_attrcache_get_hit_probe_func_t
  142     dtrace_nfscl_attrcache_get_hit_probe;
  143 
  144 typedef void (*dtrace_nfsclient_attrcache_get_miss_probe_func_t)(uint32_t,
  145     struct vnode *);
  146 extern dtrace_nfsclient_attrcache_get_miss_probe_func_t
  147     dtrace_nfsclient_attrcache_get_miss_probe;
  148 extern dtrace_nfsclient_attrcache_get_miss_probe_func_t
  149     dtrace_nfscl_attrcache_get_miss_probe;
  150 
  151 typedef void (*dtrace_nfsclient_attrcache_load_probe_func_t)(uint32_t,
  152     struct vnode *, struct vattr *, int);
  153 extern dtrace_nfsclient_attrcache_load_probe_func_t
  154     dtrace_nfsclient_attrcache_load_done_probe;
  155 extern dtrace_nfsclient_attrcache_load_probe_func_t
  156     dtrace_nfscl_attrcache_load_done_probe;
  157 
  158 /* dtnfsclient NFSv[234] RPC provider hooks. */
  159 typedef void (*dtrace_nfsclient_nfs23_start_probe_func_t)(uint32_t,
  160     struct vnode *, struct mbuf *, struct ucred *, int);
  161 extern dtrace_nfsclient_nfs23_start_probe_func_t
  162     dtrace_nfsclient_nfs23_start_probe;
  163 extern dtrace_nfsclient_nfs23_start_probe_func_t
  164     dtrace_nfscl_nfs234_start_probe;
  165 
  166 typedef void (*dtrace_nfsclient_nfs23_done_probe_func_t)(uint32_t,
  167     struct vnode *, struct mbuf *, struct ucred *, int, int);
  168 extern dtrace_nfsclient_nfs23_done_probe_func_t
  169     dtrace_nfsclient_nfs23_done_probe;
  170 extern dtrace_nfsclient_nfs23_done_probe_func_t
  171     dtrace_nfscl_nfs234_done_probe;
  172 
  173 /* IO Provider hooks, really hook into devstat */
  174 typedef void (*dtrace_io_start_probe_func_t)(uint32_t, struct bio *,
  175                                              struct devstat *);
  176 extern dtrace_io_start_probe_func_t dtrace_io_start_probe;
  177 
  178 typedef void (*dtrace_io_done_probe_func_t)(uint32_t, struct bio *,
  179                                             struct devstat *);
  180 extern dtrace_io_done_probe_func_t dtrace_io_done_probe;
  181 
  182 typedef void (*dtrace_io_wait_start_probe_func_t)(uint32_t, uintptr_t *, 
  183                                                   struct devstat *);
  184 extern dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe;
  185 
  186 typedef void (*dtrace_io_wait_done_probe_func_t)(uint32_t, uintptr_t *, 
  187                                                  struct devstat *);
  188 extern dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe;
  189 
  190 /*
  191  * Functions which allow the dtrace module to check that the kernel 
  192  * hooks have been compiled with sufficient space for it's private
  193  * structures.
  194  */
  195 size_t  kdtrace_proc_size(void);
  196 size_t  kdtrace_thread_size(void);
  197 
  198 /*
  199  * OpenSolaris compatible time functions returning nanoseconds.
  200  * On OpenSolaris these return hrtime_t which we define as uint64_t.
  201  */
  202 uint64_t        dtrace_gethrtime(void);
  203 uint64_t        dtrace_gethrestime(void);
  204 
  205 #endif /* _SYS_DTRACE_BSD_H */

Cache object: 7162e854b2b6396c5c148121dcdb65fa


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.