Bug #4767
closeddtrace_probe() always has the timestamp
100%
Description
Matt Ahrens:
dtrace_probe() always calls dtrace_gethrtime() (for cpu_dtrace_nsec), so we should always save it in dtms_timestamp.
Updated by Matthew Ahrens over 8 years ago
When you use the "timestamp" variable in a dtrace program, dtrace_probe() records the timestamp (from dtrace_gethrtime()) in dtms_timestamp. All references to "timestamp" in this probe firing will see the same value of timestamp (from dtms_timestamp) (unless the dtrace program does a "chill()" action which will clear DTRACE_MSTATE_TIMESTAMP, causing a new timestamp value to be retrieved).
dtrace_probe() is fairly careful to minimize the number of times it calls dtrace_gethrtime(), presumably for performance reasons. Now that it always calls dtrace_gethrtime() (to calculate the amount of time spent in dtrace_probe()), we might as well use this value of dtrace_gethrtime() to satisfy references to the "timestamp" variable as well, by storing it in dtms_timestamp. This reduces the number of times that dtrace_probe() calls dtrace_gethrtime() from 3 to 2 (assuming that the "timestamp" variable is used but "chill()" is not used).
Updated by Electric Monk over 8 years ago
git commit 82d86f4e8b1400610e24f161032c16e049f173a0
commit 82d86f4e8b1400610e24f161032c16e049f173a0 Author: Matthew Ahrens <mahrens@delphix.com> Date: 2014-04-22T17:36:36.000Z 4767 dtrace_probe() always has the timestamp Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Dan McDonald <danmcd@omniti.com>
Updated by Joshua M. Clulow over 8 years ago
- Status changed from In Progress to Closed
- Tags deleted (
needs-triage)