Date: Sat, 22 Jun 2013 04:52:12 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252090 - stable/8/sys/sys Message-ID: <201306220452.r5M4qCje080332@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Sat Jun 22 04:52:12 2013 New Revision: 252090 URL: http://svnweb.freebsd.org/changeset/base/252090 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/8/sys/sys/sdt.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/sys/sdt.h ============================================================================== --- stable/8/sys/sys/sdt.h Sat Jun 22 04:50:25 2013 (r252089) +++ stable/8/sys/sys/sdt.h Sat Jun 22 04:52:12 2013 (r252090) @@ -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 *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306220452.r5M4qCje080332>