From 56e18c4ce186892c36d7f2cb5078087425e60134 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 15 Nov 2018 08:20:23 -0500 Subject: [PATCH] CTF IR -> Trace IR Also, keep an `include/babeltrace/ctf-ir` directory of which the headers are only including corresponding CTF writer headers for backward compatibility. Signed-off-by: Philippe Proulx --- .gitignore | 4 +- CONTRIBUTING.adoc | 6 +- configure.ac | 6 +- include/Makefile.am | 63 +++-- include/babeltrace/babeltrace.h | 32 +-- include/babeltrace/common-internal.h | 6 +- include/babeltrace/ctf-ir/clock.h | 35 +-- include/babeltrace/ctf-ir/event-class.h | 114 +-------- include/babeltrace/ctf-ir/event-fields.h | 2 + include/babeltrace/ctf-ir/event-types.h | 2 + include/babeltrace/ctf-ir/event.h | 81 +------ include/babeltrace/ctf-ir/field-types.h | 224 +----------------- include/babeltrace/ctf-ir/fields.h | 119 +--------- include/babeltrace/ctf-ir/stream-class.h | 149 +----------- include/babeltrace/ctf-ir/stream.h | 64 +---- include/babeltrace/ctf-ir/trace.h | 129 +--------- include/babeltrace/ctf-ir/utils.h | 2 + include/babeltrace/ctf-writer/visitor.h | 2 +- include/babeltrace/ctf/events.h | 36 +-- .../graph/notification-event-internal.h | 4 +- .../graph/notification-inactivity-internal.h | 2 +- .../babeltrace/graph/notification-internal.h | 2 +- .../graph/notification-packet-internal.h | 2 +- .../graph/notification-stream-internal.h | 4 +- include/babeltrace/lib-logging-internal.h | 20 +- .../attributes-internal.h | 8 +- .../clock-class-internal.h | 10 +- .../{ctf-ir => trace-ir}/clock-class.h | 8 +- .../clock-value-internal.h | 10 +- .../clock-value-set-internal.h | 4 +- .../{ctf-ir => trace-ir}/clock-value.h | 8 +- include/babeltrace/trace-ir/clock.h | 35 +++ .../event-class-internal.h | 20 +- include/babeltrace/trace-ir/event-class.h | 112 +++++++++ .../{ctf-ir => trace-ir}/event-header-field.h | 6 +- .../{ctf-ir => trace-ir}/event-internal.h | 28 +-- include/babeltrace/trace-ir/event.h | 79 ++++++ .../field-path-internal.h | 10 +- .../{ctf-ir => trace-ir}/field-path.h | 8 +- .../field-types-internal.h | 12 +- include/babeltrace/trace-ir/field-types.h | 222 +++++++++++++++++ .../field-wrapper-internal.h | 8 +- .../{ctf-ir => trace-ir}/fields-internal.h | 12 +- include/babeltrace/trace-ir/fields.h | 117 +++++++++ .../packet-context-field.h | 6 +- .../packet-header-field.h | 6 +- .../{ctf-ir => trace-ir}/packet-internal.h | 18 +- .../babeltrace/{ctf-ir => trace-ir}/packet.h | 10 +- .../resolve-field-path-internal.h | 12 +- .../{ctf-ir => trace-ir}/resolve-internal.h | 14 +- .../stream-class-internal.h | 14 +- include/babeltrace/trace-ir/stream-class.h | 147 ++++++++++++ .../{ctf-ir => trace-ir}/stream-internal.h | 10 +- include/babeltrace/trace-ir/stream.h | 62 +++++ .../{ctf-ir => trace-ir}/trace-internal.h | 20 +- include/babeltrace/trace-ir/trace.h | 127 ++++++++++ .../{ctf-ir => trace-ir}/utils-internal.h | 12 +- lib/Makefile.am | 6 +- lib/graph/iterator.c | 12 +- lib/graph/notification/event.c | 10 +- lib/graph/notification/inactivity.c | 4 +- lib/graph/notification/packet.c | 10 +- lib/graph/notification/stream.c | 6 +- lib/lib-logging.c | 24 +- lib/{ctf-ir => trace-ir}/Makefile.am | 6 +- lib/{ctf-ir => trace-ir}/attributes.c | 2 +- lib/{ctf-ir => trace-ir}/clock-class.c | 8 +- lib/{ctf-ir => trace-ir}/clock-value.c | 4 +- lib/{ctf-ir => trace-ir}/event-class.c | 28 +-- lib/{ctf-ir => trace-ir}/event-header-field.c | 8 +- lib/{ctf-ir => trace-ir}/event.c | 38 +-- lib/{ctf-ir => trace-ir}/field-path.c | 10 +- lib/{ctf-ir => trace-ir}/field-types.c | 16 +- lib/{ctf-ir => trace-ir}/field-wrapper.c | 4 +- lib/{ctf-ir => trace-ir}/fields.c | 8 +- .../packet-context-field.c | 8 +- .../packet-header-field.c | 8 +- lib/{ctf-ir => trace-ir}/packet.c | 24 +- lib/{ctf-ir => trace-ir}/resolve-field-path.c | 8 +- lib/{ctf-ir => trace-ir}/stream-class.c | 18 +- lib/{ctf-ir => trace-ir}/stream.c | 16 +- lib/{ctf-ir => trace-ir}/trace.c | 26 +- lib/{ctf-ir => trace-ir}/utils.c | 8 +- plugins/ctf/fs-src/fs.h | 2 +- tests/Makefile.am | 4 +- tests/lib/Makefile.am | 8 +- tests/lib/test_bt_notification_iterator.c | 16 +- tests/lib/test_ir_visit.c | 12 +- tests/lib/test_plugin.c | 2 +- ...{test_ctf_ir_ref.c => test_trace_ir_ref.c} | 30 +-- tests/lib/{ctf-ir => trace-ir}/Makefile.am | 2 +- .../{ctf-ir => trace-ir}/test_stream_class.py | 0 tests/lib/{ctf-ir => trace-ir}/test_trace.py | 0 .../test_trace_ir.in} | 2 +- 94 files changed, 1345 insertions(+), 1338 deletions(-) create mode 100644 include/babeltrace/ctf-ir/event-fields.h create mode 100644 include/babeltrace/ctf-ir/event-types.h create mode 100644 include/babeltrace/ctf-ir/utils.h rename include/babeltrace/{ctf-ir => trace-ir}/attributes-internal.h (92%) rename include/babeltrace/{ctf-ir => trace-ir}/clock-class-internal.h (92%) rename include/babeltrace/{ctf-ir => trace-ir}/clock-class.h (94%) rename include/babeltrace/{ctf-ir => trace-ir}/clock-value-internal.h (91%) rename include/babeltrace/{ctf-ir => trace-ir}/clock-value-set-internal.h (97%) rename include/babeltrace/{ctf-ir => trace-ir}/clock-value.h (91%) create mode 100644 include/babeltrace/trace-ir/clock.h rename include/babeltrace/{ctf-ir => trace-ir}/event-class-internal.h (83%) create mode 100644 include/babeltrace/trace-ir/event-class.h rename include/babeltrace/{ctf-ir => trace-ir}/event-header-field.h (91%) rename include/babeltrace/{ctf-ir => trace-ir}/event-internal.h (90%) create mode 100644 include/babeltrace/trace-ir/event.h rename include/babeltrace/{ctf-ir => trace-ir}/field-path-internal.h (88%) rename include/babeltrace/{ctf-ir => trace-ir}/field-path.h (91%) rename include/babeltrace/{ctf-ir => trace-ir}/field-types-internal.h (96%) create mode 100644 include/babeltrace/trace-ir/field-types.h rename include/babeltrace/{ctf-ir => trace-ir}/field-wrapper-internal.h (88%) rename include/babeltrace/{ctf-ir => trace-ir}/fields-internal.h (95%) create mode 100644 include/babeltrace/trace-ir/fields.h rename include/babeltrace/{ctf-ir => trace-ir}/packet-context-field.h (91%) rename include/babeltrace/{ctf-ir => trace-ir}/packet-header-field.h (91%) rename include/babeltrace/{ctf-ir => trace-ir}/packet-internal.h (83%) rename include/babeltrace/{ctf-ir => trace-ir}/packet.h (93%) rename include/babeltrace/{ctf-ir => trace-ir}/resolve-field-path-internal.h (85%) rename include/babeltrace/{ctf-ir => trace-ir}/resolve-internal.h (87%) rename include/babeltrace/{ctf-ir => trace-ir}/stream-class-internal.h (88%) create mode 100644 include/babeltrace/trace-ir/stream-class.h rename include/babeltrace/{ctf-ir => trace-ir}/stream-internal.h (89%) create mode 100644 include/babeltrace/trace-ir/stream.h rename include/babeltrace/{ctf-ir => trace-ir}/trace-internal.h (85%) create mode 100644 include/babeltrace/trace-ir/trace.h rename include/babeltrace/{ctf-ir => trace-ir}/utils-internal.h (91%) rename lib/{ctf-ir => trace-ir}/Makefile.am (75%) rename lib/{ctf-ir => trace-ir}/attributes.c (99%) rename lib/{ctf-ir => trace-ir}/clock-class.c (98%) rename lib/{ctf-ir => trace-ir}/clock-value.c (97%) rename lib/{ctf-ir => trace-ir}/event-class.c (94%) rename lib/{ctf-ir => trace-ir}/event-header-field.c (93%) rename lib/{ctf-ir => trace-ir}/event.c (90%) rename lib/{ctf-ir => trace-ir}/field-path.c (92%) rename lib/{ctf-ir => trace-ir}/field-types.c (98%) rename lib/{ctf-ir => trace-ir}/field-wrapper.c (96%) rename lib/{ctf-ir => trace-ir}/fields.c (99%) rename lib/{ctf-ir => trace-ir}/packet-context-field.c (93%) rename lib/{ctf-ir => trace-ir}/packet-header-field.c (93%) rename lib/{ctf-ir => trace-ir}/packet.c (96%) rename lib/{ctf-ir => trace-ir}/resolve-field-path.c (98%) rename lib/{ctf-ir => trace-ir}/stream-class.c (97%) rename lib/{ctf-ir => trace-ir}/stream.c (94%) rename lib/{ctf-ir => trace-ir}/trace.c (96%) rename lib/{ctf-ir => trace-ir}/utils.c (89%) rename tests/lib/{test_ctf_ir_ref.c => test_trace_ir_ref.c} (96%) rename tests/lib/{ctf-ir => trace-ir}/Makefile.am (72%) rename tests/lib/{ctf-ir => trace-ir}/test_stream_class.py (100%) rename tests/lib/{ctf-ir => trace-ir}/test_trace.py (100%) rename tests/lib/{ctf-ir/test_ctf_ir.in => trace-ir/test_trace_ir.in} (96%) diff --git a/.gitignore b/.gitignore index b2dcb450..0ef95c97 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ /tests/lib/test_bt_notification_heap /tests/lib/test_bt_objects /tests/lib/test_bt_values -/tests/lib/test_ctf_ir_ref +/tests/lib/test_trace_ir_ref /tests/lib/test_ctf_writer /tests/lib/test_ctf_writer_complete /tests/lib/test_dwarf @@ -33,7 +33,7 @@ /tests/lib/test_bt_notification_iterator /tests/lib/test_cc_prio_map /tests/lib/test_graph_topo -/tests/lib/ctf-ir/test_ctf_ir +/tests/lib/trace-ir/test_trace_ir /tests/lib/ctf-writer/test_ctf_writer /tests/plugins/test-utils-muxer /tests/plugins/test-utils-muxer-complete diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index f18f9b06..bc6ff471 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -69,9 +69,9 @@ node of the graph keeps all other reachable nodes alive. The scheme employed in Babeltrace to break this cycle consists in the "children" holding *reverse component references* to their parents. That -is, in the context of CTF IR, that event classes hold a reference to -their parent stream class and stream classes hold a reference to their -parent trace. +is, in the context of the trace IR, that event classes hold a reference +to their parent stream class and stream classes hold a reference to +their parent trace. On the other hand, parents hold *claiming aggregation references* to their children. A claiming aggregation reference means that the object diff --git a/configure.ac b/configure.ac index 16d45c81..bf065d63 100644 --- a/configure.ac +++ b/configure.ac @@ -744,7 +744,7 @@ AC_CONFIG_FILES([ lib/plugin/Makefile lib/graph/Makefile lib/graph/notification/Makefile - lib/ctf-ir/Makefile + lib/trace-ir/Makefile lib/ctf-writer/Makefile include/Makefile logging/Makefile @@ -754,7 +754,7 @@ AC_CONFIG_FILES([ tests/cli/intersection/Makefile tests/lib/Makefile tests/lib/test-plugin-plugins/Makefile - tests/lib/ctf-ir/Makefile + tests/lib/trace-ir/Makefile tests/lib/ctf-writer/Makefile tests/utils/common.sh tests/utils/Makefile @@ -800,7 +800,7 @@ AC_CONFIG_FILES([tests/cli/test_trace_read], [chmod +x tests/cli/test_trace_read AC_CONFIG_FILES([tests/cli/test_trimmer], [chmod +x tests/cli/test_trimmer]) AC_CONFIG_FILES([tests/lib/test_ctf_writer_complete], [chmod +x tests/lib/test_ctf_writer_complete]) AC_CONFIG_FILES([tests/lib/test_plugin_complete], [chmod +x tests/lib/test_plugin_complete]) -AC_CONFIG_FILES([tests/lib/ctf-ir/test_ctf_ir], [chmod +x tests/lib/ctf-ir/test_ctf_ir]) +AC_CONFIG_FILES([tests/lib/trace-ir/test_trace_ir], [chmod +x tests/lib/trace-ir/test_trace_ir]) AC_CONFIG_FILES([tests/lib/ctf-writer/test_ctf_writer], [chmod +x tests/lib/ctf-writer/test_ctf_writer]) AC_CONFIG_FILES([tests/plugins/test-utils-muxer-complete], [chmod +x tests/plugins/test-utils-muxer-complete]) AC_CONFIG_FILES([tests/plugins/test_lttng_utils_debug_info], [chmod +x tests/plugins/test_lttng_utils_debug_info]) diff --git a/include/Makefile.am b/include/Makefile.am index 0bdd90a8..11ecd94c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -99,24 +99,39 @@ babeltracectfwriterinclude_HEADERS = \ babeltrace/ctf-writer/visitor.h \ babeltrace/ctf-writer/writer.h -# CTF IR API +# Legacy API (for CTF writer) babeltracectfirincludedir = "$(includedir)/babeltrace/ctf-ir" babeltracectfirinclude_HEADERS = \ - babeltrace/ctf-ir/clock-class.h \ - babeltrace/ctf-ir/clock-value.h \ babeltrace/ctf-ir/clock.h \ babeltrace/ctf-ir/event-class.h \ + babeltrace/ctf-ir/event-fields.h \ + babeltrace/ctf-ir/event-types.h \ babeltrace/ctf-ir/event.h \ - babeltrace/ctf-ir/event-header-field.h \ - babeltrace/ctf-ir/field-path.h \ babeltrace/ctf-ir/field-types.h \ babeltrace/ctf-ir/fields.h \ - babeltrace/ctf-ir/packet.h \ - babeltrace/ctf-ir/packet-context-field.h \ - babeltrace/ctf-ir/packet-header-field.h \ babeltrace/ctf-ir/stream-class.h \ babeltrace/ctf-ir/stream.h \ - babeltrace/ctf-ir/trace.h + babeltrace/ctf-ir/trace.h \ + babeltrace/ctf-ir/utils.h + + +# Trace IR API +babeltracetraceirincludedir = "$(includedir)/babeltrace/trace-ir" +babeltracetraceirinclude_HEADERS = \ + babeltrace/trace-ir/clock-class.h \ + babeltrace/trace-ir/clock-value.h \ + babeltrace/trace-ir/event-class.h \ + babeltrace/trace-ir/event.h \ + babeltrace/trace-ir/event-header-field.h \ + babeltrace/trace-ir/field-path.h \ + babeltrace/trace-ir/field-types.h \ + babeltrace/trace-ir/fields.h \ + babeltrace/trace-ir/packet.h \ + babeltrace/trace-ir/packet-context-field.h \ + babeltrace/trace-ir/packet-header-field.h \ + babeltrace/trace-ir/stream-class.h \ + babeltrace/trace-ir/stream.h \ + babeltrace/trace-ir/trace.h # Plugin and plugin development API babeltracepluginincludedir = "$(includedir)/babeltrace/plugin" @@ -202,21 +217,21 @@ noinst_HEADERS = \ babeltrace/align-internal.h \ babeltrace/logging-internal.h \ babeltrace/endian-internal.h \ - babeltrace/ctf-ir/packet-internal.h \ - babeltrace/ctf-ir/event-class-internal.h \ - babeltrace/ctf-ir/utils-internal.h \ - babeltrace/ctf-ir/fields-internal.h \ - babeltrace/ctf-ir/stream-class-internal.h \ - babeltrace/ctf-ir/event-internal.h \ - babeltrace/ctf-ir/field-path-internal.h \ - babeltrace/ctf-ir/field-wrapper-internal.h \ - babeltrace/ctf-ir/trace-internal.h \ - babeltrace/ctf-ir/clock-class-internal.h \ - babeltrace/ctf-ir/field-types-internal.h \ - babeltrace/ctf-ir/clock-value-internal.h \ - babeltrace/ctf-ir/attributes-internal.h \ - babeltrace/ctf-ir/stream-internal.h \ - babeltrace/ctf-ir/resolve-field-path-internal.h \ + babeltrace/trace-ir/packet-internal.h \ + babeltrace/trace-ir/event-class-internal.h \ + babeltrace/trace-ir/utils-internal.h \ + babeltrace/trace-ir/fields-internal.h \ + babeltrace/trace-ir/stream-class-internal.h \ + babeltrace/trace-ir/event-internal.h \ + babeltrace/trace-ir/field-path-internal.h \ + babeltrace/trace-ir/field-wrapper-internal.h \ + babeltrace/trace-ir/trace-internal.h \ + babeltrace/trace-ir/clock-class-internal.h \ + babeltrace/trace-ir/field-types-internal.h \ + babeltrace/trace-ir/clock-value-internal.h \ + babeltrace/trace-ir/attributes-internal.h \ + babeltrace/trace-ir/stream-internal.h \ + babeltrace/trace-ir/resolve-field-path-internal.h \ babeltrace/prio-heap-internal.h \ babeltrace/lib-logging-internal.h \ babeltrace/compiler-internal.h \ diff --git a/include/babeltrace/babeltrace.h b/include/babeltrace/babeltrace.h index 3f99631d..ab8a95cc 100644 --- a/include/babeltrace/babeltrace.h +++ b/include/babeltrace/babeltrace.h @@ -49,22 +49,22 @@ #include #include -/* CTF IR API */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/* Trace IR API */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Plugin and plugin development API */ #include diff --git a/include/babeltrace/common-internal.h b/include/babeltrace/common-internal.h index e22a9231..584e38a1 100644 --- a/include/babeltrace/common-internal.h +++ b/include/babeltrace/common-internal.h @@ -4,9 +4,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/include/babeltrace/ctf-ir/clock.h b/include/babeltrace/ctf-ir/clock.h index 5f08ac1d..72ca2a3a 100644 --- a/include/babeltrace/ctf-ir/clock.h +++ b/include/babeltrace/ctf-ir/clock.h @@ -1,35 +1,2 @@ -#ifndef BABELTRACE_CTF_IR_CLOCK_H -#define BABELTRACE_CTF_IR_CLOCK_H - -/* - * BabelTrace - CTF IR: Clock - * - * Copyright 2018 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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 - */ - +/* Pre-2.0 CTF writer backward compatibility */ #include - -#endif /* BABELTRACE_CTF_IR_CLOCK_H */ diff --git a/include/babeltrace/ctf-ir/event-class.h b/include/babeltrace/ctf-ir/event-class.h index 8752b406..f687a7d1 100644 --- a/include/babeltrace/ctf-ir/event-class.h +++ b/include/babeltrace/ctf-ir/event-class.h @@ -1,112 +1,2 @@ -#ifndef BABELTRACE_CTF_IR_EVENT_CLASS_H -#define BABELTRACE_CTF_IR_EVENT_CLASS_H - -/* - * BabelTrace - CTF IR: Event class - * - * Copyright 2013, 2014 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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 - */ - -/* For enum bt_property_availability */ -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct bt_event_class; -struct bt_field_type; -struct bt_stream_class; - -enum bt_event_class_log_level { - BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY, - BT_EVENT_CLASS_LOG_LEVEL_ALERT, - BT_EVENT_CLASS_LOG_LEVEL_CRITICAL, - BT_EVENT_CLASS_LOG_LEVEL_ERROR, - BT_EVENT_CLASS_LOG_LEVEL_WARNING, - BT_EVENT_CLASS_LOG_LEVEL_NOTICE, - BT_EVENT_CLASS_LOG_LEVEL_INFO, - BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM, - BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM, - BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS, - BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE, - BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT, - BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION, - BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE, - BT_EVENT_CLASS_LOG_LEVEL_DEBUG, -}; - -extern struct bt_event_class *bt_event_class_create( - struct bt_stream_class *stream_class); - -extern struct bt_event_class *bt_event_class_create_with_id( - struct bt_stream_class *stream_class, uint64_t id); - -extern struct bt_stream_class *bt_event_class_borrow_stream_class( - struct bt_event_class *event_class); - -extern const char *bt_event_class_get_name(struct bt_event_class *event_class); - -extern int bt_event_class_set_name(struct bt_event_class *event_class, - const char *name); - -extern uint64_t bt_event_class_get_id(struct bt_event_class *event_class); - -extern enum bt_property_availability bt_event_class_get_log_level( - struct bt_event_class *event_class, - enum bt_event_class_log_level *log_level); - -extern int bt_event_class_set_log_level(struct bt_event_class *event_class, - enum bt_event_class_log_level log_level); - -extern const char *bt_event_class_get_emf_uri( - struct bt_event_class *event_class); - -extern int bt_event_class_set_emf_uri(struct bt_event_class *event_class, - const char *emf_uri); - -extern struct bt_field_type *bt_event_class_borrow_specific_context_field_type( - struct bt_event_class *event_class); - -extern int bt_event_class_set_specific_context_field_type( - struct bt_event_class *event_class, - struct bt_field_type *field_type); - -extern struct bt_field_type *bt_event_class_borrow_payload_field_type( - struct bt_event_class *event_class); - -extern int bt_event_class_set_payload_field_type( - struct bt_event_class *event_class, - struct bt_field_type *field_type); - -#ifdef __cplusplus -} -#endif - -#endif /* BABELTRACE_CTF_IR_EVENT_CLASS_H */ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/event-fields.h b/include/babeltrace/ctf-ir/event-fields.h new file mode 100644 index 00000000..0c9395a7 --- /dev/null +++ b/include/babeltrace/ctf-ir/event-fields.h @@ -0,0 +1,2 @@ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/event-types.h b/include/babeltrace/ctf-ir/event-types.h new file mode 100644 index 00000000..5bbdda27 --- /dev/null +++ b/include/babeltrace/ctf-ir/event-types.h @@ -0,0 +1,2 @@ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/event.h b/include/babeltrace/ctf-ir/event.h index 67df08b5..3106be8d 100644 --- a/include/babeltrace/ctf-ir/event.h +++ b/include/babeltrace/ctf-ir/event.h @@ -1,79 +1,2 @@ -#ifndef BABELTRACE_CTF_IR_EVENT_H -#define BABELTRACE_CTF_IR_EVENT_H - -/* - * BabelTrace - CTF IR: Event - * - * Copyright 2013, 2014 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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 -#include - -/* For enum bt_clock_value_status */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct bt_event; -struct bt_event_header_field; -struct bt_clock_value; -struct bt_event_class; -struct bt_field; -struct bt_packet; - -extern struct bt_event_class *bt_event_borrow_class(struct bt_event *event); - -extern struct bt_packet *bt_event_borrow_packet(struct bt_event *event); - -extern struct bt_stream *bt_event_borrow_stream(struct bt_event *event); - -extern struct bt_field *bt_event_borrow_header_field(struct bt_event *event); - -extern int bt_event_move_header(struct bt_event *event, - struct bt_event_header_field *header); - -extern struct bt_field *bt_event_borrow_common_context_field( - struct bt_event *event); - -extern struct bt_field *bt_event_borrow_specific_context_field( - struct bt_event *event); - -extern struct bt_field *bt_event_borrow_payload_field(struct bt_event *event); - -extern int bt_event_set_default_clock_value(struct bt_event *event, - uint64_t value_cycles); - -extern enum bt_clock_value_status bt_event_borrow_default_clock_value( - struct bt_event *event, struct bt_clock_value **clock_value); - -#ifdef __cplusplus -} -#endif - -#endif /* BABELTRACE_CTF_IR_EVENT_H */ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/field-types.h b/include/babeltrace/ctf-ir/field-types.h index 95bc646c..ba9e929c 100644 --- a/include/babeltrace/ctf-ir/field-types.h +++ b/include/babeltrace/ctf-ir/field-types.h @@ -1,222 +1,2 @@ -#ifndef BABELTRACE_CTF_IR_FIELD_TYPES_H -#define BABELTRACE_CTF_IR_FIELD_TYPES_H - -/* - * BabelTrace - CTF IR: Event field types - * - * Copyright 2013, 2014 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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 - */ - -/* For bt_get() */ -#include - -/* For bt_bool */ -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct bt_field_type; -struct bt_field_path; -struct bt_field_type_signed_enumeration_mapping_ranges; -struct bt_field_type_unsigned_enumeration_mapping_ranges; - -typedef const char * const *bt_field_type_enumeration_mapping_label_array; - -enum bt_field_type_id { - BT_FIELD_TYPE_ID_UNSIGNED_INTEGER, - BT_FIELD_TYPE_ID_SIGNED_INTEGER, - BT_FIELD_TYPE_ID_UNSIGNED_ENUMERATION, - BT_FIELD_TYPE_ID_SIGNED_ENUMERATION, - BT_FIELD_TYPE_ID_REAL, - BT_FIELD_TYPE_ID_STRING, - BT_FIELD_TYPE_ID_STRUCTURE, - BT_FIELD_TYPE_ID_STATIC_ARRAY, - BT_FIELD_TYPE_ID_DYNAMIC_ARRAY, - BT_FIELD_TYPE_ID_VARIANT, -}; - -enum bt_field_type_integer_preferred_display_base { - BT_FIELD_TYPE_INTEGER_PREFERRED_DISPLAY_BASE_BINARY, - BT_FIELD_TYPE_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL, - BT_FIELD_TYPE_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, - BT_FIELD_TYPE_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL, -}; - -extern enum bt_field_type_id bt_field_type_get_type_id( - struct bt_field_type *field_type); - -extern struct bt_field_type *bt_field_type_unsigned_integer_create(void); - -extern struct bt_field_type *bt_field_type_signed_integer_create(void); - -extern uint64_t bt_field_type_integer_get_field_value_range( - struct bt_field_type *field_type); - -extern int bt_field_type_integer_set_field_value_range( - struct bt_field_type *field_type, uint64_t size); - -extern enum bt_field_type_integer_preferred_display_base -bt_field_type_integer_get_preferred_display_base( - struct bt_field_type *field_type); - -extern int bt_field_type_integer_set_preferred_display_base( - struct bt_field_type *field_type, - enum bt_field_type_integer_preferred_display_base base); - -extern struct bt_field_type *bt_field_type_real_create(void); - -extern bt_bool bt_field_type_real_is_single_precision( - struct bt_field_type *field_type); - -extern int bt_field_type_real_set_is_single_precision( - struct bt_field_type *field_type, - bt_bool is_single_precision); - -extern struct bt_field_type *bt_field_type_unsigned_enumeration_create(void); - -extern struct bt_field_type *bt_field_type_signed_enumeration_create(void); - -extern uint64_t bt_field_type_enumeration_get_mapping_count( - struct bt_field_type *field_type); - -extern void bt_field_type_unsigned_enumeration_borrow_mapping_by_index( - struct bt_field_type *field_type, uint64_t index, - const char **label, - struct bt_field_type_unsigned_enumeration_mapping_ranges **ranges); - -extern void bt_field_type_signed_enumeration_borrow_mapping_by_index( - struct bt_field_type *field_type, uint64_t index, - const char **label, - struct bt_field_type_signed_enumeration_mapping_ranges **ranges); - -extern uint64_t bt_field_type_unsigned_enumeration_mapping_ranges_get_range_count( - struct bt_field_type_unsigned_enumeration_mapping_ranges *ranges); - -extern uint64_t bt_field_type_signed_enumeration_mapping_ranges_get_range_count( - struct bt_field_type_signed_enumeration_mapping_ranges *ranges); - -extern void bt_field_type_unsigned_enumeration_mapping_ranges_get_range_by_index( - struct bt_field_type_unsigned_enumeration_mapping_ranges *ranges, - uint64_t index, uint64_t *lower, uint64_t *upper); - -extern void bt_field_type_signed_enumeration_mapping_ranges_get_range_by_index( - struct bt_field_type_unsigned_enumeration_mapping_ranges *ranges, - uint64_t index, int64_t *lower, int64_t *upper); - -extern int bt_field_type_unsigned_enumeration_get_mapping_labels_by_value( - struct bt_field_type *field_type, uint64_t value, - bt_field_type_enumeration_mapping_label_array *label_array, - uint64_t *count); - -extern int bt_field_type_signed_enumeration_get_mapping_labels_by_value( - struct bt_field_type *field_type, int64_t value, - bt_field_type_enumeration_mapping_label_array *label_array, - uint64_t *count); - -extern int bt_field_type_unsigned_enumeration_map_range( - struct bt_field_type *field_type, const char *label, - uint64_t range_lower, uint64_t range_upper); - -extern int bt_field_type_signed_enumeration_map_range( - struct bt_field_type *field_type, const char *label, - int64_t range_lower, int64_t range_upper); - -extern struct bt_field_type *bt_field_type_string_create(void); - -extern struct bt_field_type *bt_field_type_structure_create(void); - -extern uint64_t bt_field_type_structure_get_member_count( - struct bt_field_type *field_type); - -extern void bt_field_type_structure_borrow_member_by_index( - struct bt_field_type *struct_field_type, uint64_t index, - const char **name, struct bt_field_type **field_type); - -extern -struct bt_field_type *bt_field_type_structure_borrow_member_field_type_by_name( - struct bt_field_type *field_type, const char *name); - -extern int bt_field_type_structure_append_member( - struct bt_field_type *struct_field_type, const char *name, - struct bt_field_type *field_type); - -extern struct bt_field_type *bt_field_type_static_array_create( - struct bt_field_type *elem_field_type, - uint64_t length); - -extern struct bt_field_type *bt_field_type_dynamic_array_create( - struct bt_field_type *elem_field_type); - -extern struct bt_field_type *bt_field_type_array_borrow_element_field_type( - struct bt_field_type *field_type); - -extern uint64_t bt_field_type_static_array_get_length( - struct bt_field_type *field_type); - -extern struct bt_field_path * -bt_field_type_dynamic_array_borrow_length_field_path( - struct bt_field_type *field_type); - -extern int bt_field_type_dynamic_array_set_length_field_type( - struct bt_field_type *field_type, - struct bt_field_type *length_field_type); - -extern struct bt_field_type *bt_field_type_variant_create(void); - -extern struct bt_field_path * -bt_field_type_variant_borrow_selector_field_path( - struct bt_field_type *field_type); - -extern int bt_field_type_variant_set_selector_field_type( - struct bt_field_type *field_type, - struct bt_field_type *selector_field_type); - -extern uint64_t bt_field_type_variant_get_option_count( - struct bt_field_type *field_type); - -extern void bt_field_type_variant_borrow_option_by_index( - struct bt_field_type *variant_field_type, uint64_t index, - const char **name, struct bt_field_type **field_type); - -extern -struct bt_field_type *bt_field_type_variant_borrow_option_field_type_by_name( - struct bt_field_type *field_type, - const char *name); - -extern int bt_field_type_variant_append_option( - struct bt_field_type *var_field_type, - const char *name, struct bt_field_type *field_type); - -#ifdef __cplusplus -} -#endif - -#endif /* BABELTRACE_CTF_IR_FIELD_TYPES_H */ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/fields.h b/include/babeltrace/ctf-ir/fields.h index 5bf0c3b6..dc6543b0 100644 --- a/include/babeltrace/ctf-ir/fields.h +++ b/include/babeltrace/ctf-ir/fields.h @@ -1,117 +1,2 @@ -#ifndef BABELTRACE_CTF_IR_FIELDS_H -#define BABELTRACE_CTF_IR_FIELDS_H - -/* - * Babeltrace - CTF IR: Event Fields - * - * Copyright 2013, 2014 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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 - -/* For bt_bool */ -#include - -/* For enum bt_field_type_id */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct bt_field; -struct bt_field_type; -struct bt_field_type_enumeration_mapping_iterator; - -extern struct bt_field_type *bt_field_borrow_type(struct bt_field *field); - -extern enum bt_field_type_id bt_field_get_type_id(struct bt_field *field); - -extern int64_t bt_field_signed_integer_get_value(struct bt_field *field); - -extern void bt_field_signed_integer_set_value(struct bt_field *field, - int64_t value); - -extern uint64_t bt_field_unsigned_integer_get_value(struct bt_field *field); - -extern void bt_field_unsigned_integer_set_value(struct bt_field *field, - uint64_t value); - -extern double bt_field_real_get_value(struct bt_field *field); - -extern void bt_field_real_set_value(struct bt_field *field, double value); - -extern int bt_field_unsigned_enumeration_get_mapping_labels( - struct bt_field *field, - bt_field_type_enumeration_mapping_label_array *label_array, - uint64_t *count); - -extern int bt_field_signed_enumeration_get_mapping_labels( - struct bt_field *field, - bt_field_type_enumeration_mapping_label_array *label_array, - uint64_t *count); - -extern const char *bt_field_string_get_value(struct bt_field *field); - -extern uint64_t bt_field_string_get_length(struct bt_field *field); - -extern int bt_field_string_set_value(struct bt_field *field, const char *value); - -extern int bt_field_string_append(struct bt_field *field, const char *value); - -extern int bt_field_string_append_with_length(struct bt_field *field, - const char *value, uint64_t length); - -extern int bt_field_string_clear(struct bt_field *field); - -extern struct bt_field *bt_field_structure_borrow_member_field_by_index( - struct bt_field *field, uint64_t index); - -extern struct bt_field *bt_field_structure_borrow_member_field_by_name( - struct bt_field *field, const char *name); - -extern uint64_t bt_field_array_get_length(struct bt_field *field); - -extern struct bt_field *bt_field_array_borrow_element_field_by_index( - struct bt_field *field, uint64_t index); - -extern int bt_field_dynamic_array_set_length(struct bt_field *field, - uint64_t length); - -extern int bt_field_variant_select_option_field(struct bt_field *field, - uint64_t index); - -extern uint64_t bt_field_variant_get_selected_option_field_index( - struct bt_field *field); - -extern struct bt_field *bt_field_variant_borrow_selected_option_field( - struct bt_field *field); - -#ifdef __cplusplus -} -#endif - -#endif /* BABELTRACE_CTF_IR_FIELDS_H */ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/stream-class.h b/include/babeltrace/ctf-ir/stream-class.h index ca0b9ef9..0322d671 100644 --- a/include/babeltrace/ctf-ir/stream-class.h +++ b/include/babeltrace/ctf-ir/stream-class.h @@ -1,147 +1,2 @@ -#ifndef BABELTRACE_CTF_IR_STREAM_CLASS_H -#define BABELTRACE_CTF_IR_STREAM_CLASS_H - -/* - * BabelTrace - CTF IR: Stream Class - * - * Copyright 2014 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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 - -/* For bt_bool */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct bt_trace; -struct bt_stream_class; -struct bt_event_class; -struct bt_clock_class; -struct bt_event_header_field; -struct bt_packet_context_field; - -extern struct bt_stream_class *bt_stream_class_create(struct bt_trace *trace); - -extern struct bt_stream_class *bt_stream_class_create_with_id( - struct bt_trace *trace, uint64_t id); - -extern struct bt_trace *bt_stream_class_borrow_trace( - struct bt_stream_class *stream_class); - -extern const char *bt_stream_class_get_name( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_name(struct bt_stream_class *stream_class, - const char *name); - -extern bt_bool bt_stream_class_assigns_automatic_event_class_id( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_assigns_automatic_event_class_id( - struct bt_stream_class *stream_class, bt_bool value); - -extern bt_bool bt_stream_class_assigns_automatic_stream_id( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_assigns_automatic_stream_id( - struct bt_stream_class *stream_class, bt_bool value); - -extern uint64_t bt_stream_class_get_id(struct bt_stream_class *stream_class); - -extern struct bt_field_type *bt_stream_class_borrow_packet_context_field_type( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_packet_context_field_type( - struct bt_stream_class *stream_class, - struct bt_field_type *field_type); - -extern struct bt_field_type * -bt_stream_class_borrow_event_header_field_type( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_event_header_field_type( - struct bt_stream_class *stream_class, - struct bt_field_type *field_type); - -extern struct bt_field_type * -bt_stream_class_borrow_event_common_context_field_type( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_event_common_context_field_type( - struct bt_stream_class *stream_class, - struct bt_field_type *field_type); - -extern uint64_t bt_stream_class_get_event_class_count( - struct bt_stream_class *stream_class); - -extern struct bt_event_class *bt_stream_class_borrow_event_class_by_index( - struct bt_stream_class *stream_class, uint64_t index); - -extern struct bt_event_class *bt_stream_class_borrow_event_class_by_id( - struct bt_stream_class *stream_class, uint64_t id); - -extern int bt_stream_class_set_default_clock_class( - struct bt_stream_class *stream_class, - struct bt_clock_class *clock_class); - -extern struct bt_clock_class *bt_stream_class_borrow_default_clock_class( - struct bt_stream_class *stream_class); - -extern bt_bool bt_stream_class_default_clock_is_always_known( - struct bt_stream_class *stream_class); - -extern bt_bool bt_stream_class_packets_have_discarded_event_counter_snapshot( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_packets_have_discarded_event_counter_snapshot( - struct bt_stream_class *stream_class, bt_bool value); - -extern bt_bool bt_stream_class_packets_have_packet_counter_snapshot( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_packets_have_packet_counter_snapshot( - struct bt_stream_class *stream_class, bt_bool value); - -extern bt_bool bt_stream_class_packets_have_default_beginning_clock_value( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_packets_have_default_beginning_clock_value( - struct bt_stream_class *stream_class, bt_bool value); - -extern bt_bool bt_stream_class_packets_have_default_end_clock_value( - struct bt_stream_class *stream_class); - -extern int bt_stream_class_set_packets_have_default_end_clock_value( - struct bt_stream_class *stream_class, bt_bool value); - -#ifdef __cplusplus -} -#endif - -#endif /* BABELTRACE_CTF_IR_STREAM_CLASS_H */ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/stream.h b/include/babeltrace/ctf-ir/stream.h index 69829280..eb7d57fe 100644 --- a/include/babeltrace/ctf-ir/stream.h +++ b/include/babeltrace/ctf-ir/stream.h @@ -1,62 +1,2 @@ -#ifndef BABELTRACE_CTF_IR_STREAM_H -#define BABELTRACE_CTF_IR_STREAM_H - -/* - * BabelTrace - CTF IR: Stream - * - * Copyright 2013, 2014 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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 - */ - -/* For enum bt_property_availability */ -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct bt_stream; -struct bt_stream_class; - -extern struct bt_stream *bt_stream_create(struct bt_stream_class *stream_class); - -extern struct bt_stream *bt_stream_create_with_id( - struct bt_stream_class *stream_class, uint64_t id); - -extern struct bt_stream_class *bt_stream_borrow_class(struct bt_stream *stream); - -extern const char *bt_stream_get_name(struct bt_stream *stream); - -extern int bt_stream_set_name(struct bt_stream *stream, const char *name); - -extern uint64_t bt_stream_get_id(struct bt_stream *stream); - -#ifdef __cplusplus -} -#endif - -#endif /* BABELTRACE_CTF_IR_STREAM_H */ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/trace.h b/include/babeltrace/ctf-ir/trace.h index 690c88a3..84b9b7a9 100644 --- a/include/babeltrace/ctf-ir/trace.h +++ b/include/babeltrace/ctf-ir/trace.h @@ -1,127 +1,2 @@ -#ifndef BABELTRACE_CTF_IR_TRACE_H -#define BABELTRACE_CTF_IR_TRACE_H - -/* - * BabelTrace - CTF IR: Trace - * - * Copyright 2014 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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 - */ - -/* For bt_bool, bt_uuid */ -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct bt_trace; -struct bt_stream; -struct bt_stream_class; -struct bt_field_type; -struct bt_value; -struct bt_packet_header_field; - -typedef void (* bt_trace_is_static_listener)( - struct bt_trace *trace, void *data); - -typedef void (* bt_trace_listener_removed)( - struct bt_trace *trace, void *data); - -extern struct bt_trace *bt_trace_create(void); - -extern bt_bool bt_trace_assigns_automatic_stream_class_id( - struct bt_trace *trace); - -extern int bt_trace_set_assigns_automatic_stream_class_id( - struct bt_trace *trace, bt_bool value); - -extern const char *bt_trace_get_name(struct bt_trace *trace); - -extern int bt_trace_set_name(struct bt_trace *trace, const char *name); - -extern bt_uuid bt_trace_get_uuid(struct bt_trace *trace); - -extern int bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid); - -extern uint64_t bt_trace_get_environment_entry_count(struct bt_trace *trace); - -extern void bt_trace_borrow_environment_entry_by_index( - struct bt_trace *trace, uint64_t index, - const char **name, struct bt_value **value); - -extern struct bt_value *bt_trace_borrow_environment_entry_value_by_name( - struct bt_trace *trace, const char *name); - -extern int bt_trace_set_environment_entry_integer( - struct bt_trace *trace, const char *name, - int64_t value); - -extern int bt_trace_set_environment_entry_string( - struct bt_trace *trace, const char *name, - const char *value); - -extern struct bt_field_type *bt_trace_borrow_packet_header_field_type( - struct bt_trace *trace); - -extern int bt_trace_set_packet_header_field_type(struct bt_trace *trace, - struct bt_field_type *packet_header_type); - -extern uint64_t bt_trace_get_stream_class_count(struct bt_trace *trace); - -extern struct bt_stream_class *bt_trace_borrow_stream_class_by_index( - struct bt_trace *trace, uint64_t index); - -extern struct bt_stream_class *bt_trace_borrow_stream_class_by_id( - struct bt_trace *trace, uint64_t id); - -extern uint64_t bt_trace_get_stream_count(struct bt_trace *trace); - -extern struct bt_stream *bt_trace_borrow_stream_by_index( - struct bt_trace *trace, uint64_t index); - -extern struct bt_stream *bt_trace_borrow_stream_by_id( - struct bt_trace *trace, uint64_t id); - -extern bt_bool bt_trace_is_static(struct bt_trace *trace); - -extern int bt_trace_make_static(struct bt_trace *trace); - -extern int bt_trace_add_is_static_listener( - struct bt_trace *trace, - bt_trace_is_static_listener listener, - bt_trace_listener_removed listener_removed, void *data, - uint64_t *listener_id); - -extern int bt_trace_remove_is_static_listener( - struct bt_trace *trace, uint64_t listener_id); - -#ifdef __cplusplus -} -#endif - -#endif /* BABELTRACE_CTF_IR_TRACE_H */ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-ir/utils.h b/include/babeltrace/ctf-ir/utils.h new file mode 100644 index 00000000..ce14a424 --- /dev/null +++ b/include/babeltrace/ctf-ir/utils.h @@ -0,0 +1,2 @@ +/* Pre-2.0 CTF writer backward compatibility */ +#include diff --git a/include/babeltrace/ctf-writer/visitor.h b/include/babeltrace/ctf-writer/visitor.h index b6583a93..0020e7b2 100644 --- a/include/babeltrace/ctf-writer/visitor.h +++ b/include/babeltrace/ctf-writer/visitor.h @@ -40,7 +40,7 @@ extern "C" { @brief CTF IR visitor. @code -#include +#include @endcode A CTF IR visitor is a function that you diff --git a/include/babeltrace/ctf/events.h b/include/babeltrace/ctf/events.h index 2fd1ffeb..68ec9a6e 100644 --- a/include/babeltrace/ctf/events.h +++ b/include/babeltrace/ctf/events.h @@ -1,41 +1,7 @@ -#ifndef BABELTRACE_CTF_EVENTS_H -#define BABELTRACE_CTF_EVENTS_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 - */ - -/* - * This header still exists for backward compatibility reasons because - * CTF writer needed it to be included. - */ - +/* Pre-2.0 CTF writer backward compatibility */ #include #include #include #include #include #include - -#endif /* BABELTRACE_CTF_EVENTS_H */ diff --git a/include/babeltrace/graph/notification-event-internal.h b/include/babeltrace/graph/notification-event-internal.h index 83a02069..2b401f20 100644 --- a/include/babeltrace/graph/notification-event-internal.h +++ b/include/babeltrace/graph/notification-event-internal.h @@ -28,8 +28,8 @@ */ #include -#include -#include +#include +#include #include #include diff --git a/include/babeltrace/graph/notification-inactivity-internal.h b/include/babeltrace/graph/notification-inactivity-internal.h index 42551c6f..9a74e8fd 100644 --- a/include/babeltrace/graph/notification-inactivity-internal.h +++ b/include/babeltrace/graph/notification-inactivity-internal.h @@ -24,7 +24,7 @@ */ #include -#include +#include #include struct bt_notification_inactivity { diff --git a/include/babeltrace/graph/notification-internal.h b/include/babeltrace/graph/notification-internal.h index 206c110b..81f7d660 100644 --- a/include/babeltrace/graph/notification-internal.h +++ b/include/babeltrace/graph/notification-internal.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/babeltrace/graph/notification-packet-internal.h b/include/babeltrace/graph/notification-packet-internal.h index 639925b4..18f6db95 100644 --- a/include/babeltrace/graph/notification-packet-internal.h +++ b/include/babeltrace/graph/notification-packet-internal.h @@ -28,7 +28,7 @@ */ #include -#include +#include #include #include diff --git a/include/babeltrace/graph/notification-stream-internal.h b/include/babeltrace/graph/notification-stream-internal.h index 15dd0847..818fc431 100644 --- a/include/babeltrace/graph/notification-stream-internal.h +++ b/include/babeltrace/graph/notification-stream-internal.h @@ -28,9 +28,9 @@ */ #include -#include +#include #include -#include +#include #include struct bt_notification_stream_begin { diff --git a/include/babeltrace/lib-logging-internal.h b/include/babeltrace/lib-logging-internal.h index e2483b29..6e04f9a2 100644 --- a/include/babeltrace/lib-logging-internal.h +++ b/include/babeltrace/lib-logging-internal.h @@ -79,31 +79,34 @@ int bt_lib_log_level; * The available format specifiers are: * * `F`: - * CTF IR field type. The parameter type is `struct bt_field_type *`. + * Trace IR field type. The parameter type is `struct + * bt_field_type *`. * * `f`: - * CTF IR field. The parameter type is `struct bt_field *`. + * Trace IR field. The parameter type is `struct bt_field *`. * * `P`: * Field path. The parameter type is `struct bt_field_path *`. * * `E`: - * CTF IR event class. The parameter type is `struct bt_event_class *`. + * Trace IR event class. The parameter type is `struct + * bt_event_class *`. * * `e`: - * CTF IR event. The parameter type is `struct bt_event *`. + * Trace IR event. The parameter type is `struct bt_event *`. * * `S`: - * CTF IR stream class. The parameter type is `struct bt_stream_class *`. + * Trace IR stream class. The parameter type is `struct + * bt_stream_class *`. * * `s`: - * CTF IR stream. The parameter type is `struct bt_stream *`. + * Trace IR stream. The parameter type is `struct bt_stream *`. * * `a`: * Packet. The parameter type is `struct bt_packet *`. * * `t`: - * CTF IR trace. The parameter type is `struct bt_trace *`. + * Trace IR trace. The parameter type is `struct bt_trace *`. * * `K`: * Clock class. The parameter type is `struct bt_clock_class *`. @@ -122,7 +125,8 @@ int bt_lib_log_level; * `struct bt_notification_iterator *`. * * `C`: - * Component class. The parameter type is `struct bt_component_class *`. + * Component class. The parameter type is `struct + * bt_component_class *`. * * `c`: * Component. The parameter type is `struct bt_component *`. diff --git a/include/babeltrace/ctf-ir/attributes-internal.h b/include/babeltrace/trace-ir/attributes-internal.h similarity index 92% rename from include/babeltrace/ctf-ir/attributes-internal.h rename to include/babeltrace/trace-ir/attributes-internal.h index d7dda55e..3820abd7 100644 --- a/include/babeltrace/ctf-ir/attributes-internal.h +++ b/include/babeltrace/trace-ir/attributes-internal.h @@ -1,10 +1,10 @@ -#ifndef BABELTRACE_CTF_IR_ATTRIBUTES_H -#define BABELTRACE_CTF_IR_ATTRIBUTES_H +#ifndef BABELTRACE_TRACE_IR_ATTRIBUTES_H +#define BABELTRACE_TRACE_IR_ATTRIBUTES_H /* * attributes.c * - * Babeltrace - CTF IR: Attributes internal + * Babeltrace - Trace IR: Attributes internal * * Copyright (c) 2015 EfficiOS Inc. and Linux Foundation * Copyright (c) 2015 Philippe Proulx @@ -68,4 +68,4 @@ int bt_attributes_freeze(struct bt_value *attr_obj); } #endif -#endif /* BABELTRACE_CTF_IR_ATTRIBUTES_H */ +#endif /* BABELTRACE_TRACE_IR_ATTRIBUTES_H */ diff --git a/include/babeltrace/ctf-ir/clock-class-internal.h b/include/babeltrace/trace-ir/clock-class-internal.h similarity index 92% rename from include/babeltrace/ctf-ir/clock-class-internal.h rename to include/babeltrace/trace-ir/clock-class-internal.h index aab9cb44..86e0e392 100644 --- a/include/babeltrace/ctf-ir/clock-class-internal.h +++ b/include/babeltrace/trace-ir/clock-class-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_CLOCK_CLASS_INTERNAL_H -#define BABELTRACE_CTF_IR_CLOCK_CLASS_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H +#define BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H /* - * BabelTrace - CTF IR: Clock internal + * BabelTrace - Trace IR: Clock internal * * Copyright 2013, 2014 Jérémie Galarneau * @@ -27,7 +27,7 @@ * SOFTWARE. */ -#include +#include #include #include #include @@ -105,4 +105,4 @@ void _bt_clock_class_freeze(struct bt_clock_class *clock_class); BT_HIDDEN bt_bool bt_clock_class_is_valid(struct bt_clock_class *clock_class); -#endif /* BABELTRACE_CTF_IR_CLOCK_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H */ diff --git a/include/babeltrace/ctf-ir/clock-class.h b/include/babeltrace/trace-ir/clock-class.h similarity index 94% rename from include/babeltrace/ctf-ir/clock-class.h rename to include/babeltrace/trace-ir/clock-class.h index 40f53ad3..f06a2b00 100644 --- a/include/babeltrace/ctf-ir/clock-class.h +++ b/include/babeltrace/trace-ir/clock-class.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_CLOCK_CLASS_H -#define BABELTRACE_CTF_IR_CLOCK_CLASS_H +#ifndef BABELTRACE_TRACE_IR_CLOCK_CLASS_H +#define BABELTRACE_TRACE_IR_CLOCK_CLASS_H /* - * BabelTrace - CTF IR: Clock class + * BabelTrace - Trace IR: Clock class * * Copyright 2013, 2014 Jérémie Galarneau * Copyright 2017-2018 Philippe Proulx @@ -92,4 +92,4 @@ extern int bt_clock_class_cycles_to_ns_from_origin( } #endif -#endif /* BABELTRACE_CTF_IR_CLOCK_CLASS_H */ +#endif /* BABELTRACE_TRACE_IR_CLOCK_CLASS_H */ diff --git a/include/babeltrace/ctf-ir/clock-value-internal.h b/include/babeltrace/trace-ir/clock-value-internal.h similarity index 91% rename from include/babeltrace/ctf-ir/clock-value-internal.h rename to include/babeltrace/trace-ir/clock-value-internal.h index 1beb9fac..8cb7802b 100644 --- a/include/babeltrace/ctf-ir/clock-value-internal.h +++ b/include/babeltrace/trace-ir/clock-value-internal.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_CTF_IR_CLOCK_VALUE_INTERNAL_H -#define BABELTRACE_CTF_IR_CLOCK_VALUE_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_CLOCK_VALUE_INTERNAL_H +#define BABELTRACE_TRACE_IR_CLOCK_VALUE_INTERNAL_H /* * Copyright 2017 Philippe Proulx @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -99,4 +99,4 @@ BT_HIDDEN void bt_clock_value_set_raw_value(struct bt_clock_value *clock_value, uint64_t cycles); -#endif /* BABELTRACE_CTF_IR_CLOCK_VALUE_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_CLOCK_VALUE_INTERNAL_H */ diff --git a/include/babeltrace/ctf-ir/clock-value-set-internal.h b/include/babeltrace/trace-ir/clock-value-set-internal.h similarity index 97% rename from include/babeltrace/ctf-ir/clock-value-set-internal.h rename to include/babeltrace/trace-ir/clock-value-set-internal.h index 43205d08..5c7e7bd3 100644 --- a/include/babeltrace/ctf-ir/clock-value-set-internal.h +++ b/include/babeltrace/trace-ir/clock-value-set-internal.h @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include struct bt_clock_value_set { diff --git a/include/babeltrace/ctf-ir/clock-value.h b/include/babeltrace/trace-ir/clock-value.h similarity index 91% rename from include/babeltrace/ctf-ir/clock-value.h rename to include/babeltrace/trace-ir/clock-value.h index 5f302427..0676fa01 100644 --- a/include/babeltrace/ctf-ir/clock-value.h +++ b/include/babeltrace/trace-ir/clock-value.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_CLOCK_VALUE_H -#define BABELTRACE_CTF_IR_CLOCK_VALUE_H +#ifndef BABELTRACE_TRACE_IR_CLOCK_VALUE_H +#define BABELTRACE_TRACE_IR_CLOCK_VALUE_H /* - * BabelTrace - CTF IR: Clock class + * BabelTrace - Trace IR: Clock class * * Copyright 2013, 2014 Jérémie Galarneau * Copyright 2017 Philippe Proulx @@ -58,4 +58,4 @@ extern int bt_clock_value_get_ns_from_origin( } #endif -#endif /* BABELTRACE_CTF_IR_CLOCK_VALUE_H */ +#endif /* BABELTRACE_TRACE_IR_CLOCK_VALUE_H */ diff --git a/include/babeltrace/trace-ir/clock.h b/include/babeltrace/trace-ir/clock.h new file mode 100644 index 00000000..2fcf48f8 --- /dev/null +++ b/include/babeltrace/trace-ir/clock.h @@ -0,0 +1,35 @@ +#ifndef BABELTRACE_TRACE_IR_CLOCK_H +#define BABELTRACE_TRACE_IR_CLOCK_H + +/* + * BabelTrace - Trace IR: Clock + * + * Copyright 2018 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 + +#endif /* BABELTRACE_TRACE_IR_CLOCK_H */ diff --git a/include/babeltrace/ctf-ir/event-class-internal.h b/include/babeltrace/trace-ir/event-class-internal.h similarity index 83% rename from include/babeltrace/ctf-ir/event-class-internal.h rename to include/babeltrace/trace-ir/event-class-internal.h index 8fa2ba08..3f366dda 100644 --- a/include/babeltrace/ctf-ir/event-class-internal.h +++ b/include/babeltrace/trace-ir/event-class-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_EVENT_CLASS_INTERNAL_H -#define BABELTRACE_CTF_IR_EVENT_CLASS_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H +#define BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H /* - * Babeltrace - CTF IR: Event class internal + * Babeltrace - Trace IR: Event class internal * * Copyright 2013, 2014 Jérémie Galarneau * @@ -28,14 +28,14 @@ */ #include -#include -#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -88,4 +88,4 @@ struct bt_stream_class *bt_event_class_borrow_stream_class_inline( return (void *) bt_object_borrow_parent(&event_class->base); } -#endif /* BABELTRACE_CTF_IR_EVENT_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H */ diff --git a/include/babeltrace/trace-ir/event-class.h b/include/babeltrace/trace-ir/event-class.h new file mode 100644 index 00000000..ae052eea --- /dev/null +++ b/include/babeltrace/trace-ir/event-class.h @@ -0,0 +1,112 @@ +#ifndef BABELTRACE_TRACE_IR_EVENT_CLASS_H +#define BABELTRACE_TRACE_IR_EVENT_CLASS_H + +/* + * BabelTrace - Trace IR: Event class + * + * Copyright 2013, 2014 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 + */ + +/* For enum bt_property_availability */ +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct bt_event_class; +struct bt_field_type; +struct bt_stream_class; + +enum bt_event_class_log_level { + BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY, + BT_EVENT_CLASS_LOG_LEVEL_ALERT, + BT_EVENT_CLASS_LOG_LEVEL_CRITICAL, + BT_EVENT_CLASS_LOG_LEVEL_ERROR, + BT_EVENT_CLASS_LOG_LEVEL_WARNING, + BT_EVENT_CLASS_LOG_LEVEL_NOTICE, + BT_EVENT_CLASS_LOG_LEVEL_INFO, + BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM, + BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM, + BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS, + BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE, + BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT, + BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION, + BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE, + BT_EVENT_CLASS_LOG_LEVEL_DEBUG, +}; + +extern struct bt_event_class *bt_event_class_create( + struct bt_stream_class *stream_class); + +extern struct bt_event_class *bt_event_class_create_with_id( + struct bt_stream_class *stream_class, uint64_t id); + +extern struct bt_stream_class *bt_event_class_borrow_stream_class( + struct bt_event_class *event_class); + +extern const char *bt_event_class_get_name(struct bt_event_class *event_class); + +extern int bt_event_class_set_name(struct bt_event_class *event_class, + const char *name); + +extern uint64_t bt_event_class_get_id(struct bt_event_class *event_class); + +extern enum bt_property_availability bt_event_class_get_log_level( + struct bt_event_class *event_class, + enum bt_event_class_log_level *log_level); + +extern int bt_event_class_set_log_level(struct bt_event_class *event_class, + enum bt_event_class_log_level log_level); + +extern const char *bt_event_class_get_emf_uri( + struct bt_event_class *event_class); + +extern int bt_event_class_set_emf_uri(struct bt_event_class *event_class, + const char *emf_uri); + +extern struct bt_field_type *bt_event_class_borrow_specific_context_field_type( + struct bt_event_class *event_class); + +extern int bt_event_class_set_specific_context_field_type( + struct bt_event_class *event_class, + struct bt_field_type *field_type); + +extern struct bt_field_type *bt_event_class_borrow_payload_field_type( + struct bt_event_class *event_class); + +extern int bt_event_class_set_payload_field_type( + struct bt_event_class *event_class, + struct bt_field_type *field_type); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_TRACE_IR_EVENT_CLASS_H */ diff --git a/include/babeltrace/ctf-ir/event-header-field.h b/include/babeltrace/trace-ir/event-header-field.h similarity index 91% rename from include/babeltrace/ctf-ir/event-header-field.h rename to include/babeltrace/trace-ir/event-header-field.h index 0ac9eeaf..fa3719ed 100644 --- a/include/babeltrace/ctf-ir/event-header-field.h +++ b/include/babeltrace/trace-ir/event-header-field.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_CTF_IR_EVENT_HEADER_FIELD_H -#define BABELTRACE_CTF_IR_EVENT_HEADER_FIELD_H +#ifndef BABELTRACE_TRACE_IR_EVENT_HEADER_FIELD_H +#define BABELTRACE_TRACE_IR_EVENT_HEADER_FIELD_H /* * Copyright 2018 Philippe Proulx @@ -49,4 +49,4 @@ void bt_event_header_field_release(struct bt_event_header_field *field); } #endif -#endif /* BABELTRACE_CTF_IR_EVENT_HEADER_FIELD_H */ +#endif /* BABELTRACE_TRACE_IR_EVENT_HEADER_FIELD_H */ diff --git a/include/babeltrace/ctf-ir/event-internal.h b/include/babeltrace/trace-ir/event-internal.h similarity index 90% rename from include/babeltrace/ctf-ir/event-internal.h rename to include/babeltrace/trace-ir/event-internal.h index 39efd2f8..ef5bdf0b 100644 --- a/include/babeltrace/ctf-ir/event-internal.h +++ b/include/babeltrace/trace-ir/event-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_EVENT_INTERNAL_H -#define BABELTRACE_CTF_IR_EVENT_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_EVENT_INTERNAL_H +#define BABELTRACE_TRACE_IR_EVENT_INTERNAL_H /* - * Babeltrace - CTF IR: Event internal + * Babeltrace - Trace IR: Event internal * * Copyright 2013, 2014 Jérémie Galarneau * @@ -35,16 +35,16 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -216,4 +216,4 @@ end: return event; } -#endif /* BABELTRACE_CTF_IR_EVENT_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_EVENT_INTERNAL_H */ diff --git a/include/babeltrace/trace-ir/event.h b/include/babeltrace/trace-ir/event.h new file mode 100644 index 00000000..574af841 --- /dev/null +++ b/include/babeltrace/trace-ir/event.h @@ -0,0 +1,79 @@ +#ifndef BABELTRACE_TRACE_IR_EVENT_H +#define BABELTRACE_TRACE_IR_EVENT_H + +/* + * BabelTrace - Trace IR: Event + * + * Copyright 2013, 2014 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 +#include + +/* For enum bt_clock_value_status */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct bt_event; +struct bt_event_header_field; +struct bt_clock_value; +struct bt_event_class; +struct bt_field; +struct bt_packet; + +extern struct bt_event_class *bt_event_borrow_class(struct bt_event *event); + +extern struct bt_packet *bt_event_borrow_packet(struct bt_event *event); + +extern struct bt_stream *bt_event_borrow_stream(struct bt_event *event); + +extern struct bt_field *bt_event_borrow_header_field(struct bt_event *event); + +extern int bt_event_move_header(struct bt_event *event, + struct bt_event_header_field *header); + +extern struct bt_field *bt_event_borrow_common_context_field( + struct bt_event *event); + +extern struct bt_field *bt_event_borrow_specific_context_field( + struct bt_event *event); + +extern struct bt_field *bt_event_borrow_payload_field(struct bt_event *event); + +extern int bt_event_set_default_clock_value(struct bt_event *event, + uint64_t value_cycles); + +extern enum bt_clock_value_status bt_event_borrow_default_clock_value( + struct bt_event *event, struct bt_clock_value **clock_value); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_TRACE_IR_EVENT_H */ diff --git a/include/babeltrace/ctf-ir/field-path-internal.h b/include/babeltrace/trace-ir/field-path-internal.h similarity index 88% rename from include/babeltrace/ctf-ir/field-path-internal.h rename to include/babeltrace/trace-ir/field-path-internal.h index f8cb1367..fd6ebc3c 100644 --- a/include/babeltrace/ctf-ir/field-path-internal.h +++ b/include/babeltrace/trace-ir/field-path-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_FIELD_PATH_INTERNAL -#define BABELTRACE_CTF_IR_FIELD_PATH_INTERNAL +#ifndef BABELTRACE_TRACE_IR_FIELD_PATH_INTERNAL +#define BABELTRACE_TRACE_IR_FIELD_PATH_INTERNAL /* - * BabelTrace - CTF IR: Field path + * BabelTrace - Trace IR: Field path * * Copyright 2016 Philippe Proulx * @@ -29,7 +29,7 @@ */ #include -#include +#include #include #include @@ -53,4 +53,4 @@ uint64_t bt_field_path_get_index_by_index_inline( return g_array_index(field_path->indexes, uint64_t, index); } -#endif /* BABELTRACE_CTF_IR_FIELD_PATH_INTERNAL */ +#endif /* BABELTRACE_TRACE_IR_FIELD_PATH_INTERNAL */ diff --git a/include/babeltrace/ctf-ir/field-path.h b/include/babeltrace/trace-ir/field-path.h similarity index 91% rename from include/babeltrace/ctf-ir/field-path.h rename to include/babeltrace/trace-ir/field-path.h index 7c435abc..2556a6fb 100644 --- a/include/babeltrace/ctf-ir/field-path.h +++ b/include/babeltrace/trace-ir/field-path.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_FIELD_PATH_H -#define BABELTRACE_CTF_IR_FIELD_PATH_H +#ifndef BABELTRACE_TRACE_IR_FIELD_PATH_H +#define BABELTRACE_TRACE_IR_FIELD_PATH_H /* - * BabelTrace - CTF IR: Field path + * BabelTrace - Trace IR: Field path * * Copyright 2016-2018 Philippe Proulx * @@ -58,4 +58,4 @@ extern uint64_t bt_field_path_get_index_by_index( } #endif -#endif /* BABELTRACE_CTF_IR_FIELD_PATH_H */ +#endif /* BABELTRACE_TRACE_IR_FIELD_PATH_H */ diff --git a/include/babeltrace/ctf-ir/field-types-internal.h b/include/babeltrace/trace-ir/field-types-internal.h similarity index 96% rename from include/babeltrace/ctf-ir/field-types-internal.h rename to include/babeltrace/trace-ir/field-types-internal.h index fcefa063..82ec15ce 100644 --- a/include/babeltrace/ctf-ir/field-types-internal.h +++ b/include/babeltrace/trace-ir/field-types-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_FIELD_TYPES_INTERNAL_H -#define BABELTRACE_CTF_IR_FIELD_TYPES_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_FIELD_TYPES_INTERNAL_H +#define BABELTRACE_TRACE_IR_FIELD_TYPES_INTERNAL_H /* - * BabelTrace - CTF IR: Event field types internal + * BabelTrace - Trace IR: Event field types internal * * Copyright 2013, 2014 Jérémie Galarneau * @@ -28,8 +28,8 @@ */ #include -#include -#include +#include +#include #include #include #include @@ -252,4 +252,4 @@ void _bt_field_type_make_part_of_trace(struct bt_field_type *field_type); # define bt_field_type_make_part_of_trace(_ft) ((void) _ft) #endif -#endif /* BABELTRACE_CTF_IR_FIELD_TYPES_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_FIELD_TYPES_INTERNAL_H */ diff --git a/include/babeltrace/trace-ir/field-types.h b/include/babeltrace/trace-ir/field-types.h new file mode 100644 index 00000000..58ce8a63 --- /dev/null +++ b/include/babeltrace/trace-ir/field-types.h @@ -0,0 +1,222 @@ +#ifndef BABELTRACE_TRACE_IR_FIELD_TYPES_H +#define BABELTRACE_TRACE_IR_FIELD_TYPES_H + +/* + * BabelTrace - Trace IR: Event field types + * + * Copyright 2013, 2014 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 + */ + +/* For bt_get() */ +#include + +/* For bt_bool */ +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct bt_field_type; +struct bt_field_path; +struct bt_field_type_signed_enumeration_mapping_ranges; +struct bt_field_type_unsigned_enumeration_mapping_ranges; + +typedef const char * const *bt_field_type_enumeration_mapping_label_array; + +enum bt_field_type_id { + BT_FIELD_TYPE_ID_UNSIGNED_INTEGER, + BT_FIELD_TYPE_ID_SIGNED_INTEGER, + BT_FIELD_TYPE_ID_UNSIGNED_ENUMERATION, + BT_FIELD_TYPE_ID_SIGNED_ENUMERATION, + BT_FIELD_TYPE_ID_REAL, + BT_FIELD_TYPE_ID_STRING, + BT_FIELD_TYPE_ID_STRUCTURE, + BT_FIELD_TYPE_ID_STATIC_ARRAY, + BT_FIELD_TYPE_ID_DYNAMIC_ARRAY, + BT_FIELD_TYPE_ID_VARIANT, +}; + +enum bt_field_type_integer_preferred_display_base { + BT_FIELD_TYPE_INTEGER_PREFERRED_DISPLAY_BASE_BINARY, + BT_FIELD_TYPE_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL, + BT_FIELD_TYPE_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, + BT_FIELD_TYPE_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL, +}; + +extern enum bt_field_type_id bt_field_type_get_type_id( + struct bt_field_type *field_type); + +extern struct bt_field_type *bt_field_type_unsigned_integer_create(void); + +extern struct bt_field_type *bt_field_type_signed_integer_create(void); + +extern uint64_t bt_field_type_integer_get_field_value_range( + struct bt_field_type *field_type); + +extern int bt_field_type_integer_set_field_value_range( + struct bt_field_type *field_type, uint64_t size); + +extern enum bt_field_type_integer_preferred_display_base +bt_field_type_integer_get_preferred_display_base( + struct bt_field_type *field_type); + +extern int bt_field_type_integer_set_preferred_display_base( + struct bt_field_type *field_type, + enum bt_field_type_integer_preferred_display_base base); + +extern struct bt_field_type *bt_field_type_real_create(void); + +extern bt_bool bt_field_type_real_is_single_precision( + struct bt_field_type *field_type); + +extern int bt_field_type_real_set_is_single_precision( + struct bt_field_type *field_type, + bt_bool is_single_precision); + +extern struct bt_field_type *bt_field_type_unsigned_enumeration_create(void); + +extern struct bt_field_type *bt_field_type_signed_enumeration_create(void); + +extern uint64_t bt_field_type_enumeration_get_mapping_count( + struct bt_field_type *field_type); + +extern void bt_field_type_unsigned_enumeration_borrow_mapping_by_index( + struct bt_field_type *field_type, uint64_t index, + const char **label, + struct bt_field_type_unsigned_enumeration_mapping_ranges **ranges); + +extern void bt_field_type_signed_enumeration_borrow_mapping_by_index( + struct bt_field_type *field_type, uint64_t index, + const char **label, + struct bt_field_type_signed_enumeration_mapping_ranges **ranges); + +extern uint64_t bt_field_type_unsigned_enumeration_mapping_ranges_get_range_count( + struct bt_field_type_unsigned_enumeration_mapping_ranges *ranges); + +extern uint64_t bt_field_type_signed_enumeration_mapping_ranges_get_range_count( + struct bt_field_type_signed_enumeration_mapping_ranges *ranges); + +extern void bt_field_type_unsigned_enumeration_mapping_ranges_get_range_by_index( + struct bt_field_type_unsigned_enumeration_mapping_ranges *ranges, + uint64_t index, uint64_t *lower, uint64_t *upper); + +extern void bt_field_type_signed_enumeration_mapping_ranges_get_range_by_index( + struct bt_field_type_unsigned_enumeration_mapping_ranges *ranges, + uint64_t index, int64_t *lower, int64_t *upper); + +extern int bt_field_type_unsigned_enumeration_get_mapping_labels_by_value( + struct bt_field_type *field_type, uint64_t value, + bt_field_type_enumeration_mapping_label_array *label_array, + uint64_t *count); + +extern int bt_field_type_signed_enumeration_get_mapping_labels_by_value( + struct bt_field_type *field_type, int64_t value, + bt_field_type_enumeration_mapping_label_array *label_array, + uint64_t *count); + +extern int bt_field_type_unsigned_enumeration_map_range( + struct bt_field_type *field_type, const char *label, + uint64_t range_lower, uint64_t range_upper); + +extern int bt_field_type_signed_enumeration_map_range( + struct bt_field_type *field_type, const char *label, + int64_t range_lower, int64_t range_upper); + +extern struct bt_field_type *bt_field_type_string_create(void); + +extern struct bt_field_type *bt_field_type_structure_create(void); + +extern uint64_t bt_field_type_structure_get_member_count( + struct bt_field_type *field_type); + +extern void bt_field_type_structure_borrow_member_by_index( + struct bt_field_type *struct_field_type, uint64_t index, + const char **name, struct bt_field_type **field_type); + +extern +struct bt_field_type *bt_field_type_structure_borrow_member_field_type_by_name( + struct bt_field_type *field_type, const char *name); + +extern int bt_field_type_structure_append_member( + struct bt_field_type *struct_field_type, const char *name, + struct bt_field_type *field_type); + +extern struct bt_field_type *bt_field_type_static_array_create( + struct bt_field_type *elem_field_type, + uint64_t length); + +extern struct bt_field_type *bt_field_type_dynamic_array_create( + struct bt_field_type *elem_field_type); + +extern struct bt_field_type *bt_field_type_array_borrow_element_field_type( + struct bt_field_type *field_type); + +extern uint64_t bt_field_type_static_array_get_length( + struct bt_field_type *field_type); + +extern struct bt_field_path * +bt_field_type_dynamic_array_borrow_length_field_path( + struct bt_field_type *field_type); + +extern int bt_field_type_dynamic_array_set_length_field_type( + struct bt_field_type *field_type, + struct bt_field_type *length_field_type); + +extern struct bt_field_type *bt_field_type_variant_create(void); + +extern struct bt_field_path * +bt_field_type_variant_borrow_selector_field_path( + struct bt_field_type *field_type); + +extern int bt_field_type_variant_set_selector_field_type( + struct bt_field_type *field_type, + struct bt_field_type *selector_field_type); + +extern uint64_t bt_field_type_variant_get_option_count( + struct bt_field_type *field_type); + +extern void bt_field_type_variant_borrow_option_by_index( + struct bt_field_type *variant_field_type, uint64_t index, + const char **name, struct bt_field_type **field_type); + +extern +struct bt_field_type *bt_field_type_variant_borrow_option_field_type_by_name( + struct bt_field_type *field_type, + const char *name); + +extern int bt_field_type_variant_append_option( + struct bt_field_type *var_field_type, + const char *name, struct bt_field_type *field_type); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_TRACE_IR_FIELD_TYPES_H */ diff --git a/include/babeltrace/ctf-ir/field-wrapper-internal.h b/include/babeltrace/trace-ir/field-wrapper-internal.h similarity index 88% rename from include/babeltrace/ctf-ir/field-wrapper-internal.h rename to include/babeltrace/trace-ir/field-wrapper-internal.h index cc164e0c..e2b69134 100644 --- a/include/babeltrace/ctf-ir/field-wrapper-internal.h +++ b/include/babeltrace/trace-ir/field-wrapper-internal.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_CTF_IR_FIELD_WRAPPER_INTERNAL_H -#define BABELTRACE_CTF_IR_FIELD_WRAPPER_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_FIELD_WRAPPER_INTERNAL_H +#define BABELTRACE_TRACE_IR_FIELD_WRAPPER_INTERNAL_H /* * Copyright 2018 Philippe Proulx @@ -23,7 +23,7 @@ * SOFTWARE. */ -#include +#include #include #include @@ -44,4 +44,4 @@ BT_HIDDEN struct bt_field_wrapper *bt_field_wrapper_create( struct bt_object_pool *pool, struct bt_field_type *ft); -#endif /* BABELTRACE_CTF_IR_FIELD_WRAPPER_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_FIELD_WRAPPER_INTERNAL_H */ diff --git a/include/babeltrace/ctf-ir/fields-internal.h b/include/babeltrace/trace-ir/fields-internal.h similarity index 95% rename from include/babeltrace/ctf-ir/fields-internal.h rename to include/babeltrace/trace-ir/fields-internal.h index 31ec6213..c8a1dcf9 100644 --- a/include/babeltrace/ctf-ir/fields-internal.h +++ b/include/babeltrace/trace-ir/fields-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_FIELDS_INTERNAL_H -#define BABELTRACE_CTF_IR_FIELDS_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H +#define BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H /* - * Babeltrace - CTF IR: Event Fields internal + * Babeltrace - Trace IR: Event Fields internal * * Copyright 2013, 2014 Jérémie Galarneau * @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -203,4 +203,4 @@ struct bt_field *bt_field_create(struct bt_field_type *type); BT_HIDDEN void bt_field_destroy(struct bt_field *field); -#endif /* BABELTRACE_CTF_IR_FIELDS_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H */ diff --git a/include/babeltrace/trace-ir/fields.h b/include/babeltrace/trace-ir/fields.h new file mode 100644 index 00000000..99a6aa5a --- /dev/null +++ b/include/babeltrace/trace-ir/fields.h @@ -0,0 +1,117 @@ +#ifndef BABELTRACE_TRACE_IR_FIELDS_H +#define BABELTRACE_TRACE_IR_FIELDS_H + +/* + * Babeltrace - Trace IR: Event Fields + * + * Copyright 2013, 2014 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 + +/* For bt_bool */ +#include + +/* For enum bt_field_type_id */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct bt_field; +struct bt_field_type; +struct bt_field_type_enumeration_mapping_iterator; + +extern struct bt_field_type *bt_field_borrow_type(struct bt_field *field); + +extern enum bt_field_type_id bt_field_get_type_id(struct bt_field *field); + +extern int64_t bt_field_signed_integer_get_value(struct bt_field *field); + +extern void bt_field_signed_integer_set_value(struct bt_field *field, + int64_t value); + +extern uint64_t bt_field_unsigned_integer_get_value(struct bt_field *field); + +extern void bt_field_unsigned_integer_set_value(struct bt_field *field, + uint64_t value); + +extern double bt_field_real_get_value(struct bt_field *field); + +extern void bt_field_real_set_value(struct bt_field *field, double value); + +extern int bt_field_unsigned_enumeration_get_mapping_labels( + struct bt_field *field, + bt_field_type_enumeration_mapping_label_array *label_array, + uint64_t *count); + +extern int bt_field_signed_enumeration_get_mapping_labels( + struct bt_field *field, + bt_field_type_enumeration_mapping_label_array *label_array, + uint64_t *count); + +extern const char *bt_field_string_get_value(struct bt_field *field); + +extern uint64_t bt_field_string_get_length(struct bt_field *field); + +extern int bt_field_string_set_value(struct bt_field *field, const char *value); + +extern int bt_field_string_append(struct bt_field *field, const char *value); + +extern int bt_field_string_append_with_length(struct bt_field *field, + const char *value, uint64_t length); + +extern int bt_field_string_clear(struct bt_field *field); + +extern struct bt_field *bt_field_structure_borrow_member_field_by_index( + struct bt_field *field, uint64_t index); + +extern struct bt_field *bt_field_structure_borrow_member_field_by_name( + struct bt_field *field, const char *name); + +extern uint64_t bt_field_array_get_length(struct bt_field *field); + +extern struct bt_field *bt_field_array_borrow_element_field_by_index( + struct bt_field *field, uint64_t index); + +extern int bt_field_dynamic_array_set_length(struct bt_field *field, + uint64_t length); + +extern int bt_field_variant_select_option_field(struct bt_field *field, + uint64_t index); + +extern uint64_t bt_field_variant_get_selected_option_field_index( + struct bt_field *field); + +extern struct bt_field *bt_field_variant_borrow_selected_option_field( + struct bt_field *field); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_TRACE_IR_FIELDS_H */ diff --git a/include/babeltrace/ctf-ir/packet-context-field.h b/include/babeltrace/trace-ir/packet-context-field.h similarity index 91% rename from include/babeltrace/ctf-ir/packet-context-field.h rename to include/babeltrace/trace-ir/packet-context-field.h index 19625422..b21f82b9 100644 --- a/include/babeltrace/ctf-ir/packet-context-field.h +++ b/include/babeltrace/trace-ir/packet-context-field.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_CTF_IR_PACKET_CONTEXT_FIELD_H -#define BABELTRACE_CTF_IR_PACKET_CONTEXT_FIELD_H +#ifndef BABELTRACE_TRACE_IR_PACKET_CONTEXT_FIELD_H +#define BABELTRACE_TRACE_IR_PACKET_CONTEXT_FIELD_H /* * Copyright 2018 Philippe Proulx @@ -49,4 +49,4 @@ void bt_packet_context_field_release(struct bt_packet_context_field *field); } #endif -#endif /* BABELTRACE_CTF_IR_PACKET_CONTEXT_FIELD_H */ +#endif /* BABELTRACE_TRACE_IR_PACKET_CONTEXT_FIELD_H */ diff --git a/include/babeltrace/ctf-ir/packet-header-field.h b/include/babeltrace/trace-ir/packet-header-field.h similarity index 91% rename from include/babeltrace/ctf-ir/packet-header-field.h rename to include/babeltrace/trace-ir/packet-header-field.h index 1e14a8cd..605b1b8f 100644 --- a/include/babeltrace/ctf-ir/packet-header-field.h +++ b/include/babeltrace/trace-ir/packet-header-field.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_CTF_IR_PACKET_HEADER_FIELD_H -#define BABELTRACE_CTF_IR_PACKET_HEADER_FIELD_H +#ifndef BABELTRACE_TRACE_IR_PACKET_HEADER_FIELD_H +#define BABELTRACE_TRACE_IR_PACKET_HEADER_FIELD_H /* * Copyright 2018 Philippe Proulx @@ -49,4 +49,4 @@ void bt_packet_header_field_release(struct bt_packet_header_field *field); } #endif -#endif /* BABELTRACE_CTF_IR_PACKET_HEADER_FIELD_H */ +#endif /* BABELTRACE_TRACE_IR_PACKET_HEADER_FIELD_H */ diff --git a/include/babeltrace/ctf-ir/packet-internal.h b/include/babeltrace/trace-ir/packet-internal.h similarity index 83% rename from include/babeltrace/ctf-ir/packet-internal.h rename to include/babeltrace/trace-ir/packet-internal.h index 712903a5..ec709a35 100644 --- a/include/babeltrace/ctf-ir/packet-internal.h +++ b/include/babeltrace/trace-ir/packet-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_PACKET_INTERNAL_H -#define BABELTRACE_CTF_IR_PACKET_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_PACKET_INTERNAL_H +#define BABELTRACE_TRACE_IR_PACKET_INTERNAL_H /* - * Babeltrace - CTF IR: Stream packet internal + * Babeltrace - Trace IR: Stream packet internal * * Copyright 2016 Philippe Proulx * @@ -27,11 +27,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -66,4 +66,4 @@ void bt_packet_recycle(struct bt_packet *packet); BT_HIDDEN void bt_packet_destroy(struct bt_packet *packet); -#endif /* BABELTRACE_CTF_IR_PACKET_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_PACKET_INTERNAL_H */ diff --git a/include/babeltrace/ctf-ir/packet.h b/include/babeltrace/trace-ir/packet.h similarity index 93% rename from include/babeltrace/ctf-ir/packet.h rename to include/babeltrace/trace-ir/packet.h index 7ff057f5..15730161 100644 --- a/include/babeltrace/ctf-ir/packet.h +++ b/include/babeltrace/trace-ir/packet.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_PACKET_H -#define BABELTRACE_CTF_IR_PACKET_H +#ifndef BABELTRACE_TRACE_IR_PACKET_H +#define BABELTRACE_TRACE_IR_PACKET_H /* - * BabelTrace - CTF IR: Stream packet + * BabelTrace - Trace IR: Stream packet * * Copyright 2016 Philippe Proulx * @@ -34,7 +34,7 @@ #include /* For enum bt_clock_value_status */ -#include +#include #ifdef __cplusplus extern "C" { @@ -100,4 +100,4 @@ int bt_packet_set_packet_counter_snapshot(struct bt_packet *packet, } #endif -#endif /* BABELTRACE_CTF_IR_PACKET_H */ +#endif /* BABELTRACE_TRACE_IR_PACKET_H */ diff --git a/include/babeltrace/ctf-ir/resolve-field-path-internal.h b/include/babeltrace/trace-ir/resolve-field-path-internal.h similarity index 85% rename from include/babeltrace/ctf-ir/resolve-field-path-internal.h rename to include/babeltrace/trace-ir/resolve-field-path-internal.h index f2d03214..dafe50d0 100644 --- a/include/babeltrace/ctf-ir/resolve-field-path-internal.h +++ b/include/babeltrace/trace-ir/resolve-field-path-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_RESOLVE_FIELD_PATH_INTERNAL -#define BABELTRACE_CTF_IR_RESOLVE_FIELD_PATH_INTERNAL +#ifndef BABELTRACE_TRACE_IR_RESOLVE_FIELD_PATH_INTERNAL +#define BABELTRACE_TRACE_IR_RESOLVE_FIELD_PATH_INTERNAL /* - * BabelTrace - CTF IR: Field path + * BabelTrace - Trace IR: Field path * * Copyright 2016 Philippe Proulx * @@ -29,8 +29,8 @@ */ #include -#include -#include +#include +#include #include struct bt_resolve_field_path_context { @@ -46,4 +46,4 @@ BT_HIDDEN int bt_resolve_field_paths(struct bt_field_type *ft, struct bt_resolve_field_path_context *ctx); -#endif /* BABELTRACE_CTF_IR_RESOLVE_FIELD_PATH_INTERNAL */ +#endif /* BABELTRACE_TRACE_IR_RESOLVE_FIELD_PATH_INTERNAL */ diff --git a/include/babeltrace/ctf-ir/resolve-internal.h b/include/babeltrace/trace-ir/resolve-internal.h similarity index 87% rename from include/babeltrace/ctf-ir/resolve-internal.h rename to include/babeltrace/trace-ir/resolve-internal.h index dad97907..85c0c87b 100644 --- a/include/babeltrace/ctf-ir/resolve-internal.h +++ b/include/babeltrace/trace-ir/resolve-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_RESOLVE_INTERNAL_H -#define BABELTRACE_CTF_IR_RESOLVE_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_RESOLVE_INTERNAL_H +#define BABELTRACE_TRACE_IR_RESOLVE_INTERNAL_H /* - * Babeltrace - CTF IR: Type resolving internal + * Babeltrace - Trace IR: Type resolving internal * * Copyright 2015 Jérémie Galarneau * Copyright 2016 Philippe Proulx @@ -29,8 +29,8 @@ * SOFTWARE. */ -#include -#include +#include +#include #include #include #include @@ -45,7 +45,7 @@ enum bt_resolve_flag { }; /* - * Resolves CTF IR field types: recursively locates the tag and length + * Resolves Trace IR field types: recursively locates the tag and length * field types of resp. variant and sequence field types. * * All `*_type` parameters may be resolved, and may as well serve as @@ -69,4 +69,4 @@ int bt_resolve_types(struct bt_value *environment, struct bt_field_type *event_payload_type, enum bt_resolve_flag flags); -#endif /* BABELTRACE_CTF_IR_RESOLVE_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_RESOLVE_INTERNAL_H */ diff --git a/include/babeltrace/ctf-ir/stream-class-internal.h b/include/babeltrace/trace-ir/stream-class-internal.h similarity index 88% rename from include/babeltrace/ctf-ir/stream-class-internal.h rename to include/babeltrace/trace-ir/stream-class-internal.h index 844a0c71..f3f8a626 100644 --- a/include/babeltrace/ctf-ir/stream-class-internal.h +++ b/include/babeltrace/trace-ir/stream-class-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_STREAM_CLASS_INTERNAL_H -#define BABELTRACE_CTF_IR_STREAM_CLASS_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H +#define BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H /* - * BabelTrace - CTF IR: Stream class internal + * BabelTrace - Trace IR: Stream class internal * * Copyright 2013, 2014 Jérémie Galarneau * @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -89,4 +89,4 @@ struct bt_trace *bt_stream_class_borrow_trace_inline( return (void *) bt_object_borrow_parent(&stream_class->base); } -#endif /* BABELTRACE_CTF_IR_STREAM_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H */ diff --git a/include/babeltrace/trace-ir/stream-class.h b/include/babeltrace/trace-ir/stream-class.h new file mode 100644 index 00000000..f071244e --- /dev/null +++ b/include/babeltrace/trace-ir/stream-class.h @@ -0,0 +1,147 @@ +#ifndef BABELTRACE_TRACE_IR_STREAM_CLASS_H +#define BABELTRACE_TRACE_IR_STREAM_CLASS_H + +/* + * BabelTrace - Trace IR: Stream Class + * + * Copyright 2014 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 + +/* For bt_bool */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct bt_trace; +struct bt_stream_class; +struct bt_event_class; +struct bt_clock_class; +struct bt_event_header_field; +struct bt_packet_context_field; + +extern struct bt_stream_class *bt_stream_class_create(struct bt_trace *trace); + +extern struct bt_stream_class *bt_stream_class_create_with_id( + struct bt_trace *trace, uint64_t id); + +extern struct bt_trace *bt_stream_class_borrow_trace( + struct bt_stream_class *stream_class); + +extern const char *bt_stream_class_get_name( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_name(struct bt_stream_class *stream_class, + const char *name); + +extern bt_bool bt_stream_class_assigns_automatic_event_class_id( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_assigns_automatic_event_class_id( + struct bt_stream_class *stream_class, bt_bool value); + +extern bt_bool bt_stream_class_assigns_automatic_stream_id( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_assigns_automatic_stream_id( + struct bt_stream_class *stream_class, bt_bool value); + +extern uint64_t bt_stream_class_get_id(struct bt_stream_class *stream_class); + +extern struct bt_field_type *bt_stream_class_borrow_packet_context_field_type( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_packet_context_field_type( + struct bt_stream_class *stream_class, + struct bt_field_type *field_type); + +extern struct bt_field_type * +bt_stream_class_borrow_event_header_field_type( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_event_header_field_type( + struct bt_stream_class *stream_class, + struct bt_field_type *field_type); + +extern struct bt_field_type * +bt_stream_class_borrow_event_common_context_field_type( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_event_common_context_field_type( + struct bt_stream_class *stream_class, + struct bt_field_type *field_type); + +extern uint64_t bt_stream_class_get_event_class_count( + struct bt_stream_class *stream_class); + +extern struct bt_event_class *bt_stream_class_borrow_event_class_by_index( + struct bt_stream_class *stream_class, uint64_t index); + +extern struct bt_event_class *bt_stream_class_borrow_event_class_by_id( + struct bt_stream_class *stream_class, uint64_t id); + +extern int bt_stream_class_set_default_clock_class( + struct bt_stream_class *stream_class, + struct bt_clock_class *clock_class); + +extern struct bt_clock_class *bt_stream_class_borrow_default_clock_class( + struct bt_stream_class *stream_class); + +extern bt_bool bt_stream_class_default_clock_is_always_known( + struct bt_stream_class *stream_class); + +extern bt_bool bt_stream_class_packets_have_discarded_event_counter_snapshot( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_packets_have_discarded_event_counter_snapshot( + struct bt_stream_class *stream_class, bt_bool value); + +extern bt_bool bt_stream_class_packets_have_packet_counter_snapshot( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_packets_have_packet_counter_snapshot( + struct bt_stream_class *stream_class, bt_bool value); + +extern bt_bool bt_stream_class_packets_have_default_beginning_clock_value( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_packets_have_default_beginning_clock_value( + struct bt_stream_class *stream_class, bt_bool value); + +extern bt_bool bt_stream_class_packets_have_default_end_clock_value( + struct bt_stream_class *stream_class); + +extern int bt_stream_class_set_packets_have_default_end_clock_value( + struct bt_stream_class *stream_class, bt_bool value); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_TRACE_IR_STREAM_CLASS_H */ diff --git a/include/babeltrace/ctf-ir/stream-internal.h b/include/babeltrace/trace-ir/stream-internal.h similarity index 89% rename from include/babeltrace/ctf-ir/stream-internal.h rename to include/babeltrace/trace-ir/stream-internal.h index 0cbd18b5..cdb87aca 100644 --- a/include/babeltrace/ctf-ir/stream-internal.h +++ b/include/babeltrace/trace-ir/stream-internal.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_CTF_IR_STREAM_INTERNAL_H -#define BABELTRACE_CTF_IR_STREAM_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_STREAM_INTERNAL_H +#define BABELTRACE_TRACE_IR_STREAM_INTERNAL_H /* * BabelTrace - CTF Writer: Stream internal @@ -27,8 +27,8 @@ * SOFTWARE. */ -#include -#include +#include +#include #include #include #include @@ -67,4 +67,4 @@ void _bt_stream_freeze(struct bt_stream *stream); # define bt_stream_freeze(_stream) #endif -#endif /* BABELTRACE_CTF_IR_STREAM_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_STREAM_INTERNAL_H */ diff --git a/include/babeltrace/trace-ir/stream.h b/include/babeltrace/trace-ir/stream.h new file mode 100644 index 00000000..839c0a31 --- /dev/null +++ b/include/babeltrace/trace-ir/stream.h @@ -0,0 +1,62 @@ +#ifndef BABELTRACE_TRACE_IR_STREAM_H +#define BABELTRACE_TRACE_IR_STREAM_H + +/* + * BabelTrace - Trace IR: Stream + * + * Copyright 2013, 2014 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 + */ + +/* For enum bt_property_availability */ +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct bt_stream; +struct bt_stream_class; + +extern struct bt_stream *bt_stream_create(struct bt_stream_class *stream_class); + +extern struct bt_stream *bt_stream_create_with_id( + struct bt_stream_class *stream_class, uint64_t id); + +extern struct bt_stream_class *bt_stream_borrow_class(struct bt_stream *stream); + +extern const char *bt_stream_get_name(struct bt_stream *stream); + +extern int bt_stream_set_name(struct bt_stream *stream, const char *name); + +extern uint64_t bt_stream_get_id(struct bt_stream *stream); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_TRACE_IR_STREAM_H */ diff --git a/include/babeltrace/ctf-ir/trace-internal.h b/include/babeltrace/trace-ir/trace-internal.h similarity index 85% rename from include/babeltrace/ctf-ir/trace-internal.h rename to include/babeltrace/trace-ir/trace-internal.h index 30b0ba4f..f829d59a 100644 --- a/include/babeltrace/ctf-ir/trace-internal.h +++ b/include/babeltrace/trace-ir/trace-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_TRACE_INTERNAL_H -#define BABELTRACE_CTF_IR_TRACE_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_TRACE_INTERNAL_H +#define BABELTRACE_TRACE_IR_TRACE_INTERNAL_H /* - * BabelTrace - CTF IR: Trace internal + * BabelTrace - Trace IR: Trace internal * * Copyright 2014 Jérémie Galarneau * @@ -28,12 +28,12 @@ */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -103,4 +103,4 @@ BT_HIDDEN uint64_t bt_trace_get_automatic_stream_id(struct bt_trace *trace, struct bt_stream_class *stream_class); -#endif /* BABELTRACE_CTF_IR_TRACE_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_TRACE_INTERNAL_H */ diff --git a/include/babeltrace/trace-ir/trace.h b/include/babeltrace/trace-ir/trace.h new file mode 100644 index 00000000..cb340638 --- /dev/null +++ b/include/babeltrace/trace-ir/trace.h @@ -0,0 +1,127 @@ +#ifndef BABELTRACE_TRACE_IR_TRACE_H +#define BABELTRACE_TRACE_IR_TRACE_H + +/* + * BabelTrace - Trace IR: Trace + * + * Copyright 2014 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * 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 + */ + +/* For bt_bool, bt_uuid */ +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct bt_trace; +struct bt_stream; +struct bt_stream_class; +struct bt_field_type; +struct bt_value; +struct bt_packet_header_field; + +typedef void (* bt_trace_is_static_listener)( + struct bt_trace *trace, void *data); + +typedef void (* bt_trace_listener_removed)( + struct bt_trace *trace, void *data); + +extern struct bt_trace *bt_trace_create(void); + +extern bt_bool bt_trace_assigns_automatic_stream_class_id( + struct bt_trace *trace); + +extern int bt_trace_set_assigns_automatic_stream_class_id( + struct bt_trace *trace, bt_bool value); + +extern const char *bt_trace_get_name(struct bt_trace *trace); + +extern int bt_trace_set_name(struct bt_trace *trace, const char *name); + +extern bt_uuid bt_trace_get_uuid(struct bt_trace *trace); + +extern int bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid); + +extern uint64_t bt_trace_get_environment_entry_count(struct bt_trace *trace); + +extern void bt_trace_borrow_environment_entry_by_index( + struct bt_trace *trace, uint64_t index, + const char **name, struct bt_value **value); + +extern struct bt_value *bt_trace_borrow_environment_entry_value_by_name( + struct bt_trace *trace, const char *name); + +extern int bt_trace_set_environment_entry_integer( + struct bt_trace *trace, const char *name, + int64_t value); + +extern int bt_trace_set_environment_entry_string( + struct bt_trace *trace, const char *name, + const char *value); + +extern struct bt_field_type *bt_trace_borrow_packet_header_field_type( + struct bt_trace *trace); + +extern int bt_trace_set_packet_header_field_type(struct bt_trace *trace, + struct bt_field_type *packet_header_type); + +extern uint64_t bt_trace_get_stream_class_count(struct bt_trace *trace); + +extern struct bt_stream_class *bt_trace_borrow_stream_class_by_index( + struct bt_trace *trace, uint64_t index); + +extern struct bt_stream_class *bt_trace_borrow_stream_class_by_id( + struct bt_trace *trace, uint64_t id); + +extern uint64_t bt_trace_get_stream_count(struct bt_trace *trace); + +extern struct bt_stream *bt_trace_borrow_stream_by_index( + struct bt_trace *trace, uint64_t index); + +extern struct bt_stream *bt_trace_borrow_stream_by_id( + struct bt_trace *trace, uint64_t id); + +extern bt_bool bt_trace_is_static(struct bt_trace *trace); + +extern int bt_trace_make_static(struct bt_trace *trace); + +extern int bt_trace_add_is_static_listener( + struct bt_trace *trace, + bt_trace_is_static_listener listener, + bt_trace_listener_removed listener_removed, void *data, + uint64_t *listener_id); + +extern int bt_trace_remove_is_static_listener( + struct bt_trace *trace, uint64_t listener_id); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_TRACE_IR_TRACE_H */ diff --git a/include/babeltrace/ctf-ir/utils-internal.h b/include/babeltrace/trace-ir/utils-internal.h similarity index 91% rename from include/babeltrace/ctf-ir/utils-internal.h rename to include/babeltrace/trace-ir/utils-internal.h index 3c539429..4c3f8c03 100644 --- a/include/babeltrace/ctf-ir/utils-internal.h +++ b/include/babeltrace/trace-ir/utils-internal.h @@ -1,8 +1,8 @@ -#ifndef BABELTRACE_CTF_IR_UTILS_INTERNAL_H -#define BABELTRACE_CTF_IR_UTILS_INTERNAL_H +#ifndef BABELTRACE_TRACE_IR_UTILS_INTERNAL_H +#define BABELTRACE_TRACE_IR_UTILS_INTERNAL_H /* - * Babeltrace - Internal CTF IR utilities + * Babeltrace - Internal Trace IR utilities * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,8 +24,8 @@ */ #include -#include -#include +#include +#include #include struct search_query { @@ -120,4 +120,4 @@ bool bt_util_value_is_in_range_unsigned(unsigned int size, uint64_t value) return value <= max_value; } -#endif /* BABELTRACE_CTF_IR_UTILS_INTERNAL_H */ +#endif /* BABELTRACE_TRACE_IR_UTILS_INTERNAL_H */ diff --git a/lib/Makefile.am b/lib/Makefile.am index 121279a2..04ece474 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = ctf-ir ctf-writer prio_heap plugin graph . +SUBDIRS = trace-ir ctf-writer prio_heap plugin graph . lib_LTLIBRARIES = libbabeltrace.la libbabeltrace-ctf.la @@ -16,7 +16,7 @@ libbabeltrace_la_LIBADD = \ prio_heap/libprio_heap.la \ graph/libgraph.la \ plugin/libplugin.la \ - ctf-ir/libctf-ir.la \ + trace-ir/libtrace-ir.la \ ctf-writer/libctf-writer.la \ $(top_builddir)/logging/libbabeltrace-logging.la \ $(top_builddir)/common/libbabeltrace-common.la \ @@ -36,7 +36,7 @@ libbabeltrace_ctf_la_LDFLAGS = $(LT_NO_UNDEFINED) \ libbabeltrace_ctf_la_LIBADD = \ graph/libgraph.la \ - ctf-ir/libctf-ir.la \ + trace-ir/libtrace-ir.la \ ctf-writer/libctf-writer.la \ $(top_builddir)/logging/libbabeltrace-logging.la \ $(top_builddir)/common/libbabeltrace-common.la \ diff --git a/lib/graph/iterator.c b/lib/graph/iterator.c index fcc00100..a2111746 100644 --- a/lib/graph/iterator.c +++ b/lib/graph/iterator.c @@ -30,12 +30,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/graph/notification/event.c b/lib/graph/notification/event.c index 4b50d7fe..d8178eca 100644 --- a/lib/graph/notification/event.c +++ b/lib/graph/notification/event.c @@ -29,11 +29,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/graph/notification/inactivity.c b/lib/graph/notification/inactivity.c index 9523bb86..becf17e0 100644 --- a/lib/graph/notification/inactivity.c +++ b/lib/graph/notification/inactivity.c @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/lib/graph/notification/packet.c b/lib/graph/notification/packet.c index 70694e96..8e02201d 100644 --- a/lib/graph/notification/packet.c +++ b/lib/graph/notification/packet.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/graph/notification/stream.c b/lib/graph/notification/stream.c index e6015c25..fbb0cc78 100644 --- a/lib/graph/notification/stream.c +++ b/lib/graph/notification/stream.c @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/lib/lib-logging.c b/lib/lib-logging.c index d09b176d..56b41fc6 100644 --- a/lib/lib-logging.c +++ b/lib/lib-logging.c @@ -34,18 +34,18 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/Makefile.am b/lib/trace-ir/Makefile.am similarity index 75% rename from lib/ctf-ir/Makefile.am rename to lib/trace-ir/Makefile.am index dda79a6c..f2e1c3d0 100644 --- a/lib/ctf-ir/Makefile.am +++ b/lib/trace-ir/Makefile.am @@ -1,6 +1,6 @@ -noinst_LTLIBRARIES = libctf-ir.la +noinst_LTLIBRARIES = libtrace-ir.la -libctf_ir_la_SOURCES = \ +libtrace_ir_la_SOURCES = \ attributes.c \ clock-class.c \ clock-value.c \ @@ -20,4 +20,4 @@ libctf_ir_la_SOURCES = \ trace.c \ utils.c -libctf_ir_la_LIBADD = $(UUID_LIBS) +libtrace_ir_la_LIBADD = $(UUID_LIBS) diff --git a/lib/ctf-ir/attributes.c b/lib/trace-ir/attributes.c similarity index 99% rename from lib/ctf-ir/attributes.c rename to lib/trace-ir/attributes.c index ccd93b17..d43fd649 100644 --- a/lib/ctf-ir/attributes.c +++ b/lib/trace-ir/attributes.c @@ -1,7 +1,7 @@ /* * attributes.c * - * Babeltrace CTF IR - Attributes + * Babeltrace trace IR - Attributes * * Copyright (c) 2015 EfficiOS Inc. and Linux Foundation * Copyright (c) 2015 Philippe Proulx diff --git a/lib/ctf-ir/clock-class.c b/lib/trace-ir/clock-class.c similarity index 98% rename from lib/ctf-ir/clock-class.c rename to lib/trace-ir/clock-class.c index e4d53419..c8e5f3fd 100644 --- a/lib/ctf-ir/clock-class.c +++ b/lib/trace-ir/clock-class.c @@ -1,7 +1,7 @@ /* * clock-class.c * - * Babeltrace CTF IR - Clock class + * Babeltrace trace IR - Clock class * * Copyright 2013, 2014 Jérémie Galarneau * @@ -31,9 +31,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/clock-value.c b/lib/trace-ir/clock-value.c similarity index 97% rename from lib/ctf-ir/clock-value.c rename to lib/trace-ir/clock-value.c index 51c89ddd..97242118 100644 --- a/lib/ctf-ir/clock-value.c +++ b/lib/trace-ir/clock-value.c @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/event-class.c b/lib/trace-ir/event-class.c similarity index 94% rename from lib/ctf-ir/event-class.c rename to lib/trace-ir/event-class.c index b8824082..18a72f70 100644 --- a/lib/ctf-ir/event-class.c +++ b/lib/trace-ir/event-class.c @@ -1,7 +1,7 @@ /* * event-class.c * - * Babeltrace CTF IR - Event class + * Babeltrace trace IR - Event class * * Copyright 2013, 2014 Jérémie Galarneau * @@ -30,20 +30,20 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include #include #include diff --git a/lib/ctf-ir/event-header-field.c b/lib/trace-ir/event-header-field.c similarity index 93% rename from lib/ctf-ir/event-header-field.c rename to lib/trace-ir/event-header-field.c index dd2b2fff..a84e9995 100644 --- a/lib/ctf-ir/event-header-field.c +++ b/lib/trace-ir/event-header-field.c @@ -24,10 +24,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include struct bt_field *bt_event_header_field_borrow_field( diff --git a/lib/ctf-ir/event.c b/lib/trace-ir/event.c similarity index 90% rename from lib/ctf-ir/event.c rename to lib/trace-ir/event.c index 91e6ed8f..b997f209 100644 --- a/lib/ctf-ir/event.c +++ b/lib/trace-ir/event.c @@ -1,7 +1,7 @@ /* * event.c * - * Babeltrace CTF IR - Event + * Babeltrace trace IR - Event * * Copyright 2013, 2014 Jérémie Galarneau * @@ -30,25 +30,25 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include #include #include diff --git a/lib/ctf-ir/field-path.c b/lib/trace-ir/field-path.c similarity index 92% rename from lib/ctf-ir/field-path.c rename to lib/trace-ir/field-path.c index ceb54bf5..65d2f721 100644 --- a/lib/ctf-ir/field-path.c +++ b/lib/trace-ir/field-path.c @@ -1,7 +1,7 @@ /* * field-path.c * - * Babeltrace CTF IR - Field path + * Babeltrace trace IR - Field path * * Copyright 2013, 2014 Jérémie Galarneau * Copyright 2016 Philippe Proulx @@ -29,10 +29,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/field-types.c b/lib/trace-ir/field-types.c similarity index 98% rename from lib/ctf-ir/field-types.c rename to lib/trace-ir/field-types.c index f71cf29f..3953d85d 100644 --- a/lib/ctf-ir/field-types.c +++ b/lib/trace-ir/field-types.c @@ -1,7 +1,7 @@ /* * field-types.c * - * Babeltrace CTF IR - Event Types + * Babeltrace trace IR - Event Types * * Copyright 2013, 2014 Jérémie Galarneau * @@ -30,14 +30,14 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/field-wrapper.c b/lib/trace-ir/field-wrapper.c similarity index 96% rename from lib/ctf-ir/field-wrapper.c rename to lib/trace-ir/field-wrapper.c index ee28705f..7b13202a 100644 --- a/lib/ctf-ir/field-wrapper.c +++ b/lib/trace-ir/field-wrapper.c @@ -23,8 +23,8 @@ #define BT_LOG_TAG "FIELD-WRAPPER" #include -#include -#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/fields.c b/lib/trace-ir/fields.c similarity index 99% rename from lib/ctf-ir/fields.c rename to lib/trace-ir/fields.c index c0bd86b0..ee37ede0 100644 --- a/lib/ctf-ir/fields.c +++ b/lib/trace-ir/fields.c @@ -1,7 +1,7 @@ /* * fields.c * - * Babeltrace CTF IR - Event Fields + * Babeltrace trace IR - Event Fields * * Copyright 2013, 2014 Jérémie Galarneau * @@ -30,9 +30,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/packet-context-field.c b/lib/trace-ir/packet-context-field.c similarity index 93% rename from lib/ctf-ir/packet-context-field.c rename to lib/trace-ir/packet-context-field.c index 55fdb7f4..b3827435 100644 --- a/lib/ctf-ir/packet-context-field.c +++ b/lib/trace-ir/packet-context-field.c @@ -24,10 +24,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include struct bt_field *bt_packet_context_field_borrow_field( diff --git a/lib/ctf-ir/packet-header-field.c b/lib/trace-ir/packet-header-field.c similarity index 93% rename from lib/ctf-ir/packet-header-field.c rename to lib/trace-ir/packet-header-field.c index 17d88ad0..7f9519eb 100644 --- a/lib/ctf-ir/packet-header-field.c +++ b/lib/trace-ir/packet-header-field.c @@ -24,10 +24,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include struct bt_field *bt_packet_header_field_borrow_field( diff --git a/lib/ctf-ir/packet.c b/lib/trace-ir/packet.c similarity index 96% rename from lib/ctf-ir/packet.c rename to lib/trace-ir/packet.c index d3fce47a..d6677212 100644 --- a/lib/ctf-ir/packet.c +++ b/lib/trace-ir/packet.c @@ -1,7 +1,7 @@ /* * packet.c * - * Babeltrace CTF IR - Stream packet + * Babeltrace trace IR - Stream packet * * Copyright 2016 Philippe Proulx * @@ -28,17 +28,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/resolve-field-path.c b/lib/trace-ir/resolve-field-path.c similarity index 98% rename from lib/ctf-ir/resolve-field-path.c rename to lib/trace-ir/resolve-field-path.c index 60367589..02150f49 100644 --- a/lib/ctf-ir/resolve-field-path.c +++ b/lib/trace-ir/resolve-field-path.c @@ -25,10 +25,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/stream-class.c b/lib/trace-ir/stream-class.c similarity index 97% rename from lib/ctf-ir/stream-class.c rename to lib/trace-ir/stream-class.c index 69b9d5c3..7fd1a80b 100644 --- a/lib/ctf-ir/stream-class.c +++ b/lib/trace-ir/stream-class.c @@ -1,7 +1,7 @@ /* * stream-class.c * - * Babeltrace CTF IR - Stream Class + * Babeltrace trace IR - Stream Class * * Copyright 2013, 2014 Jérémie Galarneau * @@ -30,14 +30,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/stream.c b/lib/trace-ir/stream.c similarity index 94% rename from lib/ctf-ir/stream.c rename to lib/trace-ir/stream.c index 665347a2..7d37f4ee 100644 --- a/lib/ctf-ir/stream.c +++ b/lib/trace-ir/stream.c @@ -1,7 +1,7 @@ /* * stream.c * - * Babeltrace CTF IR - Stream + * Babeltrace trace IR - Stream * * Copyright 2013, 2014 Jérémie Galarneau * @@ -30,13 +30,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/trace.c b/lib/trace-ir/trace.c similarity index 96% rename from lib/ctf-ir/trace.c rename to lib/trace-ir/trace.c index 69189c44..e5ae5132 100644 --- a/lib/ctf-ir/trace.c +++ b/lib/trace-ir/trace.c @@ -1,7 +1,7 @@ /* * trace.c * - * Babeltrace CTF IR - Trace + * Babeltrace trace IR - Trace * * Copyright 2014 Jérémie Galarneau * @@ -30,20 +30,20 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/ctf-ir/utils.c b/lib/trace-ir/utils.c similarity index 89% rename from lib/ctf-ir/utils.c rename to lib/trace-ir/utils.c index 41337cfd..76906a68 100644 --- a/lib/ctf-ir/utils.c +++ b/lib/trace-ir/utils.c @@ -1,7 +1,7 @@ /* * utils.c * - * Babeltrace CTF IR - Utilities + * Babeltrace trace IR - Utilities * * Copyright 2015 Jérémie Galarneau * @@ -26,12 +26,12 @@ * SOFTWARE. */ -#define BT_LOG_TAG "CTF-IR-UTILS" +#define BT_LOG_TAG "TRACE-IR-UTILS" #include #include #include -#include -#include +#include +#include #include #include diff --git a/plugins/ctf/fs-src/fs.h b/plugins/ctf/fs-src/fs.h index c72be5e0..26e796a7 100644 --- a/plugins/ctf/fs-src/fs.h +++ b/plugins/ctf/fs-src/fs.h @@ -106,7 +106,7 @@ struct ctf_fs_ds_file_group { * belong to this group (a single stream instance). * * You can call ctf_fs_ds_file_create() with one of those paths - * and the CTF IR stream below. + * and the trace IR stream below. */ GPtrArray *ds_file_infos; diff --git a/tests/Makefile.am b/tests/Makefile.am index 05e9439e..c5ac2d77 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,7 +26,7 @@ TESTS_CLI = \ TESTS_LIB = \ lib/test_ctf_writer_complete \ lib/test_bt_values \ - lib/test_ctf_ir_ref \ + lib/test_trace_ir_ref \ lib/test_bt_ctf_field_type_validation \ lib/test_ir_visit \ lib/test_graph_topo \ @@ -38,7 +38,7 @@ TESTS_LIB += lib/test_plugin_complete endif if ENABLE_PYTHON_BINDINGS -TESTS_LIB += lib/ctf-ir/test_ctf_ir +TESTS_LIB += lib/trace-ir/test_trace_ir TESTS_LIB += lib/ctf-writer/test_ctf_writer endif diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index b2b34642..39ad76e0 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = ctf-ir ctf-writer +SUBDIRS = trace-ir ctf-writer AM_CPPFLAGS += -I$(top_srcdir)/tests/utils @@ -19,19 +19,19 @@ test_ctf_writer_LDADD = $(COMMON_TEST_LDADD) test_bt_values_LDADD = $(COMMON_TEST_LDADD) -test_ctf_ir_ref_LDADD = $(COMMON_TEST_LDADD) +test_trace_ir_ref_LDADD = $(COMMON_TEST_LDADD) test_graph_topo_LDADD = $(COMMON_TEST_LDADD) test_bt_notification_iterator_LDADD = $(COMMON_TEST_LDADD) noinst_PROGRAMS = test_bitfield test_ctf_writer test_bt_values \ - test_ctf_ir_ref test_graph_topo test_bt_notification_iterator + test_trace_ir_ref test_graph_topo test_bt_notification_iterator test_bitfield_SOURCES = test_bitfield.c test_ctf_writer_SOURCES = test_ctf_writer.c test_bt_values_SOURCES = test_bt_values.c -test_ctf_ir_ref_SOURCES = test_ctf_ir_ref.c +test_trace_ir_ref_SOURCES = test_trace_ir_ref.c test_graph_topo_SOURCES = test_graph_topo.c test_bt_notification_iterator_SOURCES = test_bt_notification_iterator.c diff --git a/tests/lib/test_bt_notification_iterator.c b/tests/lib/test_bt_notification_iterator.c index 3cfa4745..645b8850 100644 --- a/tests/lib/test_bt_notification_iterator.c +++ b/tests/lib/test_bt_notification_iterator.c @@ -22,14 +22,14 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/tests/lib/test_ir_visit.c b/tests/lib/test_ir_visit.c index bc2da8e7..fa2046bb 100644 --- a/tests/lib/test_ir_visit.c +++ b/tests/lib/test_ir_visit.c @@ -1,7 +1,7 @@ /* * test_ir_visit.c * - * CTF IR visitor interface test + * Trace IR visitor interface test * * Copyright 2016 - Jérémie Galarneau * @@ -21,11 +21,11 @@ #include "tap/tap.h" #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/tests/lib/test_plugin.c b/tests/lib/test_plugin.c index c8578827..2cba9547 100644 --- a/tests/lib/test_plugin.c +++ b/tests/lib/test_plugin.c @@ -1,7 +1,7 @@ /* * test_plugin.c * - * CTF IR Reference Count test + * Trace IR Reference Count test * * Copyright (c) 2017 Philippe Proulx * diff --git a/tests/lib/test_ctf_ir_ref.c b/tests/lib/test_trace_ir_ref.c similarity index 96% rename from tests/lib/test_ctf_ir_ref.c rename to tests/lib/test_trace_ir_ref.c index e618a269..bf970246 100644 --- a/tests/lib/test_ctf_ir_ref.c +++ b/tests/lib/test_trace_ir_ref.c @@ -1,7 +1,7 @@ /* - * test_ctf_ir_ref.c + * test_trace_ir_ref.c * - * CTF IR Reference Count test + * Trace IR Reference Count test * * Copyright 2016 - Jérémie Galarneau * @@ -27,13 +27,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -343,12 +343,12 @@ static void init_weak_refs(struct bt_trace *tc, static void test_example_scenario(void) { - /** - * Weak pointers to CTF-IR objects are to be used very carefully. - * This is NOT a good practice and is strongly discouraged; this - * is only done to facilitate the validation of expected reference - * counts without affecting them by taking "real" references to the - * objects. + /* + * Weak pointers to trace IR objects are to be used very + * carefully. This is NOT a good practice and is strongly + * discouraged; this is only done to facilitate the validation + * of expected reference counts without affecting them by taking + * "real" references to the objects. */ struct bt_trace *tc1 = NULL, *weak_tc1 = NULL; struct bt_stream_class *weak_sc1 = NULL, *weak_sc2 = NULL; diff --git a/tests/lib/ctf-ir/Makefile.am b/tests/lib/trace-ir/Makefile.am similarity index 72% rename from tests/lib/ctf-ir/Makefile.am rename to tests/lib/trace-ir/Makefile.am index 0c4adbe7..3c946c13 100644 --- a/tests/lib/ctf-ir/Makefile.am +++ b/tests/lib/trace-ir/Makefile.am @@ -1,5 +1,5 @@ if ENABLE_PYTHON_BINDINGS -check_SCRIPTS = test_ctf_ir +check_SCRIPTS = test_trace_ir endif EXTRA_DIST = test_trace.py test_stream_class.py diff --git a/tests/lib/ctf-ir/test_stream_class.py b/tests/lib/trace-ir/test_stream_class.py similarity index 100% rename from tests/lib/ctf-ir/test_stream_class.py rename to tests/lib/trace-ir/test_stream_class.py diff --git a/tests/lib/ctf-ir/test_trace.py b/tests/lib/trace-ir/test_trace.py similarity index 100% rename from tests/lib/ctf-ir/test_trace.py rename to tests/lib/trace-ir/test_trace.py diff --git a/tests/lib/ctf-ir/test_ctf_ir.in b/tests/lib/trace-ir/test_trace_ir.in similarity index 96% rename from tests/lib/ctf-ir/test_ctf_ir.in rename to tests/lib/trace-ir/test_trace_ir.in index c3ff375c..e78b3445 100644 --- a/tests/lib/ctf-ir/test_ctf_ir.in +++ b/tests/lib/trace-ir/test_trace_ir.in @@ -23,7 +23,7 @@ NO_SH_TAP=1 PYTHON_BUILD_DIR="${BT_BUILD_PATH}/bindings/python/bt2/build/build_lib" TESTS_UTILS_PYTHON_DIR="${BT_SRC_PATH}/tests/utils/python" TESTRUNNER_PY="${BT_SRC_PATH}/tests/utils/python/testrunner.py" -THIS_DIR="${BT_SRC_PATH}/tests/lib/ctf-ir" +THIS_DIR="${BT_SRC_PATH}/tests/lib/trace-ir" if [ "x${MSYSTEM}" != "x" ]; then export PATH="${BT_BUILD_PATH}/lib/.libs:${PATH}" -- 2.34.1