aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sdt.h
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2009-03-03 17:15:05 +0000
committerRobert Watson <rwatson@FreeBSD.org>2009-03-03 17:15:05 +0000
commit73e416e35d2cceae0909f39bfa24748005dbb369 (patch)
tree027048a8e3785e137899f5e1addf101afe8a9f7d /sys/sys/sdt.h
parent9c886c41819c7465b22d272f897343d2aa529464 (diff)
downloadsrc-73e416e35d2cceae0909f39bfa24748005dbb369.tar.gz
src-73e416e35d2cceae0909f39bfa24748005dbb369.zip
Reduce the verbosity of SDT trace points for DTrace by defining several
wrapper macros that allow trace points and arguments to be declared using a single macro rather than several. This means a lot less repetition and vertical space for each trace point. Use these macros when defining privilege and MAC Framework trace points. Reviewed by: jb MFC after: 1 week
Notes
Notes: svn path=/head/; revision=189311
Diffstat (limited to 'sys/sys/sdt.h')
-rw-r--r--sys/sys/sdt.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h
index 2bf2f2de77af..b2717b19a865 100644
--- a/sys/sys/sdt.h
+++ b/sys/sys/sdt.h
@@ -53,6 +53,12 @@
#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)
+
#else
/*
@@ -156,6 +162,36 @@ 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); \
+ 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); \
+ 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); \
+ 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); \
+ 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); \
+ 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) \
+ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4)
+
typedef int (*sdt_argtype_listall_func_t)(struct sdt_argtype *, void *);
typedef int (*sdt_probe_listall_func_t)(struct sdt_probe *, void *);
typedef int (*sdt_provider_listall_func_t)(struct sdt_provider *, void *);