From 6f57e4587c51b2927b70142537c9a6d31fb3a693 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Sat, 4 Feb 2017 03:18:06 -0500 Subject: [PATCH] Add bt_ctf_clock_value_get_class() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- formats/ctf/ir/clock-class.c | 15 +++++++++++++++ include/babeltrace/ctf-ir/clock-class.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/formats/ctf/ir/clock-class.c b/formats/ctf/ir/clock-class.c index c51b5aab..66f7f440 100644 --- a/formats/ctf/ir/clock-class.c +++ b/formats/ctf/ir/clock-class.c @@ -480,3 +480,18 @@ int bt_ctf_clock_value_get_value_ns_from_epoch(struct bt_ctf_clock_value *value, end: return ret; } + +struct bt_ctf_clock_class *bt_ctf_clock_value_get_class( + struct bt_ctf_clock_value *clock_value) +{ + struct bt_ctf_clock_class *clock_class = NULL; + + if (!clock_value) { + goto end; + } + + clock_class = bt_get(clock_value->clock_class); + +end: + return clock_class; +} diff --git a/include/babeltrace/ctf-ir/clock-class.h b/include/babeltrace/ctf-ir/clock-class.h index c2b90173..d9c704d2 100644 --- a/include/babeltrace/ctf-ir/clock-class.h +++ b/include/babeltrace/ctf-ir/clock-class.h @@ -76,6 +76,8 @@ extern int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class, const unsigned char *uuid); extern struct bt_ctf_clock_value *bt_ctf_clock_value_create( struct bt_ctf_clock_class *clock_class, uint64_t value); +extern struct bt_ctf_clock_class *bt_ctf_clock_value_get_class( + struct bt_ctf_clock_value *clock_value); extern int bt_ctf_clock_value_get_value( struct bt_ctf_clock_value *clock_value, uint64_t *raw_value); extern int bt_ctf_clock_value_get_value_ns_from_epoch( -- 2.34.1