Project

General

Profile

Actions

Bug #1129

closed

ctf writer: the timestamp value's monotonicity is validated globally, not by stream

Added by Geneviève Bastien over 6 years ago. Updated over 6 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
08/03/2017
Due date:
% Done:

0%

Estimated time:

Description

I'm using babeltrace python bindings to write a CTF trace. My event is taken in an ebpf program where the timestamp is set, then sent to userspace via a perf buffer and then processed (written to ctf).

My events are monotonic in a stream (cpu). But it may happen that events from another stream with later timestamps are written before my current event, so they are not globally monotonic.

In the CTF writer (clock.c, method bt_ctf_clock_set_time), the timestamps are validated for monotonicity globally, so that my event raises an error and is not written.

Actions #1

Updated by Jérémie Galarneau over 6 years ago

  • Status changed from New to Invalid

Adding the associated pull request for reference:
https://github.com/efficios/babeltrace/pull/76

An event's timestamp may be set in various different ways using the CTF Writer API. The one you are using, setting the clock's value and appending to the stream(s), is meant as a helper which indeed imposes the restriction of producing events monotonically (across all streams that are mapped to a given clock).

To achieve your use-case, you can set the "timestamp" field's value directly before appending the event. Keep in mind that this will bypass the helpers and that you will need to set the clock's value (in cycles) yourself. Don't forget to keep the frequency, offset and offset_s clock properties in mind when performing the conversion (see http://diamon.org/ctf/#spec8).

Let me know how that works out or if something's not clear.

Actions

Also available in: Atom PDF