Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168263792
D28723.id84060.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D28723.id84060.diff
View Options
Index: sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
===================================================================
--- sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
+++ 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 cyclecount, freq;
+ cyclecount = READ_SPECIALREG(cntvct_el0);
+ freq = READ_SPECIALREG(cntfrq_el0);
+ return ((1000000000UL * cyclecount) / 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 cycle counter, if that's desirable.
+ */
uint64_t
dtrace_gethrestime(void)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 28, 6:33 AM (5 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37440816
Default Alt Text
D28723.id84060.diff (1 KB)
Attached To
Mode
D28723: Reimplement dtrace_gethrtime() on arm64 to use the cycle counter.
Attached
Detach File
Event Timeline
Log In to Comment