PERFORCE change 100920 for review

John Birrell jb at FreeBSD.org
Fri Jul 7 18:56:00 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=100920

Change 100920 by jb at jb_freebsd2 on 2006/07/07 18:55:42

	Add a high resolution time function for DTrace. This is what
	it uses for vtime (thread execution time which takes into
	account of context switches).

Affected files ...

.. //depot/projects/dtrace/src/sys/sun4v/sun4v/tick.c#2 edit

Differences ...

==== //depot/projects/dtrace/src/sys/sun4v/sun4v/tick.c#2 (text+ko) ====

@@ -27,6 +27,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/sys/sparc64/sparc64/tick.c,v 1.20 2006/02/11 09:33:07 phk Exp $");
 
+#include "opt_kdtrace.h"
+
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
@@ -194,3 +196,17 @@
 	intr_restore_all(s);
 }
 
+/*
+ * 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 (rd(tick) * (uint64_t) 1000000000 / tick_freq);
+}
+#endif


More information about the p4-projects mailing list