Project

General

Profile

Bug #4767

dtrace_probe() always has the timestamp

Added by Christopher Siden over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
DTrace
Start date:
2014-04-16
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Matt Ahrens:

dtrace_probe() always calls dtrace_gethrtime() (for cpu_dtrace_nsec), so we
should always save it in dtms_timestamp.

History

#1

Updated by Matthew Ahrens over 5 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).

#2

Updated by Electric Monk over 5 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>

#3

Updated by Joshua M. Clulow over 5 years ago

  • Status changed from In Progress to Closed
  • Tags deleted (needs-triage)

Also available in: Atom PDF