lib: add new clock class origin API
Add the new API set define the origin of clock classes. The origin is
now defined as a (namespace, name, unique-id) tuple.
If all three tuple elements are NULL, it means the origin is unknown or
undefined. Otherwise, the origin is defined, and the name and unique-id
be non-NULL (namespace may be NULL). There is one well-known origin,
the UNIX epoch, which is represented with the tuple
("babeltrace.org,2020", "unix-epoch", "").
The new API functions are (the numbers in square brackets represent the
MIP versions where these functions are allowed):
- bt_clock_class_set_origin_unknown [0, 1]
- bt_clock_class_set_origin_unix_epoch [0, 1]
- bt_clock_class_set_origin [1]
- bt_clock_class_get_origin_namespace [1]
- bt_clock_class_get_origin_name [1]
- bt_clock_class_get_origin_uid [1]
The existing function bt_clock_class_set_origin_is_unix_epoch (which
accepts a boolean) can still be used with MIP 1. If passed true, it is
equivalent to bt_clock_class_set_origin_unix_epoch. If passed false, it
is equivalent to bt_clock_class_set_origin_unknown.
The existing function bt_clock_class_origin_is_unix_epoch can still be
used with MIP 1.
Implementation-wise, replace the origin_is_unix_epoch boolean in struct
clock_class with the tuple of three strings. The behavior of the API
for MIP 0 doesn't change, even if the underlying implementation does.
With MIP 0, the user is still restricted to set or get whether the
origin is the UNIX epoch or is unknown, and can't access the individual
components of the origin.
Philippe updated the documentation.
Change-Id: I1225b89a679952e877583ec8147008928a16eb45
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12677
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.024512 seconds and 4 git commands to generate.