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/sdt.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright 2006-2008 John Birrell <jb@FreeBSD.org>
    3  *
    4  * Redistribution and use in source and binary forms, with or without
    5  * modification, are permitted provided that the following conditions
    6  * are met:
    7  * 1. Redistributions of source code must retain the above copyright
    8  *    notice, this list of conditions and the following disclaimer.
    9  * 2. Redistributions in binary form must reproduce the above copyright
   10  *    notice, this list of conditions and the following disclaimer in the
   11  *    documentation and/or other materials provided with the distribution.
   12  * 
   13  * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   16  * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
   17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   23  * SUCH DAMAGE.
   24  *
   25  * $FreeBSD: releng/10.0/sys/sys/sdt.h 255776 2013-09-21 22:43:50Z markj $
   26  *
   27  * Statically Defined Tracing (SDT) definitions.
   28  *
   29  */
   30 
   31 #ifndef _SYS_SDT_H
   32 #define _SYS_SDT_H
   33 
   34 #ifndef _KERNEL
   35 
   36 #define _DTRACE_VERSION 1
   37 
   38 #define DTRACE_PROBE(prov, name) {                              \
   39         extern void __dtrace_##prov##___##name(void);           \
   40         __dtrace_##prov##___##name();                           \
   41 }
   42 
   43 #define DTRACE_PROBE1(prov, name, arg1) {                       \
   44         extern void __dtrace_##prov##___##name(unsigned long);  \
   45         __dtrace_##prov##___##name((unsigned long)arg1);        \
   46 }
   47 
   48 #define DTRACE_PROBE2(prov, name, arg1, arg2) {                 \
   49         extern void __dtrace_##prov##___##name(unsigned long,   \
   50             unsigned long);                                     \
   51         __dtrace_##prov##___##name((unsigned long)arg1,         \
   52             (unsigned long)arg2);                               \
   53 }
   54 
   55 #define DTRACE_PROBE3(prov, name, arg1, arg2, arg3) {           \
   56         extern void __dtrace_##prov##___##name(unsigned long,   \
   57             unsigned long, unsigned long);                      \
   58         __dtrace_##prov##___##name((unsigned long)arg1,         \
   59             (unsigned long)arg2, (unsigned long)arg3);          \
   60 }
   61 
   62 #define DTRACE_PROBE4(prov, name, arg1, arg2, arg3, arg4) {     \
   63         extern void __dtrace_##prov##___##name(unsigned long,   \
   64             unsigned long, unsigned long, unsigned long);       \
   65         __dtrace_##prov##___##name((unsigned long)arg1,         \
   66             (unsigned long)arg2, (unsigned long)arg3,           \
   67             (unsigned long)arg4);                               \
   68 }
   69 
   70 #define DTRACE_PROBE5(prov, name, arg1, arg2, arg3, arg4, arg5) {       \
   71         extern void __dtrace_##prov##___##name(unsigned long,           \
   72             unsigned long, unsigned long, unsigned long, unsigned long);\
   73         __dtrace_##prov##___##name((unsigned long)arg1,                 \
   74             (unsigned long)arg2, (unsigned long)arg3,                   \
   75             (unsigned long)arg4, (unsigned long)arg5);                  \
   76 }
   77 
   78 #else /* _KERNEL */
   79 
   80 #include <sys/cdefs.h>
   81 #include <sys/linker_set.h>
   82 
   83 #ifndef KDTRACE_HOOKS
   84 
   85 #define SDT_PROVIDER_DEFINE(prov)
   86 #define SDT_PROVIDER_DECLARE(prov)
   87 #define SDT_PROBE_DEFINE(prov, mod, func, name, sname)
   88 #define SDT_PROBE_DECLARE(prov, mod, func, name)
   89 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
   90 #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype)
   91 
   92 #define SDT_PROBE_DEFINE0(prov, mod, func, name, sname)
   93 #define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0)
   94 #define SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1)
   95 #define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2)
   96 #define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3)
   97 #define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4)
   98 #define SDT_PROBE_DEFINE6(prov, mod, func, name, snamp, arg0, arg1, arg2,      \
   99     arg3, arg4, arg5)
  100 #define SDT_PROBE_DEFINE7(prov, mod, func, name, snamp, arg0, arg1, arg2,      \
  101     arg3, arg4, arg5, arg6)
  102 
  103 #define SDT_PROBE0(prov, mod, func, name)
  104 #define SDT_PROBE1(prov, mod, func, name, arg0)
  105 #define SDT_PROBE2(prov, mod, func, name, arg0, arg1)
  106 #define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2)
  107 #define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3)
  108 #define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
  109 #define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5)
  110 #define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5,  \
  111     arg6)
  112 
  113 #define SDT_PROBE_DEFINE0_XLATE(prov, mod, func, name, sname)
  114 #define SDT_PROBE_DEFINE1_XLATE(prov, mod, func, name, sname, arg0, xarg0)
  115 #define SDT_PROBE_DEFINE2_XLATE(prov, mod, func, name, sname, arg0, xarg0,     \
  116     arg1, xarg1)
  117 #define SDT_PROBE_DEFINE3_XLATE(prov, mod, func, name, sname, arg0, xarg0,     \
  118     arg1, xarg1, arg2, xarg2)
  119 #define SDT_PROBE_DEFINE4_XLATE(prov, mod, func, name, sname, arg0, xarg0,     \
  120     arg1, xarg1, arg2, xarg2, arg3, xarg3)
  121 #define SDT_PROBE_DEFINE5_XLATE(prov, mod, func, name, sname, arg0, xarg0,     \
  122     arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4)
  123 #define SDT_PROBE_DEFINE6_XLATE(prov, mod, func, name, sname, arg0, xarg0,     \
  124     arg1,  xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5)
  125 #define SDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, sname, arg0, xarg0,     \
  126     arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6,     \
  127     xarg6)
  128 
  129 #else
  130 
  131 SET_DECLARE(sdt_providers_set, struct sdt_provider);
  132 SET_DECLARE(sdt_probes_set, struct sdt_probe);
  133 SET_DECLARE(sdt_argtypes_set, struct sdt_argtype);
  134 
  135 #define SDT_PROVIDER_DEFINE(prov)                                               \
  136         struct sdt_provider sdt_provider_##prov[1] = {                          \
  137                 { #prov, { NULL, NULL }, { NULL, NULL }, 0, 0 }                 \
  138         };                                                                      \
  139         DATA_SET(sdt_providers_set, sdt_provider_##prov);
  140 
  141 #define SDT_PROVIDER_DECLARE(prov)                                              \
  142         extern struct sdt_provider sdt_provider_##prov[1]
  143 
  144 #define SDT_PROBE_DEFINE(prov, mod, func, name, sname)                          \
  145         struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] = {            \
  146                 { sizeof(struct sdt_probe), sdt_provider_##prov,                \
  147                     { NULL, NULL }, { NULL, NULL }, #mod, #func, #sname, 0, 0,  \
  148                     NULL }                                                      \
  149         };                                                                      \
  150         DATA_SET(sdt_probes_set, sdt_##prov##_##mod##_##func##_##name);
  151 
  152 #define SDT_PROBE_DECLARE(prov, mod, func, name)                                \
  153         extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1]
  154 
  155 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)  do {    \
  156         if (sdt_##prov##_##mod##_##func##_##name->id)                           \
  157                 (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id,     \
  158                     (uintptr_t) arg0, (uintptr_t) arg1, (uintptr_t) arg2,       \
  159                     (uintptr_t) arg3, (uintptr_t) arg4);                        \
  160 } while (0)
  161 
  162 #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype)              \
  163         static struct sdt_argtype sdta_##prov##_##mod##_##func##_##name##num[1] \
  164             = { { num, type, xtype, { NULL, NULL },                             \
  165             sdt_##prov##_##mod##_##func##_##name }                              \
  166         };                                                                      \
  167         DATA_SET(sdt_argtypes_set, sdta_##prov##_##mod##_##func##_##name##num);
  168 
  169 #define SDT_PROBE_DEFINE0(prov, mod, func, name, sname)                 \
  170         SDT_PROBE_DEFINE(prov, mod, func, name, sname)
  171 
  172 #define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0)           \
  173         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  174         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL)
  175 
  176 #define SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1)     \
  177         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  178         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL);        \
  179         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL)
  180 
  181 #define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2)\
  182         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  183         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL);        \
  184         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL);        \
  185         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL)
  186 
  187 #define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) \
  188         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  189         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL);        \
  190         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL);        \
  191         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL);        \
  192         SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL)
  193 
  194 #define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) \
  195         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  196         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL);        \
  197         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL);        \
  198         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL);        \
  199         SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL);        \
  200         SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL)
  201 
  202 #define SDT_PROBE_DEFINE6(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\
  203     arg4, arg5) \
  204         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  205         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL);        \
  206         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL);        \
  207         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL);        \
  208         SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL);        \
  209         SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL);        \
  210         SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, NULL)
  211 
  212 #define SDT_PROBE_DEFINE7(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\
  213     arg4, arg5, arg6) \
  214         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  215         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL);        \
  216         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL);        \
  217         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL);        \
  218         SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL);        \
  219         SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL);        \
  220         SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, NULL);        \
  221         SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6, NULL)
  222 
  223 #define SDT_PROBE_DEFINE0_XLATE(prov, mod, func, name, sname)           \
  224         SDT_PROBE_DEFINE(prov, mod, func, name, sname)
  225 
  226 #define SDT_PROBE_DEFINE1_XLATE(prov, mod, func, name, sname, arg0, xarg0) \
  227         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  228         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0)
  229 
  230 #define SDT_PROBE_DEFINE2_XLATE(prov, mod, func, name, sname, arg0, xarg0, \
  231     arg1,  xarg1)                                                       \
  232         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  233         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0);       \
  234         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1)
  235 
  236 #define SDT_PROBE_DEFINE3_XLATE(prov, mod, func, name, sname, arg0, xarg0, \
  237     arg1, xarg1, arg2, xarg2)                                           \
  238         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  239         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0);       \
  240         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1);       \
  241         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2)
  242 
  243 #define SDT_PROBE_DEFINE4_XLATE(prov, mod, func, name, sname, arg0, xarg0, \
  244     arg1, xarg1, arg2, xarg2, arg3, xarg3)                              \
  245         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  246         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0);       \
  247         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1);       \
  248         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2);       \
  249         SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3)
  250 
  251 #define SDT_PROBE_DEFINE5_XLATE(prov, mod, func, name, sname, arg0, xarg0, \
  252     arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4)                 \
  253         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  254         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0);       \
  255         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1);       \
  256         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2);       \
  257         SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3);       \
  258         SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4)
  259 
  260 #define SDT_PROBE_DEFINE6_XLATE(prov, mod, func, name, sname, arg0, xarg0, \
  261     arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5)    \
  262         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  263         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0);       \
  264         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1);       \
  265         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2);       \
  266         SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3);       \
  267         SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4);       \
  268         SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, xarg5)
  269 
  270 #define SDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, sname, arg0, xarg0, \
  271     arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \
  272     xarg6)                                                              \
  273         SDT_PROBE_DEFINE(prov, mod, func, name, sname);                 \
  274         SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0);       \
  275         SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1);       \
  276         SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2);       \
  277         SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3);       \
  278         SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4);       \
  279         SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, xarg5);       \
  280         SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6, xarg6)
  281 
  282 #define SDT_PROBE0(prov, mod, func, name)                               \
  283         SDT_PROBE(prov, mod, func, name, 0, 0, 0, 0, 0)
  284 #define SDT_PROBE1(prov, mod, func, name, arg0)                         \
  285         SDT_PROBE(prov, mod, func, name, arg0, 0, 0, 0, 0)
  286 #define SDT_PROBE2(prov, mod, func, name, arg0, arg1)                   \
  287         SDT_PROBE(prov, mod, func, name, arg0, arg1, 0, 0, 0)
  288 #define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2)             \
  289         SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2,  0, 0)
  290 #define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3)       \
  291         SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0)
  292 #define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \
  293         SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
  294 #define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5)  \
  295         do {                                                                   \
  296                 if (sdt_##prov##_##mod##_##func##_##name->id)                  \
  297                         (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \
  298                             uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)(  \
  299                             sdt_##prov##_##mod##_##func##_##name->id,          \
  300                             (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \
  301                             (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\
  302         } while (0)
  303 #define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5,  \
  304     arg6)                                                                      \
  305         do {                                                                   \
  306                 if (sdt_##prov##_##mod##_##func##_##name->id)                  \
  307                         (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \
  308                             uintptr_t, uintptr_t, uintptr_t, uintptr_t))       \
  309                             sdt_probe_func)(                                   \
  310                             sdt_##prov##_##mod##_##func##_##name->id,          \
  311                             (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \
  312                             (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \
  313                             (uintptr_t)arg6);                                  \
  314         } while (0)
  315 
  316 #endif /* KDTRACE_HOOKS */
  317 
  318 /*
  319  * This type definition must match that of dtrace_probe. It is defined this
  320  * way to avoid having to rely on CDDL code.
  321  */
  322 typedef void (*sdt_probe_func_t)(uint32_t, uintptr_t arg0, uintptr_t arg1,
  323     uintptr_t arg2, uintptr_t arg3, uintptr_t arg4);
  324 
  325 /*
  326  * The 'sdt' provider will set it to dtrace_probe when it loads.
  327  */
  328 extern sdt_probe_func_t sdt_probe_func;
  329 
  330 struct sdt_probe;
  331 struct sdt_provider;
  332 struct linker_file;
  333 
  334 struct sdt_argtype {
  335         int             ndx;            /* Argument index. */
  336         const char      *type;          /* Argument type string. */
  337         const char      *xtype;         /* Translated argument type. */
  338         TAILQ_ENTRY(sdt_argtype)
  339                         argtype_entry;  /* Argument type list entry. */
  340         struct sdt_probe *probe;        /* Ptr to the probe structure. */
  341 };
  342 
  343 struct sdt_probe {
  344         int             version;        /* Set to sizeof(struct sdt_probe). */
  345         struct sdt_provider *prov;      /* Ptr to the provider structure. */
  346         TAILQ_ENTRY(sdt_probe)
  347                         probe_entry;    /* SDT probe list entry. */
  348         TAILQ_HEAD(argtype_list_head, sdt_argtype) argtype_list;
  349         const char      *mod;
  350         const char      *func;
  351         const char      *name;
  352         id_t            id;             /* DTrace probe ID. */
  353         int             n_args;         /* Number of arguments. */
  354         struct linker_file *sdtp_lf;    /* Module in which we're defined. */
  355 };
  356 
  357 struct sdt_provider {
  358         char *name;                     /* Provider name. */
  359         TAILQ_ENTRY(sdt_provider)
  360                         prov_entry;     /* SDT provider list entry. */
  361         TAILQ_HEAD(probe_list_head, sdt_probe) probe_list;
  362         uintptr_t       id;             /* DTrace provider ID. */
  363         int             sdt_refs;       /* Number of module references. */
  364 };
  365 
  366 void sdt_probe_stub(uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t,
  367     uintptr_t);
  368 
  369 #endif /* _KERNEL */
  370 
  371 #endif /* _SYS_SDT_H */

Cache object: 6e4f071f9861e80c270164da4c5e6aa2


[ 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.