bt_clock_class_create(): accept mandatory trace class
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 10 Dec 2018 16:13:21 +0000 (11:13 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:37 +0000 (18:19 -0400)
commit35fa110e5bea4a35497313adf3e3d0fa09db9ff7
treeca528f004ac53291ea3526e26f0855830525a67d
parente5e71bf8bba4250e56a4195a9e43bebf88134179
bt_clock_class_create(): accept mandatory trace class

This patch makes bt_clock_class_create() accept a mandatory trace class
parameter. This parameter is not used for the moment, but it could serve
in the future to control allocation (for example, object pooling),
bookkeeping, and validation.

I'm adding a public bt_util_clock_cycles_to_ns_from_origin() function to
get the nanoseconds from an origin using custom offsets and frequency.
This is the equivalent of bt_clock_class_cycles_to_ns_from_origin(), but
you don't need a clock class object, just its properties.

The `ctf` plugin is updated so that its CTF IR API has a
`struct ctf_clock_class`. `bt_clock_class` was the only remaining trace
IR object that was used as is, but it's not possible anymore because a
CTF IR metadata tree can exist without a trace IR trace class, and you
need a trace IR trace class to create a trace IR clock class. The
bt_clock_class_cycles_to_ns_from_origin() calls are replaced with
bt_util_clock_cycles_to_ns_from_origin() calls, passing the raw CTF IR
clock class properties.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
16 files changed:
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/trace-ir/clock-class.h
include/babeltrace/trace-ir/clock-snapshot-internal.h
include/babeltrace/trace-ir/utils-internal.h
include/babeltrace/util.h [new file with mode: 0644]
lib/Makefile.am
lib/trace-ir/clock-class.c
lib/util.c [new file with mode: 0644]
plugins/ctf/common/metadata/ctf-meta-translate.c
plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.c
plugins/ctf/common/metadata/ctf-meta.h
plugins/ctf/common/metadata/visitor-generate-ir.c
plugins/ctf/fs-src/data-stream-file.c
plugins/ctf/fs-src/fs.c
plugins/text/dmesg/dmesg.c
This page took 0.027171 seconds and 4 git commands to generate.