Page MenuHomeFreeBSD

D28723.id84717.diff
No OneTemporary

D28723.id84717.diff

diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
--- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
@@ -153,23 +153,26 @@
}
/*
- * DTrace needs a high resolution time function which can
- * be called from a probe context and guaranteed not to have
- * instrumented with probes itself.
+ * 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.
+ * Returns nanoseconds since some arbitrary point in time (likely SoC reset?).
*/
uint64_t
-dtrace_gethrtime()
+dtrace_gethrtime(void)
{
- struct timespec curtime;
-
- dtrace_getnanouptime(&curtime);
-
- return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec);
+ uint64_t count, freq;
+ count = READ_SPECIALREG(cntvct_el0);
+ freq = READ_SPECIALREG(cntfrq_el0);
+ return ((1000000000UL * count) / freq);
}
+/*
+ * Return a much lower resolution wallclock time based on the system clock
+ * updated by the timer. If needed, we could add a version interpolated from
+ * the system clock as is the case with dtrace_gethrtime().
+ */
uint64_t
dtrace_gethrestime(void)
{

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 10, 8:43 PM (5 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29511636
Default Alt Text
D28723.id84717.diff (1 KB)

Event Timeline