Split clock value API from clock class API
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 5 Sep 2017 22:09:49 +0000 (18:09 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 15 Sep 2017 18:48:43 +0000 (14:48 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/ctf-ir/clock-class-internal.h
include/babeltrace/ctf-ir/clock-value-internal.h [new file with mode: 0644]
include/babeltrace/ctf-ir/clock-value.h [new file with mode: 0644]
lib/ctf-ir/clock-class.c
lib/ctf-ir/event.c

index cd03f56ac35260252c2c6cb078ed8aab71f30f7f..22c1605f7dd28545f228ff981d1bdea5439796af 100644 (file)
@@ -2,11 +2,11 @@
 babeltraceincludedir = "$(includedir)/babeltrace"
 babeltraceinclude_HEADERS = \
        babeltrace/babeltrace.h \
-       babeltrace/values.h \
-       babeltrace/ref.h \
        babeltrace/logging.h \
-       babeltrace/version.h \
-       babeltrace/types.h
+       babeltrace/ref.h \
+       babeltrace/types.h \
+       babeltrace/values.h \
+       babeltrace/version.h
 
 # Legacy API (for CTF writer)
 babeltracectfincludedir = "$(includedir)/babeltrace/ctf"
@@ -17,25 +17,26 @@ babeltracectfinclude_HEADERS = \
 babeltracectfwriterincludedir = "$(includedir)/babeltrace/ctf-writer"
 babeltracectfwriterinclude_HEADERS = \
        babeltrace/ctf-writer/clock.h \
-       babeltrace/ctf-writer/writer.h \
        babeltrace/ctf-writer/event-fields.h \
        babeltrace/ctf-writer/event-types.h \
        babeltrace/ctf-writer/event.h \
+       babeltrace/ctf-writer/stream-class.h \
        babeltrace/ctf-writer/stream.h \
-       babeltrace/ctf-writer/stream-class.h
+       babeltrace/ctf-writer/writer.h
 
 # CTF IR API
 babeltracectfirincludedir = "$(includedir)/babeltrace/ctf-ir"
 babeltracectfirinclude_HEADERS = \
        babeltrace/ctf-ir/clock-class.h \
-       babeltrace/ctf-ir/fields.h \
-       babeltrace/ctf-ir/field-types.h \
-       babeltrace/ctf-ir/event.h \
+       babeltrace/ctf-ir/clock-value.h \
        babeltrace/ctf-ir/event-class.h \
+       babeltrace/ctf-ir/event.h \
        babeltrace/ctf-ir/field-path.h \
-       babeltrace/ctf-ir/stream.h \
+       babeltrace/ctf-ir/field-types.h \
+       babeltrace/ctf-ir/fields.h \
        babeltrace/ctf-ir/packet.h \
        babeltrace/ctf-ir/stream-class.h \
+       babeltrace/ctf-ir/stream.h \
        babeltrace/ctf-ir/trace.h \
        babeltrace/ctf-ir/utils.h \
        babeltrace/ctf-ir/visitor.h
@@ -43,8 +44,8 @@ babeltracectfirinclude_HEADERS = \
 # Plugin and plugin development API
 babeltracepluginincludedir = "$(includedir)/babeltrace/plugin"
 babeltraceplugininclude_HEADERS = \
-       babeltrace/plugin/plugin.h \
-       babeltrace/plugin/plugin-dev.h
+       babeltrace/plugin/plugin-dev.h \
+       babeltrace/plugin/plugin.h
 
 # Graph, component, and notification API
 babeltracegraphincludedir = "$(includedir)/babeltrace/graph"
@@ -67,9 +68,9 @@ babeltracegraphinclude_HEADERS = \
        babeltrace/graph/notification-heap.h \
        babeltrace/graph/notification-inactivity.h \
        babeltrace/graph/notification-iterator.h \
-       babeltrace/graph/notification.h \
        babeltrace/graph/notification-packet.h \
        babeltrace/graph/notification-stream.h \
+       babeltrace/graph/notification.h \
        babeltrace/graph/output-port-notification-iterator.h \
        babeltrace/graph/port.h \
        babeltrace/graph/private-component-filter.h \
@@ -103,6 +104,7 @@ noinst_HEADERS = \
        babeltrace/compiler-internal.h \
        babeltrace/ctf-ir/attributes-internal.h \
        babeltrace/ctf-ir/clock-class-internal.h \
+       babeltrace/ctf-ir/clock-value-internal.h \
        babeltrace/ctf-ir/event-class-internal.h \
        babeltrace/ctf-ir/event-internal.h \
        babeltrace/ctf-ir/field-path-internal.h \
index 45dac14d44a20d84bbab97f8f280babc690b4b8e..f1a798df8de033bd6bf6ac69461e121fe75e0f0d 100644 (file)
@@ -46,6 +46,7 @@
 
 /* CTF IR API */
 #include <babeltrace/ctf-ir/clock-class.h>
+#include <babeltrace/ctf-ir/clock-value.h>
 #include <babeltrace/ctf-ir/event-class.h>
 #include <babeltrace/ctf-ir/event.h>
 #include <babeltrace/ctf-ir/field-path.h>
index 7f901e7e0070483f12201b918976dcc8fe12773b..2b4fdcf4b76de377003a045c064dbec70cb494e3 100644 (file)
@@ -56,14 +56,6 @@ struct bt_ctf_clock_class {
        int frozen;
 };
 
-struct bt_ctf_clock_value {
-       struct bt_object base;
-       struct bt_ctf_clock_class *clock_class;
-       uint64_t value;
-       bool ns_from_epoch_overflows;
-       int64_t ns_from_epoch;
-};
-
 BT_HIDDEN
 void bt_ctf_clock_class_freeze(struct bt_ctf_clock_class *clock_class);
 
diff --git a/include/babeltrace/ctf-ir/clock-value-internal.h b/include/babeltrace/ctf-ir/clock-value-internal.h
new file mode 100644 (file)
index 0000000..7284a35
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef BABELTRACE_CTF_IR_CLOCK_VALUE_INTERNAL_H
+#define BABELTRACE_CTF_IR_CLOCK_VALUE_INTERNAL_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/object-internal.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+struct bt_ctf_clock_class;
+
+struct bt_ctf_clock_value {
+       struct bt_object base;
+       struct bt_ctf_clock_class *clock_class;
+       uint64_t value;
+       bool ns_from_epoch_overflows;
+       int64_t ns_from_epoch;
+};
+
+#endif /* BABELTRACE_CTF_IR_CLOCK_VALUE_INTERNAL_H */
diff --git a/include/babeltrace/ctf-ir/clock-value.h b/include/babeltrace/ctf-ir/clock-value.h
new file mode 100644 (file)
index 0000000..e7b91a9
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef BABELTRACE_CTF_IR_CLOCK_VALUE_H
+#define BABELTRACE_CTF_IR_CLOCK_VALUE_H
+
+/*
+ * BabelTrace - CTF IR: Clock class
+ *
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#include <stdint.h>
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_clock_class;
+struct bt_ctf_clock_value;
+
+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(
+               struct bt_ctf_clock_value *clock_value, int64_t *value_ns);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_CTF_IR_CLOCK_VALUE_H */
index 5ebeba5a73843ba03f4f39190e5b628a36c7867f..2dd6536a6d0f11054b6d3984604b3c4dd4d4f4b3 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <babeltrace/compat/uuid-internal.h>
 #include <babeltrace/ctf-ir/clock-class-internal.h>
+#include <babeltrace/ctf-ir/clock-value-internal.h>
 #include <babeltrace/ctf-ir/utils.h>
 #include <babeltrace/ref.h>
 #include <babeltrace/compiler-internal.h>
index cb1d9c86ce4bfc9ca32b19767ed96194d92d884b..62fc4328cb1081c972f13eb5616c30b1c18cf590 100644 (file)
@@ -32,6 +32,8 @@
 #include <babeltrace/ctf-ir/fields-internal.h>
 #include <babeltrace/ctf-ir/field-types-internal.h>
 #include <babeltrace/ctf-ir/clock-class.h>
+#include <babeltrace/ctf-ir/clock-value.h>
+#include <babeltrace/ctf-ir/clock-value-internal.h>
 #include <babeltrace/ctf-ir/clock-class-internal.h>
 #include <babeltrace/ctf-ir/event-internal.h>
 #include <babeltrace/ctf-ir/event-class.h>
This page took 0.028446 seconds and 4 git commands to generate.