aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sdt.h
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2013-05-30 21:57:40 +0000
committerMark Johnston <markj@FreeBSD.org>2013-05-30 21:57:40 +0000
commit3dd2790a9f0c63e68b7e5468520419022a318fe9 (patch)
tree66db714fe3e9f28c10ba182fd218f238449b5278 /sys/sys/sdt.h
parent356c1037fa4c4cc2e4e5ae50ccd998b3ee18f8e1 (diff)
downloadsrc-3dd2790a9f0c63e68b7e5468520419022a318fe9.tar.gz
src-3dd2790a9f0c63e68b7e5468520419022a318fe9.zip
Add macros which allow one to define SDT probes with six or seven arguments;
they are needed when porting some of the Solaris providers (ip, iscsi, and tcp in particular). dtrace_probe() only takes five arguments from the probe site, so we need to add the appropriate cast to allow for more than five arguments. The extra arguments are later copied out of dtrace_probe()'s stack frame by dtrace_getarg() (or the provider-specific getarg method) as needed. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=251166
Diffstat (limited to 'sys/sys/sdt.h')
-rw-r--r--sys/sys/sdt.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h
index 522e1f2d38b3..21edd53ecc84 100644
--- a/sys/sys/sdt.h
+++ b/sys/sys/sdt.h
@@ -91,6 +91,10 @@
#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_PROBE_DEFINE6(prov, mod, func, name, snamp, arg0, arg1, arg2, \
+ arg3, arg4, arg5)
+#define SDT_PROBE_DEFINE7(prov, mod, func, name, snamp, arg0, arg1, arg2, \
+ arg3, arg4, arg5, arg6)
#define SDT_PROBE0(prov, mod, func, name)
#define SDT_PROBE1(prov, mod, func, name, arg0)
@@ -98,6 +102,9 @@
#define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2)
#define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3)
#define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
+#define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5)
+#define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \
+ arg6)
#else
@@ -233,6 +240,27 @@ struct sdt_provider {
SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \
SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4)
+#define SDT_PROBE_DEFINE6(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\
+ arg4, arg5) \
+ 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); \
+ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \
+ SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5);
+
+#define SDT_PROBE_DEFINE7(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\
+ arg4, arg5, arg6) \
+ 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); \
+ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \
+ SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); \
+ SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6);
+
#define SDT_PROBE0(prov, mod, func, name) \
SDT_PROBE(prov, mod, func, name, 0, 0, 0, 0, 0)
#define SDT_PROBE1(prov, mod, func, name, arg0) \
@@ -245,6 +273,27 @@ struct sdt_provider {
SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0)
#define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \
SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
+#define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) \
+ do { \
+ if (sdt_##prov##_##mod##_##func##_##name->id) \
+ (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \
+ uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)( \
+ sdt_##prov##_##mod##_##func##_##name->id, \
+ (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \
+ (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\
+ } while (0)
+#define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \
+ arg6) \
+ do { \
+ if (sdt_##prov##_##mod##_##func##_##name->id) \
+ (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \
+ uintptr_t, uintptr_t, uintptr_t, uintptr_t)) \
+ sdt_probe_func)( \
+ sdt_##prov##_##mod##_##func##_##name->id, \
+ (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \
+ (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \
+ (uintptr_t)arg6); \
+ } while (0)
typedef int (*sdt_argtype_listall_func_t)(struct sdt_argtype *, void *);
typedef int (*sdt_probe_listall_func_t)(struct sdt_probe *, void *);