Add an extra comment to the SDT probes definition. This allows us to get
use '-' in probe names, matching the probe names in Solaris.[1] Add userland SDT probes definitions to sys/sdt.h. Sponsored by: The FreeBSD Foundation Discussed with: rwaston [1]
This commit is contained in:
parent
5b5779d000
commit
79856499bd
@ -91,11 +91,11 @@ dtrace_execexit_func_t dtrace_fasttrap_exec;
|
||||
#endif
|
||||
|
||||
SDT_PROVIDER_DECLARE(proc);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , exec);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , exec, exec);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , exec, 0, "char *");
|
||||
SDT_PROBE_DEFINE(proc, kernel, , exec_failure);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , exec_failure, exec-failure);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , exec_failure, 0, "int");
|
||||
SDT_PROBE_DEFINE(proc, kernel, , exec_success);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , exec_success, exec-success);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , exec_success, 0, "char *");
|
||||
|
||||
MALLOC_DEFINE(M_PARGS, "proc-args", "Process arguments");
|
||||
|
@ -90,7 +90,7 @@ dtrace_execexit_func_t dtrace_fasttrap_exit;
|
||||
#endif
|
||||
|
||||
SDT_PROVIDER_DECLARE(proc);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , exit);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , exit, exit);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , exit, 0, "int");
|
||||
|
||||
/* Required to be non-static for SysVR4 emulator */
|
||||
|
@ -84,7 +84,7 @@ dtrace_fork_func_t dtrace_fasttrap_fork;
|
||||
#endif
|
||||
|
||||
SDT_PROVIDER_DECLARE(proc);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , create);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , create, create);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , create, 0, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , create, 1, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , create, 2, "int");
|
||||
|
@ -60,8 +60,8 @@ SYSCTL_INT(_security_bsd, OID_AUTO, suser_enabled, CTLFLAG_RW,
|
||||
TUNABLE_INT("security.bsd.suser_enabled", &suser_enabled);
|
||||
|
||||
SDT_PROVIDER_DEFINE(priv);
|
||||
SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_ok, "int");
|
||||
SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_err, "int");
|
||||
SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_ok, priv-ok, "int");
|
||||
SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_err, priv-err, "int");
|
||||
|
||||
/*
|
||||
* Check a credential for privilege. Lots of good reasons to deny privilege;
|
||||
|
@ -82,30 +82,30 @@ __FBSDID("$FreeBSD$");
|
||||
#endif
|
||||
|
||||
SDT_PROVIDER_DEFINE(proc);
|
||||
SDT_PROBE_DEFINE(proc, kernel, ctor, entry);
|
||||
SDT_PROBE_DEFINE(proc, kernel, ctor, entry, entry);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 0, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 1, "int");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 2, "void *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 3, "int");
|
||||
SDT_PROBE_DEFINE(proc, kernel, ctor, return);
|
||||
SDT_PROBE_DEFINE(proc, kernel, ctor, return, return);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, ctor, return, 0, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, ctor, return, 1, "int");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, ctor, return, 2, "void *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, ctor, return, 3, "int");
|
||||
SDT_PROBE_DEFINE(proc, kernel, dtor, entry);
|
||||
SDT_PROBE_DEFINE(proc, kernel, dtor, entry, entry);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, dtor, entry, 0, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, dtor, entry, 1, "int");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, dtor, entry, 2, "void *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, dtor, entry, 3, "struct thread *");
|
||||
SDT_PROBE_DEFINE(proc, kernel, dtor, return);
|
||||
SDT_PROBE_DEFINE(proc, kernel, dtor, return, return);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, dtor, return, 0, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, dtor, return, 1, "int");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, dtor, return, 2, "void *");
|
||||
SDT_PROBE_DEFINE(proc, kernel, init, entry);
|
||||
SDT_PROBE_DEFINE(proc, kernel, init, entry, entry);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, init, entry, 0, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, init, entry, 1, "int");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, init, entry, 2, "int");
|
||||
SDT_PROBE_DEFINE(proc, kernel, init, return);
|
||||
SDT_PROBE_DEFINE(proc, kernel, init, return, return);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, init, return, 0, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, init, return, 1, "int");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, init, return, 2, "int");
|
||||
|
@ -89,14 +89,14 @@ __FBSDID("$FreeBSD$");
|
||||
#define ONSIG 32 /* NSIG for osig* syscalls. XXX. */
|
||||
|
||||
SDT_PROVIDER_DECLARE(proc);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , signal_send);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , signal_send, signal-send);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , signal_send, 0, "struct thread *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , signal_send, 1, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , signal_send, 2, "int");
|
||||
SDT_PROBE_DEFINE(proc, kernel, , signal_clear);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , signal_clear, signal-clear);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , signal_clear, 0, "int");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , signal_clear, 1, "ksiginfo_t *");
|
||||
SDT_PROBE_DEFINE(proc, kernel, , signal_discard);
|
||||
SDT_PROBE_DEFINE(proc, kernel, , signal_discard, signal-discard);
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , signal_discard, 0, "struct thread *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , signal_discard, 1, "struct proc *");
|
||||
SDT_PROBE_ARGTYPE(proc, kernel, , signal_discard, 2, "int");
|
||||
|
@ -57,10 +57,10 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/smp.h>
|
||||
|
||||
SDT_PROVIDER_DEFINE(callout_execute);
|
||||
SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start);
|
||||
SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start, callout-start);
|
||||
SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0,
|
||||
"struct callout *");
|
||||
SDT_PROBE_DEFINE(callout_execute, kernel, , callout_end);
|
||||
SDT_PROBE_DEFINE(callout_execute, kernel, , callout_end, callout-end);
|
||||
SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_end, 0,
|
||||
"struct callout *");
|
||||
|
||||
|
@ -61,28 +61,28 @@ __FBSDID("$FreeBSD$");
|
||||
#include <vm/uma.h>
|
||||
|
||||
SDT_PROVIDER_DECLARE(vfs);
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *",
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, enter, done, done, "struct vnode *", "char *",
|
||||
"struct vnode *");
|
||||
SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *",
|
||||
SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, done, "struct vnode *",
|
||||
"char *");
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *");
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *",
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, entry, "struct vnode *");
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, hit, "struct vnode *",
|
||||
"struct char *", "struct vnode *");
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, "struct vnode *");
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, "int", "struct vnode *",
|
||||
"struct char *");
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, "struct vnode *", "char *",
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, miss, "struct vnode *");
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, return, "int",
|
||||
"struct vnode *", "struct char *");
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, hit, "struct vnode *", "char *",
|
||||
"struct vnode *");
|
||||
SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit_negative, "struct vnode *",
|
||||
SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit_negative, hit-negative,
|
||||
"struct vnode *", "char *");
|
||||
SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, miss, "struct vnode *",
|
||||
"char *");
|
||||
SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *",
|
||||
"char *");
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *");
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *");
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *");
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *",
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, purge, done, done, "struct vnode *");
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, done, "struct vnode *");
|
||||
SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, done, "struct mount *");
|
||||
SDT_PROBE_DEFINE3(vfs, namecache, zap, done, done, "struct vnode *", "char *",
|
||||
"struct vnode *");
|
||||
SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *",
|
||||
SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, done, "struct vnode *",
|
||||
"char *");
|
||||
|
||||
/*
|
||||
|
@ -68,9 +68,9 @@ __FBSDID("$FreeBSD$");
|
||||
#undef NAMEI_DIAGNOSTIC
|
||||
|
||||
SDT_PROVIDER_DECLARE(vfs);
|
||||
SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, "struct vnode *", "char *",
|
||||
SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, entry, "struct vnode *", "char *",
|
||||
"unsigned long");
|
||||
SDT_PROBE_DEFINE2(vfs, namei, lookup, return, "int", "struct vnode *");
|
||||
SDT_PROBE_DEFINE2(vfs, namei, lookup, return, return, "int", "struct vnode *");
|
||||
|
||||
/*
|
||||
* Allocation zone for namei
|
||||
|
@ -85,10 +85,10 @@ __FBSDID("$FreeBSD$");
|
||||
#include <vm/uma.h>
|
||||
|
||||
SDT_PROVIDER_DEFINE(vfs);
|
||||
SDT_PROBE_DEFINE(vfs, , stat, mode);
|
||||
SDT_PROBE_DEFINE(vfs, , stat, mode, mode);
|
||||
SDT_PROBE_ARGTYPE(vfs, , stat, mode, 0, "char *");
|
||||
SDT_PROBE_ARGTYPE(vfs, , stat, mode, 1, "int");
|
||||
SDT_PROBE_DEFINE(vfs, , stat, reg);
|
||||
SDT_PROBE_DEFINE(vfs, , stat, reg, reg);
|
||||
SDT_PROBE_ARGTYPE(vfs, , stat, reg, 0, "char *");
|
||||
SDT_PROBE_ARGTYPE(vfs, , stat, reg, 1, "int");
|
||||
|
||||
|
@ -208,11 +208,15 @@ static TAILQ_HEAD(, vnet_data_free) vnet_data_free_head =
|
||||
static struct sx vnet_data_free_lock;
|
||||
|
||||
SDT_PROVIDER_DEFINE(vnet);
|
||||
SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, "int");
|
||||
SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, "int", "struct vnet *");
|
||||
SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, "int", "struct vnet *");
|
||||
SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, "int", "struct vnet *");
|
||||
SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, "int");
|
||||
SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, entry, "int");
|
||||
SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, alloc, "int",
|
||||
"struct vnet *");
|
||||
SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, return,
|
||||
"int", "struct vnet *");
|
||||
SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, entry,
|
||||
"int", "struct vnet *");
|
||||
SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, entry,
|
||||
"int");
|
||||
|
||||
#ifdef DDB
|
||||
static void db_show_vnet_print_vs(struct vnet_sysinit *, int);
|
||||
|
@ -50,13 +50,13 @@ __FBSDID("$FreeBSD$");
|
||||
#include <opencrypto/deflate.h>
|
||||
|
||||
SDT_PROVIDER_DECLARE(opencrypto);
|
||||
SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry,
|
||||
SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, entry,
|
||||
"int", "u_int32_t");
|
||||
SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad,
|
||||
SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, bad,
|
||||
"int", "int", "int", "int", "int");
|
||||
SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter,
|
||||
SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, iter,
|
||||
"int", "int", "int", "int", "int");
|
||||
SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return,
|
||||
SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, return,
|
||||
"int", "u_int32_t");
|
||||
|
||||
int window_inflate = -1 * MAX_WBITS;
|
||||
|
@ -94,10 +94,12 @@ __FBSDID("$FreeBSD$");
|
||||
SDT_PROVIDER_DEFINE(mac);
|
||||
SDT_PROVIDER_DEFINE(mac_framework);
|
||||
|
||||
SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, "int",
|
||||
SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, modevent, "int",
|
||||
"struct mac_policy_conf *mpc");
|
||||
SDT_PROBE_DEFINE1(mac, kernel, policy, register, "struct mac_policy_conf *");
|
||||
SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, "struct mac_policy_conf *");
|
||||
SDT_PROBE_DEFINE1(mac, kernel, policy, register, register,
|
||||
"struct mac_policy_conf *");
|
||||
SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, unregister,
|
||||
"struct mac_policy_conf *");
|
||||
|
||||
/*
|
||||
* Root sysctl node for all MAC and MAC policy controls.
|
||||
|
@ -75,27 +75,27 @@ SDT_PROVIDER_DECLARE(mac_framework); /* Entry points to MAC. */
|
||||
|
||||
#define MAC_CHECK_PROBE_DEFINE4(name, arg0, arg1, arg2, arg3) \
|
||||
SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac_check_err, \
|
||||
"int", arg0, arg1, arg2, arg3); \
|
||||
mac-check-ok, "int", arg0, arg1, arg2, arg3); \
|
||||
SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac_check_ok, \
|
||||
"int", arg0, arg1, arg2, arg3);
|
||||
mac-check-ok, "int", arg0, arg1, arg2, arg3);
|
||||
|
||||
#define MAC_CHECK_PROBE_DEFINE3(name, arg0, arg1, arg2) \
|
||||
SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac_check_err, \
|
||||
"int", arg0, arg1, arg2); \
|
||||
mac-check-err, "int", arg0, arg1, arg2); \
|
||||
SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac_check_ok, \
|
||||
"int", arg0, arg1, arg2);
|
||||
mac-check-ok, "int", arg0, arg1, arg2);
|
||||
|
||||
#define MAC_CHECK_PROBE_DEFINE2(name, arg0, arg1) \
|
||||
SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_check_err, \
|
||||
"int", arg0, arg1); \
|
||||
mac-check-err, "int", arg0, arg1); \
|
||||
SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_check_ok, \
|
||||
"int", arg0, arg1);
|
||||
mac-check-ok, "int", arg0, arg1);
|
||||
|
||||
#define MAC_CHECK_PROBE_DEFINE1(name, arg0) \
|
||||
SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac_check_err, \
|
||||
"int", arg0); \
|
||||
mac-check-err, "int", arg0); \
|
||||
SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac_check_ok, \
|
||||
"int", arg0);
|
||||
mac-check-ok, "int", arg0);
|
||||
|
||||
#define MAC_CHECK_PROBE4(name, error, arg0, arg1, arg2, arg3) do { \
|
||||
if (error) { \
|
||||
@ -117,9 +117,9 @@ SDT_PROVIDER_DECLARE(mac_framework); /* Entry points to MAC. */
|
||||
|
||||
#define MAC_GRANT_PROBE_DEFINE2(name, arg0, arg1) \
|
||||
SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_err, \
|
||||
"int", arg0, arg1); \
|
||||
mac-grant-err, "int", arg0, arg1); \
|
||||
SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_ok, \
|
||||
"INT", arg0, arg1);
|
||||
mac-grant-ok, "INT", arg0, arg1);
|
||||
|
||||
#define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \
|
||||
if (error) { \
|
||||
|
@ -31,33 +31,66 @@
|
||||
#ifndef _SYS_SDT_H
|
||||
#define _SYS_SDT_H
|
||||
|
||||
/* Stub these for the time being. */
|
||||
#define DTRACE_PROBE(name)
|
||||
#define DTRACE_PROBE1(name, type1, arg1)
|
||||
#define DTRACE_PROBE2(name, type1, arg1, type2, arg2)
|
||||
#define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3)
|
||||
#define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4)
|
||||
|
||||
#ifndef _KERNEL
|
||||
|
||||
/* The promise of things to come. Worlds to explore. People to meet. Things to do. */
|
||||
#define _DTRACE_VERSION 1
|
||||
|
||||
#else
|
||||
#define DTRACE_PROBE(prov, name) { \
|
||||
extern void __dtrace_##prov##___##name(void); \
|
||||
__dtrace_##prov##___##name(); \
|
||||
}
|
||||
|
||||
#define DTRACE_PROBE1(prov, name, arg1) { \
|
||||
extern void __dtrace_##prov##___##name(unsigned long); \
|
||||
__dtrace_##prov##___##name((unsigned long)arg1); \
|
||||
}
|
||||
|
||||
#define DTRACE_PROBE2(prov, name, arg1, arg2) { \
|
||||
extern void __dtrace_##prov##___##name(unsigned long, \
|
||||
unsigned long); \
|
||||
__dtrace_##prov##___##name((unsigned long)arg1, \
|
||||
(unsigned long)arg2); \
|
||||
}
|
||||
|
||||
#define DTRACE_PROBE3(prov, name, arg1, arg2, arg3) { \
|
||||
extern void __dtrace_##prov##___##name(unsigned long, \
|
||||
unsigned long, unsigned long); \
|
||||
__dtrace_##prov##___##name((unsigned long)arg1, \
|
||||
(unsigned long)arg2, (unsigned long)arg3); \
|
||||
}
|
||||
|
||||
#define DTRACE_PROBE4(prov, name, arg1, arg2, arg3, arg4) { \
|
||||
extern void __dtrace_##prov##___##name(unsigned long, \
|
||||
unsigned long, unsigned long, unsigned long); \
|
||||
__dtrace_##prov##___##name((unsigned long)arg1, \
|
||||
(unsigned long)arg2, (unsigned long)arg3, \
|
||||
(unsigned long)arg4); \
|
||||
}
|
||||
|
||||
#define DTRACE_PROBE5(prov, name, arg1, arg2, arg3, arg4, arg5) { \
|
||||
extern void __dtrace_##prov##___##name(unsigned long, \
|
||||
unsigned long, unsigned long, unsigned long, unsigned long);\
|
||||
__dtrace_##prov##___##name((unsigned long)arg1, \
|
||||
(unsigned long)arg2, (unsigned long)arg3, \
|
||||
(unsigned long)arg4, (unsigned long)arg5); \
|
||||
}
|
||||
|
||||
#else /* _KERNEL */
|
||||
|
||||
#ifndef KDTRACE_HOOKS
|
||||
|
||||
#define SDT_PROVIDER_DEFINE(prov)
|
||||
#define SDT_PROVIDER_DECLARE(prov)
|
||||
#define SDT_PROBE_DEFINE(prov, mod, func, name)
|
||||
#define SDT_PROBE_DEFINE(prov, mod, func, name, sname)
|
||||
#define SDT_PROBE_DECLARE(prov, mod, func, name)
|
||||
#define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
|
||||
#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type)
|
||||
|
||||
#define SDT_PROBE_DEFINE1(prov, mod, func, name, arg0)
|
||||
#define SDT_PROBE_DEFINE2(prov, mod, func, name, arg0, arg1)
|
||||
#define SDT_PROBE_DEFINE3(prov, mod, func, name, arg0, arg1, arg2)
|
||||
#define SDT_PROBE_DEFINE4(prov, mod, func, name, arg0, arg1, arg2, arg3)
|
||||
#define SDT_PROBE_DEFINE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
|
||||
#define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0)
|
||||
#define SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1)
|
||||
#define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2)
|
||||
#define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3)
|
||||
#define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4)
|
||||
|
||||
#define SDT_PROBE1(prov, mod, func, name, arg0)
|
||||
#define SDT_PROBE2(prov, mod, func, name, arg0, arg1)
|
||||
@ -135,10 +168,10 @@ struct sdt_provider {
|
||||
#define SDT_PROVIDER_DECLARE(prov) \
|
||||
extern struct sdt_provider sdt_provider_##prov[1]
|
||||
|
||||
#define SDT_PROBE_DEFINE(prov, mod, func, name) \
|
||||
#define SDT_PROBE_DEFINE(prov, mod, func, name, sname) \
|
||||
struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] = { \
|
||||
{ sizeof(struct sdt_probe), 0, sdt_provider_##prov, \
|
||||
{ NULL, NULL }, { NULL, NULL }, #mod, #func, #name, 0, 0 } \
|
||||
{ NULL, NULL }, { NULL, NULL }, #mod, #func, #sname, 0, 0 } \
|
||||
}; \
|
||||
SYSINIT(sdt_##prov##_##mod##_##func##_##name##_init, SI_SUB_KDTRACE, \
|
||||
SI_ORDER_SECOND + 1, sdt_probe_register, \
|
||||
@ -168,30 +201,30 @@ struct sdt_provider {
|
||||
SI_SUB_KDTRACE, SI_ORDER_SECOND + 2, sdt_argtype_deregister, \
|
||||
sdt_##prov##_##mod##_##func##_##name##num )
|
||||
|
||||
#define SDT_PROBE_DEFINE1(prov, mod, func, name, arg0) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name); \
|
||||
#define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name, sname); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0)
|
||||
|
||||
#define SDT_PROBE_DEFINE2(prov, mod, func, name, arg0, arg1) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name); \
|
||||
#define SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name, sname); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1)
|
||||
|
||||
#define SDT_PROBE_DEFINE3(prov, mod, func, name, arg0, arg1, arg2) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name); \
|
||||
#define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2)\
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name, sname); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2)
|
||||
|
||||
#define SDT_PROBE_DEFINE4(prov, mod, func, name, arg0, arg1, arg2, arg3) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name); \
|
||||
#define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name, sname); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3)
|
||||
|
||||
#define SDT_PROBE_DEFINE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name); \
|
||||
#define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) \
|
||||
SDT_PROBE_DEFINE(prov, mod, func, name, sname); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \
|
||||
SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \
|
||||
|
@ -355,8 +355,8 @@ while ((getline < srcfile) > 0) {
|
||||
printc("};");
|
||||
|
||||
printc("\n");
|
||||
printc("SDT_PROBE_DEFINE2(vfs, vop, " name ", entry, \"struct vnode *\", \"struct " name "_args *\");\n");
|
||||
printc("SDT_PROBE_DEFINE3(vfs, vop, " name ", return, \"struct vnode *\", \"struct " name "_args *\", \"int\");\n");
|
||||
printc("SDT_PROBE_DEFINE2(vfs, vop, " name ", entry, entry, \"struct vnode *\", \"struct " name "_args *\");\n");
|
||||
printc("SDT_PROBE_DEFINE3(vfs, vop, " name ", return, return, \"struct vnode *\", \"struct " name "_args *\", \"int\");\n");
|
||||
|
||||
# Print out function.
|
||||
printc("\nint\n" uname "_AP(struct " name "_args *a)");
|
||||
|
Loading…
Reference in New Issue
Block a user