ir: add bt_ctf_event_get_clock_value()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 16 Feb 2016 07:23:26 +0000 (02:23 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 22 Feb 2016 19:46:07 +0000 (14:46 -0500)
commit41ac640a35c8f7ec7ffdb1d069180315533e7353
tree160fd65be219e8c9efd9dce3c40b820b4639b3b9
parentfa29ba839dc350d1e86ecc542a66b59a586e1ec1
ir: add bt_ctf_event_get_clock_value()

This patch adds a hash table of clocks to their current values (in
cycles) to the stream object. bt_ctf_stream_update_clock_value() can
be called to update the registered clock value of a given stream
from the current value of a given integer field, of which the type
is mapped to a clock. The function handles the case where the size of
the field is less than 64 bits and can make the current clock value
wrap once per call.

This patch also adds a similar hash table to the event object.
bt_ctf_event_register_stream_clock_values() is to be called by
internal code to take a snapshot of all the registered clock values
of the event's stream. The copied clock values can be retrieved by
the user later using bt_ctf_event_get_clock_value(), which should
return the value that a given clock had when the event was emitted.

This is intended to be used by sink components since the value
of a clock changes as events are created, whereas it is common
situation to hold an event and later need the clock values when
this event was emitted.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/event.c
formats/ctf/ir/stream.c
include/babeltrace/ctf-ir/event-internal.h
include/babeltrace/ctf-ir/event.h
include/babeltrace/ctf-ir/stream-internal.h
This page took 0.02503 seconds and 4 git commands to generate.