PERFORCE change 97440 for review
John Birrell
jb at FreeBSD.org
Fri May 19 02:08:33 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=97440
Change 97440 by jb at jb_freebsd2 on 2006/05/19 02:07:44
One of the entertaining things about Statically Defined Tracing
(SDT) is that you can actually use it to trace parts of DTrace. As
long as it's in the client side. Obviously trying to trace things
that are called during probes would get anal-retentive very quickly.
In this case, just as an example, add SDT probes to the prototype
provider. This proves that they are (a) simple to code; and (b) work. 8-)
Affected files ...
.. //depot/projects/dtrace/src/sys/cddl/dev/prototype.c#2 edit
Differences ...
==== //depot/projects/dtrace/src/sys/cddl/dev/prototype.c#2 (text+ko) ====
@@ -59,6 +59,7 @@
#include <machine/stdarg.h>
#include <contrib/opensolaris/uts/common/sys/dtrace_impl.h>
+#include <sys/sdt.h>
static d_open_t prototype_open;
static int prototype_load(void);
@@ -102,6 +103,10 @@
static void
prototype_provide(void *arg, dtrace_probedesc_t *desc)
{
+ SDT_PROBE(prototype, provide, entry, arg, desc, 0, 0, 0);
+
+
+ SDT_PROBE(prototype, provide, return, arg, desc, 0, 0, 0);
}
/* ARGSUSED */
@@ -176,6 +181,7 @@
break;
}
+
return (error);
}
More information about the p4-projects
mailing list