svn commit: r252089 - stable/9/sys/sys
Mark Johnston
markj at FreeBSD.org
Sat Jun 22 04:50:26 UTC 2013
Author: markj
Date: Sat Jun 22 04:50:25 2013
New Revision: 252089
URL: http://svnweb.freebsd.org/changeset/base/252089
Log:
MFC r251166:
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.
Modified:
stable/9/sys/sys/sdt.h
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/sys/ (props changed)
Modified: stable/9/sys/sys/sdt.h
==============================================================================
--- stable/9/sys/sys/sdt.h Sat Jun 22 04:04:34 2013 (r252088)
+++ stable/9/sys/sys/sdt.h Sat Jun 22 04:50:25 2013 (r252089)
@@ -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
@@ -232,6 +239,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) \
@@ -244,6 +272,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 *);
More information about the svn-src-stable-9
mailing list