Simon Marchi [Thu, 25 Apr 2024 14:56:54 +0000 (14:56 +0000)]
.clang-tidy: add some checks
These checks seem reasonable, enable them.
Change-Id: I4ed416a9deee2385af38c305a125cd616ec94aa0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12482
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Philippe Proulx [Mon, 18 Mar 2024 21:20:34 +0000 (17:20 -0400)]
bt2::CommonEnumerationFieldClass::addMapping(): add missing static assertion
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie5a90126d0c25c92f00dce0af962f1e64048bdbc
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12481
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Philippe Proulx [Thu, 25 Apr 2024 04:05:09 +0000 (00:05 -0400)]
cpp-common/bt2c/logging.hpp: remove no-formatting ("str") alternatives
This patch removes everything named bt2c::Logger::log*Str*() and
BT_CPPLOG*STR*().
The no-formatting versions existed to avoid a call to fmt::format_to()
when you need to log a literal string as is, without any formatting. It
was also useful to pass a user string as is.
However, in the end, I don't think such an optimization is necessary:
• We don't use the no-formatting versions that much compared to messages
with a format string.
• fmt::format_to() is pretty fast without any replacement field.
• We're talking about logging performance.
• This patch removes a lot of often redudant code from `logging.hpp`.
Adapt the current no-formatting logging calls accordingly.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie02ea492e220c7ce9b72aaf8728fb7d2211e0bc0
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12479
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Philippe Proulx [Wed, 24 Apr 2024 21:11:48 +0000 (17:11 -0400)]
Fix: cpp-common/bt2c/logging.hpp: add missing `template` keyword
In very specific contexts, it's possible that a `bt2c::Logger` reference
is a dependent type, for example:
template <typename T>
struct X
{
const bt2c::Logger& logger() const noexcept
{
return /* some logger reference */;
}
void log()
{
BT_CPPLOGI_SPEC(this->logger(), "Hello!");
}
};
In that case, the BT_CPPLOGI_SPEC() macro eventually expands to
something like:
this->logger().log<bt2c::Logger::Level::Info,
false>(__FILE__, __func__, __LINE__, "Hello!");
`this->logger()` is basically `X<T>::logger()`. Therefore, from the
log() method template point of view, the type of `this` depends on `T`,
that is, it's a dependent name. This example above won't build.
In that case, we need the `template` keyword to call the method:
this->logger().template log<bt2c::Logger::Level::Info,
false>(__FILE__, __func__,
__LINE__, "Hello!");
Using the `template` keyword or not would normally be a per-call
decision, but those BT_CPPLOG*() macros do the call themselves.
Knowing this, this patch adds the `template` keyword to all the logging
method calls from the BT_CPPLOG*() macros, just in case.
The current project builds because it doesn't have this specific
situation, but it could happen in the future.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I2847105746825d94cf71ed3abbd56fac0f160a2d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12477
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Philippe Proulx [Wed, 24 Apr 2024 07:00:19 +0000 (03:00 -0400)]
Keep a single `.gitignore` file
We have a few arbitrary directory-specific `.gitignore` files and I'd
like to keep things consistent here: either dedicated `.gitignore` files
or a single root `.gitignore` file.
Choose the latter as it's simpler to maintain.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ib679a19cd20adb0034860073e04388d7d6e084f6
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12471
Philippe Proulx [Wed, 24 Apr 2024 06:51:27 +0000 (02:51 -0400)]
.gitignore: categorize rules and sort them per category
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I4a80709271b189469ba6b3869410ff41196ae551
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12470
Philippe Proulx [Wed, 24 Apr 2024 06:30:52 +0000 (02:30 -0400)]
.gitignore: ignore all `*.egg-info`
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I804bbb158ba2ccb5dbe326b4eb12d5e13d06c62a
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12469
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Philippe Proulx [Wed, 24 Apr 2024 06:30:20 +0000 (02:30 -0400)]
.gitignore: ignore all `/src/plugins/ctf/[...]/tsdl/parser.*pp`
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I3d8e45d6a8482552d11c7292ddcdb21514e683b9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12468
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Philippe Proulx [Wed, 24 Apr 2024 06:28:33 +0000 (02:28 -0400)]
.gitignore: ignore all `/src/cli/*.bin`
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie1c0138d2a1d766c386b4c237545b21a9903c027
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12467
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Philippe Proulx [Wed, 24 Apr 2024 06:25:33 +0000 (02:25 -0400)]
.gitignore: cleanup test files
Given that, under the `tests` directory:
✔ All shell file names end with `.sh`.
✔ All C file names end with `.c` or `.h`.
✔ All C++ file names end with `.cpp` or `.hpp`.
✔ No Python file name contains `-`.
Then it's safe to ignore everything named `test-` except the files of
which the name ends with one of the extensions above.
Also sort the list of remaining specific file names.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I2a4d541bd9624ed48051c944789c0b5f075a917b
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12466
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Simon Marchi [Wed, 24 Apr 2024 19:45:50 +0000 (15:45 -0400)]
tests: test_dwarf.c: initialize `tag` variable
On Arch Linux, When configuring with:
$ /home/smarchi/src/babeltrace/configure CFLAGS='-O2 -flto=auto' LDFLAGS='-flto=auto'
I get:
CCLD test_dwarf
In function 'test_bt_dwarf',
inlined from 'main' at /home/smarchi/src/babeltrace/tests/plugins/flt.lttng-utils.debug-info/test_dwarf.c:163:2:
/home/smarchi/src/babeltrace/tests/plugins/flt.lttng-utils.debug-info/test_dwarf.c:136:9: error: 'tag' may be used uninitialized [-Werror=maybe-uninitialized]
136 | ok(tag == DW_TAG_typedef, "bt_dwarf_die_get_tag - correct tag value");
| ^
/home/smarchi/src/babeltrace/tests/plugins/flt.lttng-utils.debug-info/test_dwarf.c: In function 'main':
/home/smarchi/src/babeltrace/tests/plugins/flt.lttng-utils.debug-info/test_dwarf.c:79:22: note: 'tag' was declared here
79 | int fd, ret, tag;
| ^
Indeed, `tag` is not set if `bt_dwarf_die_get_tag()` fails, and I
suppose that LTO is able to "see" through the function call, despite the
implementation being in another compilation unit.
Fix this by initializing `tag` to an invalid DIE tag value.
For some reason, I only see this error on the stable-2.0 branch, not on
master. But I think it wouldn't hurt to merge this patch to both master
and stable-2.0.
I caught this when trying to build the 2.0.6 release as an Arch package,
using the official PKGBUILD as a base.
[1] https://gitlab.archlinux.org/archlinux/packaging/packages/babeltrace2/-/blob/
d6c58a3a8e0dbbbac7424dec28212f0fd1720eb7/PKGBUILD
Change-Id: I5475efdf095511404ecf8a214ab33358b41230fa
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12473
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 17 Apr 2024 17:45:47 +0000 (13:45 -0400)]
cpp-common/bt2c: remove `dummy.cpp`
There is another source file (file-utils.cpp), so dummy.cpp is no longer
needed.
Change-Id: I7429a005c49498d6d2e500c5afe4b3d07640d654
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12413
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Philippe Proulx [Tue, 23 Apr 2024 17:02:48 +0000 (13:02 -0400)]
.gitignore: add missing test binaries
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie78f6483a0e3810535ed8611d4cb033ca96b9b4b
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12457
Philippe Proulx [Tue, 23 Apr 2024 17:07:55 +0000 (13:07 -0400)]
bt2c/logging.hpp: use `std::span<const std::uint8_t>` for mem. data
`std::span<const std::uint8_t>` is also the `bt2c::Logger::MemData`
alias.
Adapt `src/plugins/ctf/common/src/msg-iter/msg-iter.cpp` accordingly.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I553c0bbb0fb532bd23506a9760155371820e773d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12456
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Philippe Proulx [Tue, 23 Apr 2024 16:50:13 +0000 (12:50 -0400)]
CONTRIBUTING.adoc: mention bt2c::makeSpan()
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I6b5340fd353cbd4ef40f9e75322588842f10a788
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12455
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Philippe Proulx [Tue, 23 Apr 2024 16:49:05 +0000 (12:49 -0400)]
src/cpp-common/bt2c: rename `span.hpp` -> `make-span.hpp`
bt2c::makeSpan() is the only thing `make-span.hpp` offers.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I3a4a9cb0712cc97d11e9c9adf26f77539f5bb76c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12454
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Philippe Proulx [Tue, 23 Apr 2024 16:40:57 +0000 (12:40 -0400)]
CONTRIBUTING.adoc: "make_unique" -> "make-unique"
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I2528ff4bfbb0cb101e34373d36a50b4b27100f1c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12453
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Philippe Proulx [Tue, 23 Apr 2024 16:15:12 +0000 (12:15 -0400)]
cpp-common/bt2c/logging.hpp: use camel case for param. names
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I1d73559b1512d60d9e0ed87870cb8f375138e3d0
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12452
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Philippe Proulx [Tue, 23 Apr 2024 16:13:07 +0000 (12:13 -0400)]
bt2c::Logger: make `Level` enumerators more readable
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I7f69a587af353446a25392684b85939afe8d1210
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12451
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Simon Marchi [Tue, 23 Apr 2024 03:44:04 +0000 (23:44 -0400)]
tests: LD_PRELOAD libstdc++.so in bt_run_in_py_env
With an ASan build on Debian 12 or Ubuntu 22.04 (and probably others),
some tests (test-query-trace-info.sh, test-python-bt2.sh), fail because
of what boils down to this:
$ /home/smarchi/src/babeltrace/tests/utils/run-in-py-env.sh python3 /home/smarchi/src/babeltrace/tests/plugins/src.ctf.fs/query/test_query_trace_info.py
..AddressSanitizer: CHECK failed: asan_interceptors.cpp:320 "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0) (tid=139166)
#0 0x7fc2bbf9b2aa in CheckUnwind ../../../../src/libsanitizer/asan/asan_rtl.cpp:67
#1 0x7fc2bbfbbc55 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:86
#2 0x7fc2bbf22924 in __interceptor___cxa_throw ../../../../src/libsanitizer/asan/asan_interceptors.cpp:320
#3 0x7fc2b8f5ea05 in void bt2c::Logger::logErrorAndThrow<true, bt2c::Error, char*&>(char const*, char const*, unsigned int, char const*, char*&) const /home/smarchi/src/babeltrace/src/cpp-common/bt2c/logging.hpp:316
#4 0x7fc2b8f5ea05 in read_src_fs_parameters(bt2::CommonMapValue<bt_value const>, bt2c::Logger const&) /home/smarchi/src/babeltrace/src/plugins/ctf/fs-src/fs.cpp:1516
#5 0x7fc2b903e4ca in trace_infos_query(bt2::CommonMapValue<bt_value const>, bt2c::Logger const&) /home/smarchi/src/babeltrace/src/plugins/ctf/fs-src/query.cpp:168
#6 0x7fc2b9019206 in ctf_fs_query(bt_self_component_class_source*, bt_private_query_executor*, char const*, bt_value const*, void*, bt_value const**) /home/smarchi/src/babeltrace/src/plugins/ctf/fs-src/fs.cpp:1609
#7 0x7fc2b980eed0 in bt_query_executor_query /home/smarchi/src/babeltrace/src/lib/graph/query-executor.c:221
#8 0x7fc2ba2d8c86 in _wrap_query_executor_query bt2/native_bt.c:19262
#9 0x5458a2 in cfunction_vectorcall_O ../Objects/methodobject.c:514
... lots of Python stack frames ...
#75 0x64f90e in pymain_run_file_obj ../Modules/main.c:360
#76 0x64f90e in pymain_run_file ../Modules/main.c:379
#77 0x64f90e in pymain_run_python ../Modules/main.c:601
#78 0x64f90e in Py_RunMain ../Modules/main.c:680
#79 0x6275c6 in Py_BytesMain ../Modules/main.c:734
#80 0x7fc2bbbf0249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#81 0x7fc2bbbf0304 in __libc_start_main_impl ../csu/libc-start.c:360
#82 0x627460 in _start (/usr/bin/python3.11+0x627460)
The problem is documented here [1].
The summary is (to the best of my understanding):
- we run python3 with a script that imports the bt2 Python module,
which eventually loads libbabeltrace2.so
- libbabeltrace2.so is built with ASan, so depends on libasan.so
- if we just try to run this as is, libasan.so complains that it's not
the first loaded shared library, so we LD_PRELOAD it
- now, when libasan.so is initialized, libstdc++ is not loaded, so some
things related to C++ (like the __interception::real___cxa_throw
variable) are not initialized
- libbabeltrace2.so and libstdc++.so are eventually loaded, something
in the test happens to throw an exception
- this is intercepted by libasan.so (through symbol interposition of
__cxa_throw I suppose)
- the assertion that real___cxa_throw must not be NULL fails
Debian and Ubuntu systems are affected because of their use of
-Wl,--as-needed. The build system of ASan makes libasan.so link against
libstdc++ (to ensure that libstdc++ is loaded along with libasan.so),
but that dependency is dropped du to -Wl,--as-needed.
A solution I used during development (and this is why I failed to see
the problem sooner I suppose) was to add a libstdc++ dependency in
/usr/bin/python3. This is obviously not possible at large.
The only applicable solution I see to keep ASan builds working is to
LD_PRELOAD libstdc++.so along with libasan.so. This emulates the
missing libasan.so -> libstdc++.so dependency.
[1] https://github.com/google/sanitizers/issues/934
Change-Id: I10c53347167a7f68cb2fb2e8c08a98ff2b638ffc
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12446
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 17:00:23 +0000 (17:00 +0000)]
src.ctf.lttng-live: remove some goto error-handling
Change-Id: I9b6d967d54c63d7f7544bb0d1a1eb778a8df64d4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12396
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 26 Mar 2024 19:47:31 +0000 (15:47 -0400)]
src.ctf.lttng-live: viewer-connection.cpp: remove goto error-handling
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I87b05835a268fef92f906c16bb35a84c1df0a27f
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8485
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12395
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 16:36:41 +0000 (16:36 +0000)]
src.ctf.lttng-live: use viewer_connection_close_socket more
Use viewer_connection_close_socket at all spots we close the control
socket, to de-duplicate code a little bit.
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I47ce5bf00edd367792a8f8262d746a61b0c474fd
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8484
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12394
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 12 Dec 2023 16:32:37 +0000 (16:32 +0000)]
src.ctf.lttng-live: make queries report errors with exceptions
Change-Id: Ibf633312304a6353842baa569860a2e1216785b0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8478
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12393
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 16:12:49 +0000 (16:12 +0000)]
src.ctf.lttng-live: make queries output a bt2::Value
Change-Id: If0baec1ca712e75e5873cc6c3e88cec18bb4f424
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8477
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12392
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 12 Dec 2023 16:28:06 +0000 (16:28 +0000)]
src.ctf.lttng-live: use C++ value wrappers for query parameters
Change-Id: Ie64cef32650dbc62238429b10c30a0c8ffd5dac3
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8476
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12391
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 2 Nov 2023 18:57:32 +0000 (18:57 +0000)]
src.ctf.lttng-live: add bt_common_lttng_live_url_parts_deleter
bt_common_lttng_live_url_parts can't be made a C++ object that
automatically manages its memory yet, since it's used in
babeltrace2-cfg-cli-args.c (C code). Add an RAII type in lttng-live to
automatically call bt_common_destroy_lttng_live_url_parts in two places.
Change-Id: I233a5ba5a2829f4577c4ebbcc1ab0e630d039174
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8475
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12390
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 15:53:32 +0000 (15:53 +0000)]
src.ctf.lttng-live: introduce lttng_live_msg_iter::UP and use it
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: Ie87efb7a6599a738dad60cc3533f8440c283da6c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8474
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12389
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 15:49:29 +0000 (15:49 +0000)]
src.ctf.lttng-live: add lttng_live_msg_iter destructor
Convert lttng_live_msg_iter_destroy to a destructor.
Change-Id: I4bd28e540517e11ede6c210c7645db98951c31f8
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8473
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12388
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 11 Dec 2023 18:35:07 +0000 (13:35 -0500)]
src.ctf.lttng-live: introduce live_viewer_connection::UP and use it
Change lttng_live_msg_iter::viewer_connection to be a
live_viewer_connection::UP and convert live_viewer_connection_create's
output parameter to that type.
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I0f91d4636c67ad9f820783932fa3c45464dfb3bb
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8472
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12387
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 15:37:16 +0000 (15:37 +0000)]
src.ctf.lttng-live: add live_viewer_connection destructor
Convert live_viewer_connection_destroy into a destructor.
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I84651d6a2184c75b61667ebf23c28737e5a227c5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8471
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12386
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 29 Jan 2024 21:15:18 +0000 (16:15 -0500)]
src.ctf.lttng-live: make live_viewer_connection::{relay_hostname,target_hostname,session_name,proto} GStringUPs
These values come from GStrings from the common code, not yet C++-ified,
so it's simpler for now to use GStringUP to automatically manage the
GString lifetimes locally. If the common code ever becomes C++, it can
all be replaced with std::string.
Change-Id: I913ab51488fc934cd049e530a2b7583cc1cefff6
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8470
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12385
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Fri, 2 Feb 2024 17:46:38 +0000 (17:46 +0000)]
src.ctf.lttng-live: make live_viewer_connection::url an std::string
Change-Id: I863b77f2b109312809df088adf374461550aac88
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8469
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12384
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 10 Apr 2024 15:49:14 +0000 (11:49 -0400)]
src.ctf.lttng-live: make lttng_live_msg_iter::sessions an std::vector
Change-Id: I1c6f23eb1cad89d431699b07ce68673ae9f19963
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8468
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12383
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 05:28:24 +0000 (05:28 +0000)]
src.ctf.lttng-live: introduce lttng_live_session::UP and use it
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: Ie270049fe8923f7608f372de4b459b645806367e
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8467
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12382
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 05:24:55 +0000 (05:24 +0000)]
src.ctf.lttng-live: add lttng_live_session destructor
Convert lttng_live_destroy_session to a destructor. Add a new
lttng_live_destroy_session function that calls delete, it's still needed
for the GPtrArray (which will be removed in a subsequent patch).
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: Icb2d9c33fb3591e206698b37c9d658ff731184ad
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8466
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12381
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 05:21:54 +0000 (05:21 +0000)]
src.ctf.lttng-live: make lttng_live_session::{hostname,session_name} std::strings
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I5b0dd1b99d741042b0b2b37a48251ea96d4b3d4f
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8464
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12380
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 05:18:01 +0000 (05:18 +0000)]
src.ctf.lttng-live: make lttng_live_session::traces an std::vector
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I3b8ec1e61929fad1e024955dcfc6708cb125b5c9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8463
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12379
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 05:14:35 +0000 (05:14 +0000)]
src.ctf.lttng-live: introduce lttng_live_trace::UP and use it
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I0008ee962a004ac6e215a5ed32c15b6367fb245b
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8462
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12378
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 05:09:24 +0000 (05:09 +0000)]
src.ctf.lttng-live: make lttng_live_trace::stream_iterators an std::vector
Change-Id: I745900032bc5d880a305e434afaeaeaef728708d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8461
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12377
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 11 Dec 2023 17:26:46 +0000 (12:26 -0500)]
src.ctf.lttng-live: introduce and use lttng_live_stream_iterator::UP
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I50c0db7fb4a86d5081a3c049e1dc76b6311507aa
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8460
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12376
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 04:55:31 +0000 (04:55 +0000)]
src.ctf.lttng-live: add lttng_live_stream_iterator destructor
lttng_live_stream_iterator_destroy is still used for a GPtrArray, so it
is kept as a wrapper to the destructor for now.
Change-Id: Idc3fb90f2b15f44d92d9edd578783f4939474fdf
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8459
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12375
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 10 Apr 2024 14:58:05 +0000 (10:58 -0400)]
src.ctf.lttng-live: make lttng_live_stream_iterator::current_msg a bt2::Message::Shared
Adjust a bunch of related functions involved in creating the message
that ends up there.
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I2dabd3b3e6d0d17ee2a23774863b160505a0b830
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8458
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12374
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 10 Apr 2024 14:47:21 +0000 (10:47 -0400)]
ctf: remove tabs used for indentation
These are leftovers from commit
4164020e790f ("Re-format new C++
files").
Change-Id: I3a3dbda6c983308c1403c3649913a6311f3bc113
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12373
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Simon Marchi [Mon, 11 Dec 2023 17:26:30 +0000 (12:26 -0500)]
src.ctf.lttng-live: make lttng_live_stream_iterator::name an std::string
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I515319dc62f147e4423c9eadd3dc00648e46e789
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8457
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12372
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 04:33:59 +0000 (04:33 +0000)]
src.ctf.lttng-live: make lttng_live_stream_iterator::buf an std::vector
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I944475345ed8dd5b1ae2824eb86cf9ead56cd92f
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8456
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12371
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 04:29:47 +0000 (04:29 +0000)]
src.ctf.lttng-live: make lttng_live_stream_iterator::msg_iter a ctf_msg_iter_up
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I603a9daa109ebab118fe72e38ac175a7f7006335
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8455
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12370
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 04:26:25 +0000 (04:26 +0000)]
src.ctf.lttng-live: make lttng_live_stream_iterator::stream a bt2::Stream::Shared
Change-Id: Ia38f2feba1040749df692574e67861c81a73e8df
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8454
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12369
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 04:20:49 +0000 (04:20 +0000)]
src.ctf.lttng-live: introduce lttng_live_metadata::UP and use it
Change-Id: I3f902be075b8274485b6ce88b1b7fa1617e79cff
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8453
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12368
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Fri, 2 Feb 2024 16:50:30 +0000 (16:50 +0000)]
src.ctf.lttng-live: introduce lttng_live_component::UP and use it
Change-Id: I1bdc817239fbba02fae9696e51559daa6b1b43b9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8452
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12367
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 20:00:11 +0000 (20:00 +0000)]
src.ctf.lttng-live: use GCharUP in lttng_live_component_create
Change-Id: Ieffb41481d6696c46fd51483414a59fae1099ede
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8451
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12366
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 22 Jun 2022 20:07:03 +0000 (16:07 -0400)]
src.ctf.lttng-live: remove lttng_live_component_destroy_data
Change-Id: I9e57187adcaba990c1f48885cc6e8e94f96c0ac3
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8450
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12364
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 7 Dec 2023 03:47:54 +0000 (03:47 +0000)]
src.ctf.lttng-live: change lttng_live_component::params::url to std::string
Change-Id: I5b5c7c15e99bd9cc79c5e20ea68326a244490ce8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8449
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12363
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 6 Dec 2023 21:34:54 +0000 (21:34 +0000)]
src.ctf.fs: make create_streams_for_trace use bt2::StreamClass to instantiate streams
Wrap the stream class (ds_file_group->sc->ir_sc) in a bt2::StreamClass,
then use that to instantiate streams.
Change-Id: I9e9917dd96b0d1115b443463a0a2cd8f2da42323
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8437
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12362
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 6 Dec 2023 21:31:48 +0000 (21:31 +0000)]
src.ctf.fs: pass path to ctf_fs_ds_index_entry constructor
Change-Id: Id8c29f502cc126775e2ded67813a6f8714f06705
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8436
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12361
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 10 Apr 2024 03:31:37 +0000 (23:31 -0400)]
src.ctf.fs: remove ctf_fs_ds_file_group_create, add constructor
Replace ctf_fs_ds_file_group_create with an equivalent constructor.
Change-Id: I06d69a05ba685552dc2d6b78800d79f20569a340
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8435
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12360
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 21:10:29 +0000 (17:10 -0400)]
src.ctf.fs: change a pointer parameter to a reference, remove unused parameter
- Change add_range's range parameter to a const ref.
- Remove the output parameter of populate_stream_info, its caller
doesn't use it.
Change-Id: I9d9268b3f3e6f6446b2422e9bfb098359c71da02
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8425
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12359
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 6 Dec 2023 19:43:34 +0000 (19:43 +0000)]
ctf: convert ctx_destroy to ~ctf_visitor_generate_ir
Convert ctx_destroy into a destructor for ctf_visitor_generate_ir.
Change-Id: I7963276587e44621381c3b47a734986c1696df64
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8423
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12358
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 20:46:55 +0000 (16:46 -0400)]
src.ctf.fs: pass clkClsCfg to ctf_fs_component constructor
Change-Id: I3a9d696780d044505d273a28804915bf2f9e9c16
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8422
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12357
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 12 Dec 2023 15:44:58 +0000 (15:44 +0000)]
src.ctf.fs: modernize read_src_fs_parameters
- Change the input parameter `params` to be bt2::ConstMapValue.
- Changethe return type to be of a new structure type containing all
processed parameters, rather than using output parameters and rather
than setting the clkClsCfg inside the ctf_fs object directly.
- Change the type of the parameters of
ctf_fs_component_create_ctf_fs_trace and other helper functions
accordingly.
Change-Id: I2ba5aca22f907ffcfbdd19c8d8077e17d0c47a71
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8421
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12356
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Sun, 19 Jun 2022 03:47:39 +0000 (23:47 -0400)]
src.ctf.fs: change two functions to take ctf_fs_ds_index by reference
Change-Id: I76211e8fb321b87618cccb23e547982b80535c91
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8419
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12355
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 29 Jan 2024 17:05:23 +0000 (17:05 +0000)]
src.ctf.fs: make set_trace_name use bt2::Trace
Add an out-of-class `operator+=` to append a `bt2c::CStringView` to an
`std::string`. Without it, I get:
CXX plugins/ctf/fs-src/fs.lo
/home/simark/src/babeltrace/src/plugins/ctf/fs-src/fs.cpp: In function 'void set_trace_name(bt2::Trace, const char*)':
/home/simark/src/babeltrace/src/plugins/ctf/fs-src/fs.cpp:598:14: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'bt2::CommonStringValue<const bt_value>::Value' {aka 'bt2c::CStringView'})
598 | name += val->asString().value();
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13.2.1/string:54,
from /usr/include/c++/13.2.1/bits/locale_classes.h:40,
from /usr/include/c++/13.2.1/bits/ios_base.h:41,
from /usr/include/c++/13.2.1/ios:44,
from /usr/include/c++/13.2.1/istream:40,
from /usr/include/c++/13.2.1/sstream:40,
from /home/simark/src/babeltrace/src/plugins/ctf/fs-src/fs.cpp:10:
/usr/include/c++/13.2.1/bits/basic_string.h:1354:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1354 | operator+=(const basic_string& __str)
| ^~~~~~~~
/usr/include/c++/13.2.1/bits/basic_string.h:1364:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1364 | operator+=(const _CharT* __s)
| ^~~~~~~~
Change-Id: I3f47878658a431f81a129fc9e644efe50608e7ce
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8418
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12354
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 11 Dec 2023 17:25:19 +0000 (12:25 -0500)]
ctf: make ctf_trace_class_configure_ir_trace use bt2::Trace
Use the bt2::Trace wrapper instead of a raw `bt_trace *`. Change the
return type to void, since failures are now reported using exceptions.
Change-Id: I2e30b0aa9a6f33e765ac32d274032ef4ab3aa9f8
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8417
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12353
Tested-by: jenkins <jenkins@lttng.org>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Simon Marchi [Wed, 6 Dec 2023 17:29:01 +0000 (17:29 +0000)]
src.ctf.lttng-live: make lttng_live_trace::trace a bt2::Trace::Shared
Use the C++ wrapper to hold the reference to the trace.
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: Iadfe9add10e5a6e3112cc0626b2ece868a013b40
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8416
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12352
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 6 Dec 2023 17:20:21 +0000 (17:20 +0000)]
src.ctf.lttng-live: make lttng_live_trace::trace_class a bt2::TraceClass::Shared
Use the C++ wrapper to hold the reference to the trace class.
Note that the existing comment said it is a weak reference, but the code
shows otherwise.
Change-Id: Ic486a65ab40953c5d6a3ddb7d057d2caa85cf1c0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8415
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12351
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Sun, 19 Jun 2022 02:50:16 +0000 (22:50 -0400)]
src.ctf.lttng-live: use std::string in list_append_session
Use `fmt::format` to create a temporary `std::string`.
Change-Id: I2a930cff82e4f43ff303f62a7371eb67d8144c04
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8414
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12350
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 6 Dec 2023 17:13:14 +0000 (17:13 +0000)]
src.ctf.lttng-live: use std::vector in lttng_live_get_one_metadata_packet
Use an std::vector to manage the buffer used to store the received data.
Change-Id: I04f99440573c722d982378ef9d8bb47f35b343aa
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8413
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12349
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 6 Dec 2023 17:10:22 +0000 (17:10 +0000)]
src.ctf.lttng-live: lttng_live_metadata_update: use std::vector as metadata buffer
Use an std::vector to store the metadata contents in
lttng_live_metadata_update, instead of opening a memstream. Modify
lttng_live_get_one_metadata_packet to append to a vector instead of
writing to a `FILE *`. We still open a read-only memstream around the
vector's contents to pass a `FILE *` to
ctf_metadata_decoder_append_content. Change that variable to be a
FileUP, so it's automatically closed on exit.
Change-Id: Ie7b57d25ea90fc82fb96bf19ff707edccdf46072
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8412
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12348
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Fri, 17 Jun 2022 20:55:30 +0000 (16:55 -0400)]
src.ctf.fs: make ds_file_group_insert_ds_file_info_sorted a method of ctf_fs_ds_file_group
Change-Id: I743359a80d39e307f4aa36b2deaa92429c536cea
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8404
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12347
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 21:10:11 +0000 (17:10 -0400)]
src.ctf.fs: fs.cpp: declare variables on first use
Move variable declarations to be at or closer to their first use.
Change-Id: Iec7b1789a9cd007938b992292ad48a09d23f79e5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8403
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12346
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 11 Dec 2023 19:23:19 +0000 (14:23 -0500)]
src.ctf.fs: data-stream-file.cpp: declare variables on first use
Move variables declarations to be at or closer to their first use.
Change-Id: I0649c4fda3b42c6bca02217481c08b575fda6a5d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8402
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12345
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 19:44:48 +0000 (15:44 -0400)]
src.ctf.fs: remove ctf_fs_ds_index::UP
We don't need to dynamically allocate ctf_fs_ds_index objects, we can
store / return / pass objects directly. Remove ctf_fs_ds_index::UP and
update all users.
Change-Id: I7ce9de83b111c782299a1caebea3ead0fd945cb5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8401
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12344
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 6 Dec 2023 16:15:18 +0000 (16:15 +0000)]
src.ctf.fs: store index entry objects instead of pointers
Store `ctf_fs_ds_index_entry` objects in a flag vector, instead of a
vector of pointers.
Change-Id: I4fea078cddf97292cc1f040ca998acef465d6808
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8348
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12343
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Wed, 6 Dec 2023 15:52:10 +0000 (15:52 +0000)]
src.ctf.fs: remove ctf_fs_ds_index_entry_create
This function is now a simple wrapper around constructing a
ctf_fs_ds_index_entry, remove it.
Change-Id: I20905864876588f7e6db79b6b344833275131871
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8347
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12342
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 13 Jun 2022 16:47:53 +0000 (12:47 -0400)]
src.ctf.fs: initialize ctf_fs_ds_index_entry::packet_seq_num to UINT64_MAX in class
Initialize the field directly to the right value. The field was
originally initialized to 0 to mimic the g_new0 behavior.
Change-Id: Ia1df1be730b77ca0d69ae05dae12bd60ef9e9ed8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8346
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12341
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Fri, 2 Feb 2024 17:33:00 +0000 (17:33 +0000)]
src.ctf.fs: remove goto error handling from data-stream-file.cpp
Same as previous patch, but for data-stream-file.cpp.
Change-Id: Ieb52faca6142ff33591fce2d880bcde664f2c1b7
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8320
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12340
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 21:09:47 +0000 (17:09 -0400)]
src.ctf.fs: remove goto error handling from fs.cpp
gotos prevent declaring variables in the middle of functions, which is
sometimes necessary in C++. Remove gotos used for error handling,
replace them with returning directly.
Change-Id: I15b5d6aa4897e5326fc03e2626045c83258d8eca
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8318
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12339
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:52:55 +0000 (05:52 +0000)]
src.ctf.fs: use GMappedFileUP in build_index_from_idx_file
Change-Id: I24d4cf509839923e704870953b6c9fb379cf1880
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8312
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12338
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:50:32 +0000 (05:50 +0000)]
src.ctf.fs: use std::string in build_index_from_idx_file
Change-Id: Ifdb2c818f66efbc328b095408ae2834646fba4fe
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8310
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12337
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:46:56 +0000 (05:46 +0000)]
src.ctf.fs: use GCharUP in build_index_from_idx_file
Change-Id: Ifb4e1b3ac7d484af2d570d75cff21e310f752add
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8309
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12336
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:43:19 +0000 (05:43 +0000)]
src.ctf.fs: remove ctf_fs_ds_index_create
Remove ctf_fs_ds_index_create, since it's now just a wrapper around
constructing a ctf_fs_ds_index.
Change-Id: Ia256fde3286f3f77a514835806f8862678e02359
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8308
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12335
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 21:08:57 +0000 (17:08 -0400)]
src.ctf.fs: remove ctf_fs_component_create
Remove this function, as it's now a simple wrapper around constructing a
ctf_fs_component.
Change-Id: Ifc6c751ff66f43c81c1a0abd6d7b27393b96f4ad
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8307
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12334
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 11 Dec 2023 17:24:27 +0000 (12:24 -0500)]
src.ctf.fs: remove ctf_fs_file_create
Remove this function, it's now just a wrapper around constructing a
ctf_fs_file.
Change-Id: I95e4d6eb26b0d359e0f480cac51af11f3a1db539
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8297
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12333
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 21:08:37 +0000 (17:08 -0400)]
src.ctf.fs: make ctf_fs_make_port_name return std::string
Change-Id: I9e2f4d2ac47e4f061e5dda1a3813d1a092ffe433
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8296
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12332
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:28:25 +0000 (05:28 +0000)]
src.ctf.fs: use GDirUp in create_ds_file_groups
Change-Id: I0d0ca566d8123e8419a9345f78224f92f17e9a47
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8295
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12331
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:25:32 +0000 (05:25 +0000)]
src.ctf.fs: use std::vector<std::string> in ctf_fs_component_create_ctf_fs_trace
Change-Id: I51af73cb2bdaf10318b19aa493129bdb8401cc3b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8293
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12330
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 9 Jun 2022 15:32:46 +0000 (11:32 -0400)]
src.ctf.fs: use std::string in path_is_ctf_trace
Change-Id: I796d135f7daee29a4481e61cf073e8bbd2e0f05f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8292
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12329
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:19:53 +0000 (05:19 +0000)]
src.ctf.fs: use std::string in set_trace_name
Change-Id: Ib44748ebda40b197d5ef0ca20d23b55496c3e918
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8291
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12328
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 21:08:19 +0000 (17:08 -0400)]
src.ctf.fs: make get_stream_instance_unique_name return `const std::string &`
We always return the first stream's name. Return a reference to that
name instead of a new object and a copy of the string.
Change-Id: I657265b74e0566a36f2ae05f6b5b1b6d21f53c66
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8290
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12327
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:12:00 +0000 (05:12 +0000)]
src.ctf.fs: use GStringUP in ctf_fs_component_create_ctf_fs_trace_one_path
Change-Id: I6405c80bdfc519fe45ebadadcfd2e396da9a74cb
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8289
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12326
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 05:09:22 +0000 (05:09 +0000)]
src.ctf.fs: remove ctf_fs_trace_destroy
Remove it and the custom deleter, since ctf_fs_trace instances can now
be simply deleted.
Change-Id: I59f3f89b4b3faee45b3708245242cee009d218b7
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8287
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12325
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 9 Jun 2022 15:19:30 +0000 (11:19 -0400)]
src.ctf.fs: make ctf_fs_trace::metadata a unique_ptr
Introduce ctf_fs_metadata::UP and change the ctf_fs_trace::metadata
field to be of that type.
Change-Id: I0221ef7786cc8fb4c2e8a9264573ab5c2e5420d6
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8286
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12324
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 2 Nov 2023 19:04:35 +0000 (19:04 +0000)]
src.ctf.fs: remove ctf_fs_metadata_init and ctf_fs_metadata_fini
Change-Id: Ie34c0a5c5aea60aa2fc771d35a39b61ec0eca336
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8285
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12323
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 04:57:52 +0000 (04:57 +0000)]
src.ctf.fs: make ctf_fs_metadata::trace_class a bt2::TraceClass::Shared
Change-Id: I1ee6a21525757197213c35acfa1f0a17d7052541
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8284
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12322
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Mon, 11 Dec 2023 17:24:09 +0000 (12:24 -0500)]
src.ctf.fs: make ctf_visitor_generate_ir::trace_class a bt2::TraceClass::Shared
Change-Id: I9b414384b025f39c3cfb9900659235a17426b649
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8283
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12321
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Thu, 9 Jun 2022 15:05:38 +0000 (11:05 -0400)]
src.ctf.fs: remove ctf_fs_metadata::text
Change-Id: Id15010c2d5c1f9fccd60adfb0920b1dca2f2074b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8282
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12320
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 04:44:06 +0000 (04:44 +0000)]
src.ctf.fs: make ctf_fs_trace::path an std::string
Change-Id: I9938c37f4effca7e83ed2e495feb5dd596d2320e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8281
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12319
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 04:40:07 +0000 (04:40 +0000)]
src.ctf.fs: make ctf_fs_trace::trace a bt2::Trace::Shared
Change-Id: I4fabe113da7b5adb794377706ab07fac9b59df02
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8280
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12318
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 9 Apr 2024 20:30:19 +0000 (16:30 -0400)]
src.ctf.fs: introduce and use ctf_fs_msg_iter_data::UP
Introduce ctf_fs_msg_iter_data::UP and use it in ctf_fs_iterator_init
and ctf_fs_iterator_finalize.
Change-Id: I448cedc164d93f9ba26da5640578889b0fff580c
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8279
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12317
Tested-by: jenkins <jenkins@lttng.org>
Simon Marchi [Tue, 5 Dec 2023 04:29:51 +0000 (04:29 +0000)]
src.ctf.fs: use ctf_msg_iter_up in decode_clock_snapshot_after_event
Change-Id: I4f230d16b96764d5097cb30b8a063d41268bb237
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8278
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12316
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.049556 seconds and 4 git commands to generate.