bt_clock_class_create(): accept mandatory trace class
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 10 Dec 2018 16:13:21 +0000 (11:13 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commit0f2d58c93fe05b0f40c1c9589aa59d4f9cad877b
treefe861e6f288e91f4d4a8f6c0ccee33165ddd5008
parent416937235b48b55387c6074adc6a0dd59a5c76f4
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.026059 seconds and 4 git commands to generate.