PERFORCE change 109252 for review
John Birrell
jb at FreeBSD.org
Sun Nov 5 00:49:26 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=109252
Change 109252 by jb at jb_freebsd8 on 2006/11/05 00:49:02
Merge the DTrace code back in. This is an example of a
DTrace support function required to allow the dtrace
module to load. It is coded here so that it can be
maintained with other similar code.
The function is named with the dtrace_ prefix so that
the DTrace FBT (function boundary trace) provider
knows not to try to trace it because it is called from
the DTrace probe context and tracing it would mean
a recursive trap.
Affected files ...
.. //depot/projects/dtrace/src/sys/i386/i386/tsc.c#7 edit
Differences ...
==== //depot/projects/dtrace/src/sys/i386/i386/tsc.c#7 (text+ko) ====
@@ -153,3 +153,18 @@
{
return (rdtsc());
}
+
+/*
+ * DTrace needs a high resolution time function which can
+ * be called from a probe context and guaranteed not to have
+ * instrumented with probes itself.
+ *
+ * Returns nanoseconds since boot.
+ */
+#ifdef KDTRACE
+uint64_t
+dtrace_gethrtime()
+{
+ return (rdtsc() * (uint64_t) 1000000000 / tsc_freq);
+}
+#endif
More information about the p4-projects
mailing list