From 5656cea5531432357cf7ca2a0be14adae5a1e3d3 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 11 Dec 2023 12:54:03 -0500 Subject: [PATCH] src/plugins/ctf/common: restructure subtree This patch restructures the `src/plugins/ctf/common` subtree as such: `src`: Everything common to source component classes. `src/metadata/tsdl`: TSDL-specific code. As of this patch, everything which was part of `src/plugins/ctf/common/metadata` is moved here, but some code will be shared with CTF 2 sources eventually and move back to `src/plugins/ctf/common/src/metadata`. `print.hpp` isn't needed anymore. This new structure will make it easier to add common `ctf` plugin code for both source and sink component classes, as well as to add code specific to CTF 2 and common to both CTF 1 and CTF 2. Signed-off-by: Philippe Proulx Change-Id: I4246d6ba37ff26efa5d4b7b4be2ec8600d3207e4 Reviewed-on: https://review.lttng.org/c/babeltrace/+/7839 Reviewed-on: https://review.lttng.org/c/babeltrace/+/12190 CI-Build: Simon Marchi Tested-by: jenkins --- .gitignore | 8 +- src/Makefile.am | 85 +++++++++---------- src/plugins/ctf/common/print.hpp | 35 -------- .../ctf/common/{ => src}/bfcr/bfcr.cpp | 2 +- .../ctf/common/{ => src}/bfcr/bfcr.hpp | 2 +- .../{metadata => src/metadata/tsdl}/ast.hpp | 0 .../tsdl}/ctf-meta-configure-ir-trace.cpp | 2 +- .../tsdl}/ctf-meta-configure-ir-trace.hpp | 0 .../metadata/tsdl}/ctf-meta-resolve.cpp | 0 .../metadata/tsdl}/ctf-meta-translate.cpp | 0 .../tsdl}/ctf-meta-update-alignments.cpp | 0 .../ctf-meta-update-default-clock-classes.cpp | 0 .../metadata/tsdl}/ctf-meta-update-in-ir.cpp | 0 .../tsdl}/ctf-meta-update-meanings.cpp | 0 .../ctf-meta-update-stream-class-config.cpp | 0 .../ctf-meta-update-text-array-sequence.cpp | 0 .../ctf-meta-update-value-storing-indexes.cpp | 0 .../metadata/tsdl}/ctf-meta-validate.cpp | 0 .../metadata/tsdl}/ctf-meta-visitors.hpp | 0 ...tf-meta-warn-meaningless-header-fields.cpp | 0 .../metadata/tsdl}/ctf-meta.hpp | 0 .../decoder-packetized-file-stream-to-buf.cpp | 0 .../decoder-packetized-file-stream-to-buf.hpp | 0 .../metadata/tsdl}/decoder.cpp | 0 .../metadata/tsdl}/decoder.hpp | 0 .../{metadata => src/metadata/tsdl}/lexer.lpp | 8 +- .../metadata/tsdl}/logging.cpp | 0 .../metadata/tsdl}/logging.hpp | 0 .../metadata/tsdl}/objstack.cpp | 0 .../metadata/tsdl}/objstack.hpp | 0 .../metadata/tsdl}/parser-wrap.hpp | 2 +- .../metadata/tsdl}/parser.ypp | 11 +-- .../metadata/tsdl}/scanner-symbols.hpp | 0 .../metadata/tsdl}/scanner.hpp | 0 .../metadata/tsdl}/visitor-generate-ir.cpp | 0 .../metadata/tsdl}/visitor-parent-links.cpp | 0 .../tsdl}/visitor-semantic-validator.cpp | 0 .../common/{ => src}/msg-iter/msg-iter.cpp | 1 - .../common/{ => src}/msg-iter/msg-iter.hpp | 2 +- src/plugins/ctf/fs-src/data-stream-file.cpp | 5 +- src/plugins/ctf/fs-src/data-stream-file.hpp | 2 +- src/plugins/ctf/fs-src/fs.cpp | 5 +- src/plugins/ctf/fs-src/metadata.cpp | 2 +- src/plugins/ctf/fs-src/query.cpp | 2 +- src/plugins/ctf/lttng-live/data-stream.cpp | 11 ++- src/plugins/ctf/lttng-live/lttng-live.hpp | 3 +- src/plugins/ctf/lttng-live/metadata.cpp | 5 +- 47 files changed, 82 insertions(+), 111 deletions(-) delete mode 100644 src/plugins/ctf/common/print.hpp rename src/plugins/ctf/common/{ => src}/bfcr/bfcr.cpp (99%) rename src/plugins/ctf/common/{ => src}/bfcr/bfcr.hpp (99%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ast.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-configure-ir-trace.cpp (95%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-configure-ir-trace.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-resolve.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-translate.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-update-alignments.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-update-default-clock-classes.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-update-in-ir.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-update-meanings.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-update-stream-class-config.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-update-text-array-sequence.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-update-value-storing-indexes.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-validate.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-visitors.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta-warn-meaningless-header-fields.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/ctf-meta.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/decoder-packetized-file-stream-to-buf.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/decoder-packetized-file-stream-to-buf.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/decoder.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/decoder.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/lexer.lpp (95%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/logging.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/logging.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/objstack.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/objstack.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/parser-wrap.hpp (91%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/parser.ypp (99%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/scanner-symbols.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/scanner.hpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/visitor-generate-ir.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/visitor-parent-links.cpp (100%) rename src/plugins/ctf/common/{metadata => src/metadata/tsdl}/visitor-semantic-validator.cpp (100%) rename src/plugins/ctf/common/{ => src}/msg-iter/msg-iter.cpp (99%) rename src/plugins/ctf/common/{ => src}/msg-iter/msg-iter.hpp (99%) diff --git a/.gitignore b/.gitignore index c63fcaf0..2267bc7b 100644 --- a/.gitignore +++ b/.gitignore @@ -28,10 +28,10 @@ *.bkp *.trs .dirstamp -/src/plugins/ctf/common/metadata/lexer.cpp -/src/plugins/ctf/common/metadata/parser.cpp -/src/plugins/ctf/common/metadata/parser.hpp -/src/plugins/ctf/common/metadata/parser.output +/src/plugins/ctf/common/src/metadata/tsdl/lexer.cpp +/src/plugins/ctf/common/src/metadata/tsdl/parser.cpp +/src/plugins/ctf/common/src/metadata/tsdl/parser.hpp +/src/plugins/ctf/common/src/metadata/tsdl/parser.output /src/bindings/python/bt2/bt2.egg-info /src/bindings/python/bt2/dist /src/cli/babeltrace2 diff --git a/src/Makefile.am b/src/Makefile.am index 2d18268c..b8eebe9f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -243,14 +243,14 @@ AM_YFLAGS = \ -t -d -v -Wno-yacc plugins_ctf_common_metadata_libctf_parser_la_SOURCES = \ - plugins/ctf/common/metadata/lexer.lpp \ - plugins/ctf/common/metadata/parser.ypp \ - plugins/ctf/common/metadata/objstack.cpp + plugins/ctf/common/src/metadata/tsdl/lexer.lpp \ + plugins/ctf/common/src/metadata/tsdl/parser.ypp \ + plugins/ctf/common/src/metadata/tsdl/objstack.cpp # scanner-symbols.h is included to prefix generated yy_* symbols with bt_. plugins_ctf_common_metadata_libctf_parser_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ - -include $(srcdir)/plugins/ctf/common/metadata/scanner-symbols.hpp + -include $(srcdir)/plugins/ctf/common/src/metadata/tsdl/scanner-symbols.hpp # This library contains (mostly) generated code, silence some warnings that it # produces. @@ -262,52 +262,52 @@ plugins_ctf_common_metadata_libctf_parser_la_CXXFLAGS = \ -Wno-unused-parameter plugins_ctf_common_metadata_libctf_ast_la_SOURCES = \ - plugins/ctf/common/metadata/visitor-generate-ir.cpp \ - plugins/ctf/common/metadata/visitor-semantic-validator.cpp \ - plugins/ctf/common/metadata/visitor-parent-links.cpp \ - plugins/ctf/common/metadata/ast.hpp \ - plugins/ctf/common/metadata/objstack.hpp \ - plugins/ctf/common/metadata/parser.hpp \ - plugins/ctf/common/metadata/parser-wrap.hpp \ - plugins/ctf/common/metadata/scanner.hpp \ - plugins/ctf/common/metadata/scanner-symbols.hpp \ - plugins/ctf/common/metadata/decoder.cpp \ - plugins/ctf/common/metadata/decoder.hpp \ - plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.cpp \ - plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.hpp \ - plugins/ctf/common/metadata/logging.cpp \ - plugins/ctf/common/metadata/logging.hpp \ - plugins/ctf/common/metadata/ctf-meta.hpp \ - plugins/ctf/common/metadata/ctf-meta-visitors.hpp \ - plugins/ctf/common/metadata/ctf-meta-validate.cpp \ - plugins/ctf/common/metadata/ctf-meta-update-meanings.cpp \ - plugins/ctf/common/metadata/ctf-meta-update-in-ir.cpp \ - plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.cpp \ - plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.cpp \ - plugins/ctf/common/metadata/ctf-meta-update-alignments.cpp \ - plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.cpp \ - plugins/ctf/common/metadata/ctf-meta-update-stream-class-config.cpp \ - plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.cpp \ - plugins/ctf/common/metadata/ctf-meta-translate.cpp \ - plugins/ctf/common/metadata/ctf-meta-resolve.cpp \ - plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.cpp \ - plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.hpp + plugins/ctf/common/src/metadata/tsdl/visitor-generate-ir.cpp \ + plugins/ctf/common/src/metadata/tsdl/visitor-semantic-validator.cpp \ + plugins/ctf/common/src/metadata/tsdl/visitor-parent-links.cpp \ + plugins/ctf/common/src/metadata/tsdl/ast.hpp \ + plugins/ctf/common/src/metadata/tsdl/objstack.hpp \ + plugins/ctf/common/src/metadata/tsdl/parser.hpp \ + plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp \ + plugins/ctf/common/src/metadata/tsdl/scanner.hpp \ + plugins/ctf/common/src/metadata/tsdl/scanner-symbols.hpp \ + plugins/ctf/common/src/metadata/tsdl/decoder.cpp \ + plugins/ctf/common/src/metadata/tsdl/decoder.hpp \ + plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.cpp \ + plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.hpp \ + plugins/ctf/common/src/metadata/tsdl/logging.cpp \ + plugins/ctf/common/src/metadata/tsdl/logging.hpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta.hpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-visitors.hpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-validate.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-meanings.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-in-ir.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-default-clock-classes.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-text-array-sequence.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-alignments.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-value-storing-indexes.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-stream-class-config.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-warn-meaningless-header-fields.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-translate.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-resolve.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.cpp \ + plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp if BABELTRACE_BUILD_WITH_MINGW plugins_ctf_common_metadata_libctf_ast_la_LIBADD = -lintl -liconv -lole32 endif BUILT_SOURCES += \ - plugins/ctf/common/metadata/parser.hpp + plugins/ctf/common/src/metadata/tsdl/parser.hpp ALL_LOCAL = if HAVE_BISON # We have bison: we can clean the generated parser files CLEANFILES += \ - plugins/ctf/common/metadata/parser.cpp \ - plugins/ctf/common/metadata/parser.hpp \ - plugins/ctf/common/metadata/parser.output + plugins/ctf/common/src/metadata/tsdl/parser.cpp \ + plugins/ctf/common/src/metadata/tsdl/parser.hpp \ + plugins/ctf/common/src/metadata/tsdl/parser.output else # HAVE_BISON # Create target used to stop the build if we want to build the parser, # but we don't have the necessary tool to do so @@ -648,11 +648,10 @@ endif # ctf plugin plugins_ctf_babeltrace_plugin_ctf_la_SOURCES = \ - plugins/ctf/common/bfcr/bfcr.cpp \ - plugins/ctf/common/bfcr/bfcr.hpp \ - plugins/ctf/common/msg-iter/msg-iter.cpp \ - plugins/ctf/common/msg-iter/msg-iter.hpp \ - plugins/ctf/common/print.hpp \ + plugins/ctf/common/src/bfcr/bfcr.cpp \ + plugins/ctf/common/src/bfcr/bfcr.hpp \ + plugins/ctf/common/src/msg-iter/msg-iter.cpp \ + plugins/ctf/common/src/msg-iter/msg-iter.hpp \ plugins/ctf/fs-sink/fs-sink.cpp \ plugins/ctf/fs-sink/fs-sink-ctf-meta.hpp \ plugins/ctf/fs-sink/fs-sink.hpp \ diff --git a/src/plugins/ctf/common/print.hpp b/src/plugins/ctf/common/print.hpp deleted file mode 100644 index 7db4dde9..00000000 --- a/src/plugins/ctf/common/print.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright (c) 2016 Philippe Proulx - * - * Define PRINT_PREFIX and PRINT_ERR_STREAM, then include this file. - */ - -#ifndef CTF_BTR_PRINT_H -#define CTF_BTR_PRINT_H - -#include - -#define PERR(fmt, ...) \ - do { \ - if (PRINT_ERR_STREAM) { \ - fprintf(PRINT_ERR_STREAM, "Error: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \ - } \ - } while (0) - -#define PWARN(fmt, ...) \ - do { \ - if (PRINT_ERR_STREAM) { \ - fprintf(PRINT_ERR_STREAM, "Warning: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \ - } \ - } while (0) - -#define PDBG(fmt, ...) \ - do { \ - if (babeltrace_debug) { \ - fprintf(stderr, "Debug: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \ - } \ - } while (0) - -#endif /* CTF_BTR_PRINT_H */ diff --git a/src/plugins/ctf/common/bfcr/bfcr.cpp b/src/plugins/ctf/common/src/bfcr/bfcr.cpp similarity index 99% rename from src/plugins/ctf/common/bfcr/bfcr.cpp rename to src/plugins/ctf/common/src/bfcr/bfcr.cpp index f59f65d0..9682d30d 100644 --- a/src/plugins/ctf/common/bfcr/bfcr.cpp +++ b/src/plugins/ctf/common/src/bfcr/bfcr.cpp @@ -25,7 +25,7 @@ #include "common/common.h" #include "compat/bitfield.h" -#include "../metadata/ctf-meta.hpp" +#include "../metadata/tsdl/ctf-meta.hpp" #include "bfcr.hpp" #define DIV8(_x) ((_x) >> 3) diff --git a/src/plugins/ctf/common/bfcr/bfcr.hpp b/src/plugins/ctf/common/src/bfcr/bfcr.hpp similarity index 99% rename from src/plugins/ctf/common/bfcr/bfcr.hpp rename to src/plugins/ctf/common/src/bfcr/bfcr.hpp index f2fe8796..9e3a2dc1 100644 --- a/src/plugins/ctf/common/bfcr/bfcr.hpp +++ b/src/plugins/ctf/common/src/bfcr/bfcr.hpp @@ -15,7 +15,7 @@ #include -#include "common/common.h" +#include "../metadata/tsdl/ctf-meta.hpp" /** * @file bfcr.h diff --git a/src/plugins/ctf/common/metadata/ast.hpp b/src/plugins/ctf/common/src/metadata/tsdl/ast.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/ast.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/ast.hpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.cpp similarity index 95% rename from src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.cpp index ef178c53..eb252def 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.cpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.cpp @@ -9,7 +9,7 @@ #include "common/assert.h" #include "ctf-meta-configure-ir-trace.hpp" -#include "plugins/ctf/common/metadata/ctf-meta.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/ctf-meta.hpp" int ctf_trace_class_configure_ir_trace(struct ctf_trace_class *tc, bt_trace *ir_trace) { diff --git a/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.hpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-resolve.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-resolve.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-translate.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-translate.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-translate.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-alignments.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-alignments.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-update-alignments.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-alignments.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-default-clock-classes.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-default-clock-classes.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-in-ir.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-in-ir.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-update-in-ir.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-in-ir.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-meanings.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-meanings.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-update-meanings.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-meanings.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-stream-class-config.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-stream-class-config.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-update-stream-class-config.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-stream-class-config.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-text-array-sequence.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-text-array-sequence.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-value-storing-indexes.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-update-value-storing-indexes.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-validate.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-validate.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-validate.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-validate.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-visitors.hpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-visitors.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-visitors.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-visitors.hpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.cpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-warn-meaningless-header-fields.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-warn-meaningless-header-fields.cpp diff --git a/src/plugins/ctf/common/metadata/ctf-meta.hpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/ctf-meta.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/ctf-meta.hpp diff --git a/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.cpp b/src/plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.cpp diff --git a/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.hpp b/src/plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.hpp diff --git a/src/plugins/ctf/common/metadata/decoder.cpp b/src/plugins/ctf/common/src/metadata/tsdl/decoder.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/decoder.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/decoder.cpp diff --git a/src/plugins/ctf/common/metadata/decoder.hpp b/src/plugins/ctf/common/src/metadata/tsdl/decoder.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/decoder.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/decoder.hpp diff --git a/src/plugins/ctf/common/metadata/lexer.lpp b/src/plugins/ctf/common/src/metadata/tsdl/lexer.lpp similarity index 95% rename from src/plugins/ctf/common/metadata/lexer.lpp rename to src/plugins/ctf/common/src/metadata/tsdl/lexer.lpp index 7c2d5d38..0f6070b5 100644 --- a/src/plugins/ctf/common/metadata/lexer.lpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/lexer.lpp @@ -12,11 +12,11 @@ #define BT_LOG_OUTPUT_LEVEL ctf_plugin_metadata_log_level #define BT_LOG_TAG "PLUGIN-CTF-METADATA-LEXER" -#include "plugins/ctf/common/metadata/logging.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/logging.hpp" -#include "plugins/ctf/common/metadata/ast.hpp" -#include "plugins/ctf/common/metadata/parser-wrap.hpp" -#include "plugins/ctf/common/metadata/scanner.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/scanner.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/ast.hpp" #define YY_FATAL_ERROR(_msg) BT_LOGF_STR(_msg) diff --git a/src/plugins/ctf/common/metadata/logging.cpp b/src/plugins/ctf/common/src/metadata/tsdl/logging.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/logging.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/logging.cpp diff --git a/src/plugins/ctf/common/metadata/logging.hpp b/src/plugins/ctf/common/src/metadata/tsdl/logging.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/logging.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/logging.hpp diff --git a/src/plugins/ctf/common/metadata/objstack.cpp b/src/plugins/ctf/common/src/metadata/tsdl/objstack.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/objstack.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/objstack.cpp diff --git a/src/plugins/ctf/common/metadata/objstack.hpp b/src/plugins/ctf/common/src/metadata/tsdl/objstack.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/objstack.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/objstack.hpp diff --git a/src/plugins/ctf/common/metadata/parser-wrap.hpp b/src/plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp similarity index 91% rename from src/plugins/ctf/common/metadata/parser-wrap.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp index e35c3621..7b6b580b 100644 --- a/src/plugins/ctf/common/metadata/parser-wrap.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp @@ -22,7 +22,7 @@ #endif #define ALLOW_INCLUDE_PARSER_H -#include "plugins/ctf/common/metadata/parser.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/parser.hpp" #undef ALLOW_INCLUDE_PARSER_H #endif diff --git a/src/plugins/ctf/common/metadata/parser.ypp b/src/plugins/ctf/common/src/metadata/tsdl/parser.ypp similarity index 99% rename from src/plugins/ctf/common/metadata/parser.ypp rename to src/plugins/ctf/common/src/metadata/tsdl/parser.ypp index eb6e32c7..b0583695 100644 --- a/src/plugins/ctf/common/metadata/parser.ypp +++ b/src/plugins/ctf/common/src/metadata/tsdl/parser.ypp @@ -19,14 +19,15 @@ #define BT_LOG_OUTPUT_LEVEL ctf_plugin_metadata_log_level #define BT_LOG_TAG "PLUGIN/CTF/META/PARSER" -#include "plugins/ctf/common/metadata/logging.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/logging.hpp" #include "common/list.h" #include "common/assert.h" -#include "plugins/ctf/common/metadata/ast.hpp" -#include "plugins/ctf/common/metadata/objstack.hpp" -#include "plugins/ctf/common/metadata/parser-wrap.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/scanner.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/ast.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/objstack.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp" /* * Avoid warning about "yynerrs" being unused, seen with bison 3.5.1 + clang 15 @@ -1049,7 +1050,7 @@ void ctf_scanner_free(struct ctf_scanner *scanner) # error "Don't include parser.h directly, include parser-wrap.h instead." #endif -#include "plugins/ctf/common/metadata/scanner.hpp" +#include "plugins/ctf/common/src/metadata/tsdl/scanner.hpp" } %code provides { diff --git a/src/plugins/ctf/common/metadata/scanner-symbols.hpp b/src/plugins/ctf/common/src/metadata/tsdl/scanner-symbols.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/scanner-symbols.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/scanner-symbols.hpp diff --git a/src/plugins/ctf/common/metadata/scanner.hpp b/src/plugins/ctf/common/src/metadata/tsdl/scanner.hpp similarity index 100% rename from src/plugins/ctf/common/metadata/scanner.hpp rename to src/plugins/ctf/common/src/metadata/tsdl/scanner.hpp diff --git a/src/plugins/ctf/common/metadata/visitor-generate-ir.cpp b/src/plugins/ctf/common/src/metadata/tsdl/visitor-generate-ir.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/visitor-generate-ir.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/visitor-generate-ir.cpp diff --git a/src/plugins/ctf/common/metadata/visitor-parent-links.cpp b/src/plugins/ctf/common/src/metadata/tsdl/visitor-parent-links.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/visitor-parent-links.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/visitor-parent-links.cpp diff --git a/src/plugins/ctf/common/metadata/visitor-semantic-validator.cpp b/src/plugins/ctf/common/src/metadata/tsdl/visitor-semantic-validator.cpp similarity index 100% rename from src/plugins/ctf/common/metadata/visitor-semantic-validator.cpp rename to src/plugins/ctf/common/src/metadata/tsdl/visitor-semantic-validator.cpp diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.cpp b/src/plugins/ctf/common/src/msg-iter/msg-iter.cpp similarity index 99% rename from src/plugins/ctf/common/msg-iter/msg-iter.cpp rename to src/plugins/ctf/common/src/msg-iter/msg-iter.cpp index 33ad4a27..37e88c17 100644 --- a/src/plugins/ctf/common/msg-iter/msg-iter.cpp +++ b/src/plugins/ctf/common/src/msg-iter/msg-iter.cpp @@ -25,7 +25,6 @@ #include "../bfcr/bfcr.hpp" #include "msg-iter.hpp" -#include "plugins/ctf/common/metadata/ctf-meta.hpp" /* A visit stack entry */ struct stack_entry diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.hpp b/src/plugins/ctf/common/src/msg-iter/msg-iter.hpp similarity index 99% rename from src/plugins/ctf/common/msg-iter/msg-iter.hpp rename to src/plugins/ctf/common/src/msg-iter/msg-iter.hpp index 0b49c1c6..dea4615d 100644 --- a/src/plugins/ctf/common/msg-iter/msg-iter.hpp +++ b/src/plugins/ctf/common/src/msg-iter/msg-iter.hpp @@ -16,7 +16,7 @@ #include -#include "common/common.h" +#include "../metadata/tsdl/ctf-meta.hpp" /** * @file ctf-msg-iter.h diff --git a/src/plugins/ctf/fs-src/data-stream-file.cpp b/src/plugins/ctf/fs-src/data-stream-file.cpp index 4a500221..7261fc74 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.cpp +++ b/src/plugins/ctf/fs-src/data-stream-file.cpp @@ -17,18 +17,19 @@ #define BT_COMP_LOG_SELF_COMP (self_comp) #define BT_LOG_OUTPUT_LEVEL (log_level) #define BT_LOG_TAG "PLUGIN/SRC.CTF.FS/DS" +#include + #include "logging/comp-logging.h" #include "common/assert.h" #include "compat/endian.h" /* IWYU pragma: keep */ #include "compat/mman.h" /* IWYU pragma: keep */ -#include "../common/msg-iter/msg-iter.hpp" +#include "../common/src/msg-iter/msg-iter.hpp" #include "data-stream-file.hpp" #include "file.hpp" #include "fs.hpp" #include "lttng-index.hpp" -#include "plugins/ctf/common/metadata/ctf-meta.hpp" static inline size_t remaining_mmap_bytes(struct ctf_fs_ds_file *ds_file) { diff --git a/src/plugins/ctf/fs-src/data-stream-file.hpp b/src/plugins/ctf/fs-src/data-stream-file.hpp index 297c859f..011abe85 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.hpp +++ b/src/plugins/ctf/fs-src/data-stream-file.hpp @@ -12,7 +12,7 @@ #include -#include "../common/msg-iter/msg-iter.hpp" +#include "../common/src/msg-iter/msg-iter.hpp" struct ctf_fs_ds_file_info { diff --git a/src/plugins/ctf/fs-src/fs.cpp b/src/plugins/ctf/fs-src/fs.cpp index 5306b421..a60c8ddc 100644 --- a/src/plugins/ctf/fs-src/fs.cpp +++ b/src/plugins/ctf/fs-src/fs.cpp @@ -23,13 +23,12 @@ #include "plugins/common/param-validation/param-validation.h" -#include "../common/metadata/ctf-meta-configure-ir-trace.hpp" -#include "../common/msg-iter/msg-iter.hpp" +#include "../common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp" +#include "../common/src/msg-iter/msg-iter.hpp" #include "data-stream-file.hpp" #include "file.hpp" #include "fs.hpp" #include "metadata.hpp" -#include "plugins/ctf/common/metadata/ctf-meta.hpp" #include "query.hpp" struct tracer_info diff --git a/src/plugins/ctf/fs-src/metadata.cpp b/src/plugins/ctf/fs-src/metadata.cpp index ad215f9f..021512e8 100644 --- a/src/plugins/ctf/fs-src/metadata.cpp +++ b/src/plugins/ctf/fs-src/metadata.cpp @@ -18,7 +18,7 @@ #include "common/assert.h" -#include "../common/metadata/decoder.hpp" +#include "../common/src/metadata/tsdl/decoder.hpp" #include "file.hpp" #include "fs.hpp" #include "metadata.hpp" diff --git a/src/plugins/ctf/fs-src/query.cpp b/src/plugins/ctf/fs-src/query.cpp index fa73ab19..22f35106 100644 --- a/src/plugins/ctf/fs-src/query.cpp +++ b/src/plugins/ctf/fs-src/query.cpp @@ -19,7 +19,7 @@ #include "common/assert.h" -#include "../common/metadata/decoder.hpp" +#include "../common/src/metadata/tsdl/decoder.hpp" #include "fs.hpp" #include "metadata.hpp" #include "query.hpp" diff --git a/src/plugins/ctf/lttng-live/data-stream.cpp b/src/plugins/ctf/lttng-live/data-stream.cpp index 4bba7ddb..d749816c 100644 --- a/src/plugins/ctf/lttng-live/data-stream.cpp +++ b/src/plugins/ctf/lttng-live/data-stream.cpp @@ -13,17 +13,22 @@ #include -#include "plugins/ctf/common/metadata/decoder.hpp" - #define BT_COMP_LOG_SELF_COMP self_comp #define BT_LOG_OUTPUT_LEVEL log_level #define BT_LOG_TAG "PLUGIN/SRC.CTF.LTTNG-LIVE/DS" +#include +#include +#include +#include + +#include + #include "logging/comp-logging.h" #include "common/assert.h" #include "compat/mman.h" /* IWYU pragma: keep */ -#include "../common/msg-iter/msg-iter.hpp" +#include "../common/src/msg-iter/msg-iter.hpp" #include "data-stream.hpp" #define STREAM_NAME_PREFIX "stream-" diff --git a/src/plugins/ctf/lttng-live/lttng-live.hpp b/src/plugins/ctf/lttng-live/lttng-live.hpp index 9ca87401..d79cec7e 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.hpp +++ b/src/plugins/ctf/lttng-live/lttng-live.hpp @@ -16,7 +16,8 @@ #include -#include "../common/msg-iter/msg-iter.hpp" +#include "../common/src/metadata/tsdl/decoder.hpp" +#include "../common/src/msg-iter/msg-iter.hpp" #include "viewer-connection.hpp" enum lttng_live_stream_state diff --git a/src/plugins/ctf/lttng-live/metadata.cpp b/src/plugins/ctf/lttng-live/metadata.cpp index b081d639..46a11511 100644 --- a/src/plugins/ctf/lttng-live/metadata.cpp +++ b/src/plugins/ctf/lttng-live/metadata.cpp @@ -20,8 +20,9 @@ #include "compat/memstream.h" -#include "../common/metadata/ctf-meta-configure-ir-trace.hpp" -#include "../common/metadata/decoder.hpp" +#include "../common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp" +#include "../common/src/metadata/tsdl/decoder.hpp" +#include "lttng-live.hpp" #include "metadata.hpp" #define TSDL_MAGIC 0x75d11d57 -- 2.34.1