Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Nov 2006 00:49:25 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 109252 for review
Message-ID:  <200611050049.kA50nPwo000893@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109252

Change 109252 by jb@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611050049.kA50nPwo000893>