Project

General

Profile

Actions

Feature #294

closed

Time stamp as clock cycle number

Added by Philippe Proulx almost 12 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Julien Desfossez
Category:
-
Target version:
-
Start date:
07/04/2012
Due date:
% Done:

0%

Estimated time:

Description

Add an option to Babeltrace so that it outputs the time stamps as clock cycle numbers.

I think LTTng 2 always sets a CTF clock frequency of 1 GHz, e.g.

clock {
        name = monotonic;
        uuid = "02fe53bd-4587-4704-b407-7d50c98c4d9b";
        description = "Monotonic Clock";
        freq = 1000000000; /* Frequency, in Hz */
        /* clock value offset from Epoch is: offset * (1/freq) */
        offset = 1337698044153589431;
};

and thus the time stamp unit is naturally the nanosecond. In this case, and in any case where the clock frequency is 10^x, the clock cycle can be seen in Babeltrace using --clock-raw and --clock-seconds:

[1735914.880434233] (+0.000000387) softirq_exit: { 2 }, { vec = 9 }

Here, 1735914.880434233 seconds means 1735914880434233 ns and since the frequency is 1 GHz, this means clock cycle 1735914880434233.

For other clock frequencies (CTF bare-metal tracing, etc.), it's impossible to get the exact clock cycles of events.

Note: clock cycles here are not necessarily CPU cycles (depends on the declared CTF clock frequency), but can be.

Suggestion to add a --clock-cycles (mutually exclusive from --clock-seconds) option to Babeltrace that makes it output the time stamps as plain integers (original clock cycles).

Actions #1

Updated by Julien Desfossez over 11 years ago

  • Status changed from New to Resolved
  • Assignee set to Julien Desfossez

implemented in commit 03798a93f959f6c694fe98f5647481947607c604

Actions

Also available in: Atom PDF