lttng-tools.git
2 months agoTests: test_session: fix conditionally-supported offsetof warning
Jérémie Galarneau [Thu, 5 Sep 2024 19:25:34 +0000 (19:25 +0000)] 
Tests: test_session: fix conditionally-supported offsetof warning

g++ produces the following warning when building test_session on the CI:

  /home/jenkins/workspace/dev_review_lttng-tools_master_linuxbuild/babeltrace_version/stable-2.0/build/std/conf/std/liburcu_version/stable-0.14/platform/deb12-amd64/deps/build/include/urcu/list.h:160:49: warning: ‘offsetof’ within non-standard-layout type ‘ltt_session’ is conditionally-supported [-Winvalid-offsetof]
     160 |         for (pos = cds_list_entry((head)->next, __typeof__(*(pos)), member); \
   /home/jenkins/workspace/dev_review_lttng-tools_master_linuxbuild/babeltrace_version/stable-2.0/build/std/conf/std/liburcu_version/stable-0.14/platform/deb12-amd64/deps/build/include/urcu/list.h:126:49: note: in expansion of macro ‘caa_container_of’
     126 | #define cds_list_entry(ptr, type, member)       caa_container_of(ptr, type, member)
         |                                                 ^~~~~~~~~~~~~~~~

Replace the problematic liburcu macros with the C++-ified internal
replacement wrappers.

Change-Id: I1396e9f6e1d99710150e03cabc33d07df3d8558a
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agovendor/argpar: sync with upstream repository
Simon Marchi [Mon, 18 Mar 2024 18:42:10 +0000 (14:42 -0400)] 
vendor/argpar: sync with upstream repository

Sync with argpar, commit 88d1c8ae5c47 ("tap: import some changes").

Change-Id: I2338119ffa55391f836ed2bacc09360fc3f47217
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoUpdate fmtlib to 11.0.2 and use the built library
Jérémie Galarneau [Fri, 30 Aug 2024 22:24:15 +0000 (18:24 -0400)] 
Update fmtlib to 11.0.2 and use the built library

Change-Id: I51c80c7d1829604a035e84dac7d87a48bb6fe05b
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoClean-up: sessiond: logging typo hast -> hash
Jérémie Galarneau [Thu, 5 Sep 2024 16:04:12 +0000 (12:04 -0400)] 
Clean-up: sessiond: logging typo hast -> hash

The comment refers to hash tables, not The Hate Tables 🤘

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Idac6e7e5d9b4bebca9db9e3187ec33a4dd335ddf

2 months agoclang-format: run clang-format on the tree
Jérémie Galarneau [Thu, 5 Sep 2024 15:26:33 +0000 (11:26 -0400)] 
clang-format: run clang-format on the tree

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ifa81e86645655c1e4c1ee81375dad3ba45e850d1

2 months agoMove argpar to vendor directory
Simon Marchi [Mon, 18 Mar 2024 18:21:45 +0000 (14:21 -0400)] 
Move argpar to vendor directory

Since this is source copied as-is from another project, I think it
belongs to the vendor directory.  This will make it so it will be
skipped by format-cpp, for instance.

Change-Id: I78892f80c4cbb3a2e863567b0021e895c6489402
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoconfigure.ac: enable automake's subdir-objects option
Simon Marchi [Mon, 18 Mar 2024 18:39:26 +0000 (14:39 -0400)] 
configure.ac: enable automake's subdir-objects option

From [1]:

    subdir-objects

        If this option is specified, then objects are placed into the
        subdirectory of the build directory corresponding to the
        subdirectory of the source file. For instance, if the source file is
        subdir/file.cxx, then the output file would be subdir/file.o. See
        Program and Library Variables.

This will allow reducing the number of Makefiles, but placing rules in
Makefiles in parent directories, instead of having Makefiles in every
single directory with something that needs to be built.

[1] https://www.gnu.org/software/automake/manual/html_node/List-of-Automake-options.html

Change-Id: Ic0c6ee5d809dee6b9e560239abd15408b28d9695
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoTests: Remove unused helper `default_pipe_size_getter`
root [Wed, 28 Aug 2024 19:24:53 +0000 (19:24 +0000)] 
Tests: Remove unused helper `default_pipe_size_getter`

Change-Id: If72cb1456edbf26c340fcffdf93c8fb874ab030e
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoTests: Make notifier discard count test more robust
root [Wed, 28 Aug 2024 18:52:09 +0000 (18:52 +0000)] 
Tests: Make notifier discard count test more robust

Observed issue
==============

In the CI, this test would intermittently fail. During failures,
the calculated pipe size from the `default_pipe_size_getter`
application was 8192, while in other cases it was 65536.

```
ERROR: tools/notification/test_notification_notifier_discarded_count
====================================================================

1..41
ok 1 - Add trigger my_trigger
PASS: tools/notification/test_notification_notifier_discarded_count 1 - Add trigger my_trigger
  ---
    duration_ms: 1323.966137
  ...
ok 2 - No discarded tracer notification
PASS: tools/notification/test_notification_notifier_discarded_count 2 - No discarded tracer notification
  ---
    duration_ms: 22.021590
  ...
ok 3 - Generating 390 tracer notifications
PASS: tools/notification/test_notification_notifier_discarded_count 3 - Generating 390 tracer notifications
  ---
    duration_ms: 154.790871
  ...
not ok 4 - Discarded tracer notification number non-zero (0) as expected
FAIL: tools/notification/test_notification_notifier_discarded_count 4 - Discarded tracer notification number non-zero (0) as expected
  ---
    duration_ms: 24.323759
  ...
```

Cause
=====

The initial size of pipes in linux may have different values:

1) `16 * PAGE_SIZE` (as documented in `man 7 pipe`) (since Linux 2.6.11)
2) When a user has many pipes open and is above a soft limit:

  * `2 * PAGE_SIZE` (undocumented, see[1]), as of Linux 5.14[2]
  * `1 * PAGE_SIZE` since linux 2.6.35[3]

As the program `default_pipe_size_getter` opened a pipe to check it's
size, there could be times in a system where a user has many pipe
buffers open beyond the soft limit and the lower value would be
returned; however, the previously opened sessiond may have had a pipe
opened with the larger default pipe size.

Solution
========

Use the maximum page size (on Linux, from
`/proc/sys/fs/pipe-max-size`) for the estimated pipe size rather than
opening a pipe and checking it's size.

Known drawbacks
===============

When the maximum pipe size value is much larger than the actual size
of the notification pipe, many more events are emitted than is
necessary to complete the test.

References
==========

[1]: https://gitlab.com/linux-kernel/stable/-/blob/3e9bff3bbe1355805de919f688bef4baefbfd436/fs/pipe.c#L809
[2]: See upstream commit 46c4c9d1beb7f5b4cec4dd90e7728720583ee348
[3]: See upstream commit 6a6ca57de92fcae34603551ac944aa74758c30d4

Change-Id: Id547a1d772b5a7f9b18ffa686ff6644afca4ab15
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agodocs: Update relayd architecture
Kienan Stewart [Mon, 6 May 2024 20:14:49 +0000 (16:14 -0400)] 
docs: Update relayd architecture

Observed issue
==============

The sessiond sessions do not map one-to-one with relay
sessions. Rather, there can be one relay session associated with
each of the active consumers, e.g. ustconsumerd64, ustconsumerd32,
and kconsumerd of each lttng-sessiond sessions.

Solution
========

The phrasing of the the relay session has been updated to
"per-consumer". An additional mention is added to say that
attaching a viewer session to multiple lttng-sessiond
sessions is not supported.

Change-Id: I1df18c4e97c0ee9ec4ee17b3bf35c6e74c90774f
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agotests: Add test for missing short lived applications
Kienan Stewart [Tue, 28 May 2024 14:33:07 +0000 (10:33 -0400)] 
tests: Add test for missing short lived applications

Change-Id: I691b9fb2cfae7603e40ca4c668acaff752ba3f28
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoFix: relayd: live: Catch short lived applications for attached viewers
Kienan Stewart [Fri, 12 Apr 2024 18:27:09 +0000 (14:27 -0400)] 
Fix: relayd: live: Catch short lived applications for attached viewers

Observed issue
==============

When a live viewer is attached to a session and a new application
starts, emits events, and exits the viewer may not see the produced
events.

With per-UID buffer allocation, the application needs to run as a new
user that hasn't had streams allocated before. With per-PID buffers,
spawning a new traced application is sufficient.

Cause
=====

When the new relay streams are created, associated viewer streams are
not immediately created. As a result, there is a gap between in which
the session may start being destroyed and/or the relay streams
unpublished and the time at which the live viewer sends a GET_NEW_STREAMS
command. When the relay streams are unpublished for any reason, the
reference to the relay stream in the ctf_trace is removed. The new
and unsent streams iterate over the relay streams in each ctf_trace.
Therefore, relay streams that were created and unpublished while
the live viewer was already attached to the session can be completely
missed.

Solution
========

The solution has three main aspects:

1. When new relayd streams are published and a viewer is attached for the
corresponding relay session or when a live viewer session attaches to
an existing relay session the viewer streams are created immediately.

2. The unsent viewer streams are tracked in a per-viewer session
list so that there continues to be a reference (via the
viewer_stream->stream backreference) held for the relay stream, and that
unpublished relay streams can be found without iterating over the
entire relay streams hashtable.

3. To cover cases where a relay stream has been closed but there are
still known trace chunks available, an additional check has been added
to the `get_next_index` viewer stream transition checks. When the
seen rotation count and relay stream rotation count are the same and
that the relay stream no longer has an active trace chunk, the
viewer stream is not forcibly rotated. This stops the final drop to
the trace chunk reference (via
viewerstream->stream_file->trace_chunk). Later, when the relay stream
is fully closed, there is a final rotation that is performed.

Known drawbacks
===============

The current implementation adds a global hash table which holds
references to created viewer sessions. When searching to determine if
new viewer streams should be created, the search is O(N*M) where N is the
number of viewer sessons and M is the number of relay sessions.

A different approach to recording references from relay sessions to
viewer sessions (if any exist) could reduce the search space.

Change-Id: Ie8f00697a4dafd5c9b0bfe60a872d1c1882f6944
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoTests: Add controls to run python tests with verbose output
Kienan Stewart [Thu, 11 Apr 2024 17:52:45 +0000 (13:52 -0400)] 
Tests: Add controls to run python tests with verbose output

When running failing tests, it can be useful to get verbose output
immediately without trying to run an environment with a separate
sessiond and/or relayd.

Setting `LTTNG_TEST_VERBOSE_RELAYD` or `LTTNG_TEST_VERBOSE_SESSIOND`
environment variables will cause the corresponding application to be run
in it's most verbose configuration.

Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Change-Id: Ic2dd84a36f61837dfbca99d06d6a438ae884f782
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoClean-up: Tests: Use lttngtest to run live viewer for test_live_hang.py
Kienan Stewart [Tue, 2 Apr 2024 12:00:57 +0000 (08:00 -0400)] 
Clean-up: Tests: Use lttngtest to run live viewer for test_live_hang.py

Change-Id: Iadc40684c8cd5f0ce64e45e3c78747ca54f5bc89
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoFix: Tests: Use wait_before_exit_file_path in WaitTraceTestApplication
Kienan Stewart [Fri, 29 Mar 2024 20:58:20 +0000 (16:58 -0400)] 
Fix: Tests: Use wait_before_exit_file_path in WaitTraceTestApplication

The `_WaitTraceTestApplication`'s `__init__` method proposed the
`wait_before_exit` and `wait_before_exit_file_path` parameters; however,
the parameters weren't then passed onwards to the trace test
application's invocation.

Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Change-Id: I9055aa206a8fd943012bacfa49d6ff152f2dfbde
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoTests: Add LiveViewer to lttngtest environment
Kienan Stewart [Fri, 29 Mar 2024 20:58:03 +0000 (16:58 -0400)] 
Tests: Add LiveViewer to lttngtest environment

Drawbacks
=========

With the current python bindings, the relayd seems to leak a file
descriptor; however, this doesn't stop the tests from working.

E.g.

```
ok 1 - BT2 live viewer exited successfully

Change-Id: I13994f7c8b0b6cffcee0d0ea0f8fca22538de651
---
  duration_ms: 1097.302968
...

 Killing session daemon (pid = 3340512)
Session daemon killed
lttng-relayd: Error: A file descriptor leak has been detected: 1
tracked file descriptors are still being tracked
```

Change-Id: Ie4294dd7238d4b6074af2d4cf193e1ca9949a741
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoTests: Allow the creation of dummy users in the lttngtest environment
Kienan Stewart [Fri, 29 Mar 2024 20:57:20 +0000 (16:57 -0400)] 
Tests: Allow the creation of dummy users in the lttngtest environment

There are tests that need other user accounts created (e.g. to exercise
per-UID buffers with more than one user). Those accounts may be created
by the test environment and cleaned up on deletion.

An option has been added to the _WaitTraceTestApplication to run the
application as another using `su`.

Change-Id: Ie003e628258fdfbea1972f1f8825c4466fc2792b
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoTests: Do not remove interrupted test log files by default
Kienan Stewart [Fri, 26 Jul 2024 14:46:40 +0000 (10:46 -0400)] 
Tests: Do not remove interrupted test log files by default

Observed issue
==============

During CI runs, builds may timeout or be killed for another reason.
Those tests logs are deleted and cannot be checked for diagnostic
information, warnings, or errors.

Cause
=====

By default, the test log for the currently running test is deleted by
automake so that subsequent invocations of `make check` will re-run the test.

Solution
========

Add a disable flag `--disable-precious-tests` and set
`PRECIOUS_TESTS` to true by default when configuring lttng-tools. When
`PRECIOUS_TOOLS` is set, all test logs in `tests/regression` will be
marked as `.PRECIOUS` and subsequently not deleted when interrupted.

Known drawbacks
===============

This could make interrupting a test and re-running during test
development more of a hassle.

References
==========

[1]: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
[2]: https://automake.gnu.narkive.com/1TjEGbH2/delete-on-error-test-suite-log-and-precious

Change-Id: I08b4a1bb29eb609827cc1c047f141f94b210effe
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agolttng: add-trigger: clarify terminology for log levels
Michael Jeanson [Tue, 28 May 2024 21:18:35 +0000 (17:18 -0400)] 
lttng: add-trigger: clarify terminology for log levels

To eliminate ambiguity in the code, the terminology for log levels has
been updated. The previous terms "min" and "max" log levels have been
replaced with "least_severe" and "most_severe" respectively.

This change addresses the varying conventions across different logging
domains, where numerical values for severity can either increase or
decrease with severity. The new terminology provides clarity, making it
easier to understand the severity levels regardless of the logging
domain's convention.

Change-Id: Ie90bcc8e4c07b8b7437d9580e166141fae5c6d2f
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoFix: inverted logic in loglevel_parse_range_string_common function
Michael Jeanson [Tue, 28 May 2024 19:08:22 +0000 (15:08 -0400)] 
Fix: inverted logic in loglevel_parse_range_string_common function

The mapping of numerical severity levels to their corresponding names
varies across different logging domains. Some domains, like
Java Util Logging, use higher numerical values for more severe logging
levels, while others, like Log4j2, use lower values for the same
purpose.

To accommodate this variation, the `loglevel_parse_range_string_common`
function has been updated. It now accepts the numerical value
representing the most severe logging level in a given domain. This
change ensures that log level specifications in the format `TRACE..` are
parsed correctly, regardless of the domain's convention.

Change-Id: Idbc3949ac33b69c71fce484a6d8912f59cdbe08d
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoAdd 'log4j2' domain event-rule unit tests
Michael Jeanson [Fri, 11 Feb 2022 15:38:48 +0000 (15:38 +0000)] 
Add 'log4j2' domain event-rule unit tests

Change-Id: I8a075516de8cb0b682791e4bf44d9a5d7780680e
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoAdd Log4j 2.x agent tests for the 'log4j2' domain
Michael Jeanson [Fri, 11 Feb 2022 15:38:10 +0000 (15:38 +0000)] 
Add Log4j 2.x agent tests for the 'log4j2' domain

Add integration tests for the new Log4j 2.x agent in its native mode
using the new 'log4j2' domain, the new configure switch
'--enable-test-java-agent-log4j2' to enable it or
'--enable-test-java-agent-all' to enable all Java agents tests.

To run only this new test, use this command :

  cd tests/regression && make check TESTS="ust/java-log4j2/test_agent_log4j2_domain_log4j2"

Change-Id: Idfac151d2e523b5ac109f2dae2f182b0bc9415d8
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoAdd 'log4j2' domain to the documentation
Michael Jeanson [Wed, 22 May 2024 20:40:29 +0000 (16:40 -0400)] 
Add 'log4j2' domain to the documentation

Change-Id: Ie76c686583f10bc09b9769db66e8e079b8472a37
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoAdd 'log4j2' domain to zsh completion
Michael Jeanson [Wed, 22 May 2024 20:41:39 +0000 (16:41 -0400)] 
Add 'log4j2' domain to zsh completion

Change-Id: Ic9121630022981909962a0b5943a20dbe5240558
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoAdd 'log4j2' domain to common test code
Michael Jeanson [Wed, 22 May 2024 20:44:30 +0000 (16:44 -0400)] 
Add 'log4j2' domain to common test code

Change-Id: I84961823eb875c673e525d83d8096291506c1edb
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoAdd a Log4j 2.x agent specific domain 'log4j2'
Michael Jeanson [Wed, 2 Feb 2022 20:04:09 +0000 (20:04 +0000)] 
Add a Log4j 2.x agent specific domain 'log4j2'

The initial version of the new LTTng-UST Log4j 2.x agent only operated
in a compatibility mode making use of the existing 'log4j' tracing
domain currently implemented in LTTng-Tools.

While this is useful when migrating existing Log4j applications using
the compatibility bridge it does require converting the log levels from
the new Log4j 2.x values to the old Log4j 1.x standard. This results in
hiding the actual log level values from the users for applications
natively using Log4j 2.x.

Exposing the native Log4j 2.x log level values requires a new domain
since the changes are significant:

  * The same list of standard log levels and names
  * Each standard log level has a new integer value
  * The log levels scale is reversed and shortened from
    'int32_max -> int32_min' to '0 -> int32_max'
  * The interval between standard log levels has changed

This new 'log4j2' domain is basicaly a straight copy of the current
'log4j' domain with minor adjustements for the reversed and shortened
scale.

Change-Id: I89f9c0a428ffe1d0bd26f7af547e9e21503de653
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoclang-format: run clang-format on the tree
Jérémie Galarneau [Fri, 30 Aug 2024 20:37:20 +0000 (16:37 -0400)] 
clang-format: run clang-format on the tree

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I45c2a1f375e5b19b649ee5d11fb299ccd77c6845

2 months agoclang-format: ignore generated files
Jérémie Galarneau [Fri, 30 Aug 2024 19:52:37 +0000 (15:52 -0400)] 
clang-format: ignore generated files

Two auto-generated files cause clang-format < v17 to hang when
they are being formatted. I have not looked into the root-cause,
but formatting them is useless anyhow.

Adding them to .clang-format-ignore works around the problem for the
moment.

Since clang-format 14 does not support ignore files, their support is
crudely emulated here using grep to filter out find's results.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I1cd10349ef1a66b1d595105b0ec1a4beef9dcc9a

2 months agoFix: Do not null out lttng_consumer_stream channel on deletion
Kienan Stewart [Thu, 11 Jul 2024 14:34:52 +0000 (10:34 -0400)] 
Fix: Do not null out lttng_consumer_stream channel on deletion

Change-Id: Ic98a27e6704d2683d24b8645d345955cee8b038c
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoFix: Crash when unregistering UST apps during shutdown
Kienan Stewart [Wed, 10 Jul 2024 18:14:14 +0000 (14:14 -0400)] 
Fix: Crash when unregistering UST apps during shutdown

Observed issue
==============

The following crash has been observed in v2.12.2:

```
function=0x55ac7c4c9600 <_ PRETTY FUNCTION .12873> "lttng_ustconsumer_close_metadata") at assert.c:92
function=0x55ac7c4c9600 <_ PRETTY FUNCTION .12873> "lttng_ustconsumer_close_metadata") at assert.c:101
```

The underlying cause is applicable in the current master branch as
well.

Cause
=====

There is a potential race between the threads the consumerd control
thread which handles commands coming from the sessiond and the main
thread when shutting down a consumerd.

Is it possible that the following happens:

1. `destroy_metadata_stream_ht` has the locks on `consumer_data`,
`channel`, `stream`
2. `lttng_ustconsumer_close_all_metadata` looks up the channel and starts to try and acquire a channel lock (`stream->chan->lock`)
3. `destroy_metadata_stream_ht` sets `stream->chan` to `null`
4. `destroy_metadata_stream_ht` releases the `stream`, `channel`, and `consumer_data` locks
5. `lttng_ustconsumer_close_all_metadata` now has the channel lock, and looks up `stream->chan` again to call `destroy_metadata_stream_ht`, and that member is now null

Solution
========

Acquire the stream lock after acquiring the channel lock.

part 2 follows: don't set stream->chan to null.

Known drawbacks
===============

None.

Change-Id: I1d27ea6ac08f3e7ed4624a8921cffb675be649d2
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoFix: Compilation failure deducing type of `auto` variables in GCC 4.8
Kienan Stewart [Tue, 6 Aug 2024 15:32:57 +0000 (11:32 -0400)] 
Fix: Compilation failure deducing type of `auto` variables in GCC 4.8

Observed issue
==============

When compiling with GCC 4.8.5 or GCC 5.5.0 on SLES12SP5, the following
error happens:

```
save.cpp: In function 'int save_agent_events(config_writer*, agent*)':
save.cpp:1185:43: error: use of 'agent_event' before deduction of 'auto'
       lttng::urcu::lfht_iteration_adapter<agent_event,
                                           ^                                                                 save.cpp:1185:43: error: use of 'agent_event' before deduction of 'auto'
save.cpp:1185:43: error: use of 'agent_event' before deduction of 'auto'
save.cpp:1187:26: error: template argument 1 is invalid
        &agent_event::node>(*agent->events->ht)) {
                          ^
save.cpp:1187:26: error: creating pointer to member of non-class type '<type error>'
save.cpp:1187:26: note: invalid template non-type parameter
In file included from ../../../src/vendor/fmt/core.h:3316:0,
                 from ../../../src/common/format.hpp:20,
                 from ../../../src/common/error.hpp:13,
                 from ../../../src/common/common.hpp:12,
                 from snapshot.hpp:13,
                 from consumer.hpp:12,
                 from session.hpp:11,
                 from kernel.hpp:13,
                 from save.cpp:10:
```

Cause
=====

This appears to be a limitation in older versions of GCC. I did not
find specific commit(s) or bugs which hilight the issue, but
compilation of this code works as of GCC 6.5.0 on SLES12SP5. Previous
point releases of GCC 6.x were not tested.

Solution
========

Explicitly define the type of the pointer and the type passed to
`lttng::urcu::lftht_iteration_adapter` so the compiler does not have
to perform type deduction.

Known drawbacks
===============

None.

Change-Id: I71c5937a38336756ece4f396ea5ba7af7f3d36c3
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 months agoFix: Compilation failure in session_not_found_error with GCC 4.8
Kienan Stewart [Tue, 6 Aug 2024 15:14:49 +0000 (11:14 -0400)] 
Fix: Compilation failure in session_not_found_error with GCC 4.8

Observed issue
==============

When compiling with gcc 4.8.5, the compilation fails with the
following erorr:

```
session.hpp:577:2: error: function 'lttng::sessiond::exceptions::session_not_found_error::session_not_found_error(lttng::sessiond::exceptions::session_not_found_error&&)' defaulted on its first declaration with an exception-specification that differs from the implicit declaration 'lttng::sessiond::exceptions::session_not_found_error::session_not_found_error(lttng::sessiond::exceptions::session_not_found_error&&)'
session.hpp:577:2: error: function 'lttng::sessiond::exceptions::session_not_found_error::session_not_found_error(lttng::sessiond::exceptions::session_not_found_error&&)' defaulted on its first declaration with an exception-specification that differs from the implicit declaration 'lttng::sessiond::exceptions::session_not_found_error::session_not_found_error(lttng::sessiond::exceptions::session_not_found_error&&)'
```

Cause
=====

This is due a bug in GCC which is fixed as of GCC 5.0[1]

Solution
========

Do not explicitly define the move_assignable for
`lttng::sessiond::exceptions::session_not_found_error` as
`noexcept`. The function should be implicitly generated as `noexcept`.

Known drawbacks
===============

None.

References
==========
[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59526

Change-Id: I3368633ce3b45627f2e67f7d2def361e662eec3d
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: main.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Wed, 31 Jul 2024 01:10:16 +0000 (01:10 +0000)] 
sessiond: main.cpp: iterate on list using list_iteration_adapter

Change-Id: I492b597b70040c0e1f3eb826aadb66ca44550fb5
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: agent-thread.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Wed, 31 Jul 2024 01:06:11 +0000 (01:06 +0000)] 
sessiond: agent-thread.cpp: iterate on list using list_iteration_adapter

Change-Id: Ibd02f3e2c8d91fc8aa09097be2ea7b563001b1da
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: trace-ust.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Wed, 31 Jul 2024 01:04:45 +0000 (01:04 +0000)] 
sessiond: trace-ust.cpp: iterate on list using list_iteration_adapter

Change-Id: I20a5549e8a93b7fe0d111b72548af8e74d80531a
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: ust-app.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 20:44:53 +0000 (20:44 +0000)] 
sessiond: ust-app.cpp: iterate on list using list_iteration_adapter

Change-Id: I77d7ecb33f297561ec9c887495c7a798fa7f73ce
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: client.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 20:36:13 +0000 (20:36 +0000)] 
sessiond: client.cpp: iterate on list using list_iteration_adapter

Change-Id: Ibb45513080329e805c757cfc69a99eaa14387ac0
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: ctf-trace.cpp: iterate on rcu list using rcu_list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 20:32:50 +0000 (20:32 +0000)] 
relayd: ctf-trace.cpp: iterate on rcu list using rcu_list_iteration_adapter

Change-Id: I5c16d02d44fc90b9bf9336ac6cd795398d4ab4f5
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: manage-kernel.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 20:30:46 +0000 (20:30 +0000)] 
sessiond: manage-kernel.cpp: iterate on list using list_iteration_adapter

Change-Id: Icf0e10d675e1d0ba116c09b92d9426309b7cb606
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: dispatch.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 20:20:09 +0000 (20:20 +0000)] 
sessiond: dispatch.cpp: iterate on list using list_iteration_adapter

Change-Id: Ie8a45753922b0a5dd476be06ce15a1f7d6883c08
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: viewer-session.cpp: iterate on rcu list using rcu_list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 20:04:23 +0000 (20:04 +0000)] 
relayd: viewer-session.cpp: iterate on rcu list using rcu_list_iteration_adapter

Change-Id: Ie8110d36a9c59e687366309e6ee399e6a3f93bbc
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: session.cpp: iterate on rcu list using rcu_list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 20:00:15 +0000 (20:00 +0000)] 
relayd: session.cpp: iterate on rcu list using rcu_list_iteration_adapter

Change-Id: I9cfca29e54873c696ef6b8c84454e77e299ddd10
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: live.cpp: iterate on rcu list using rcu_list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 19:58:10 +0000 (19:58 +0000)] 
relayd: live.cpp: iterate on rcu list using rcu_list_iteration_adapter

Change-Id: I89824eb36bb317a424880f34dc962cf7b1eca1ed
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: main.cpp: iterate on rcu list using rcu_list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 19:43:01 +0000 (19:43 +0000)] 
relayd: main.cpp: iterate on rcu list using rcu_list_iteration_adapter

Change-Id: Id3070b39458b3e44185875c87dca069c2dbb6ed6
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agourcu: add rcu_list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 19:34:23 +0000 (19:34 +0000)] 
urcu: add rcu_list_iteration_adapter

Like its list_iteration_adapter counterpart, this utility allows
the iteration over cds_list structures and provides ranged-for
semantics.

This utility differs in that it provides an RCU-protected iteration
over the list.

Change-Id: I810126ee5e099a6e6bb15509d00efa0ebfa56e73
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: save.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 15:33:33 +0000 (15:33 +0000)] 
sessiond: save.cpp: iterate on list using list_iteration_adapter

Change-Id: Ib413d1bf87c4c557c049c3ee329e9255525f7666
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: cmd.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 03:35:47 +0000 (03:35 +0000)] 
sessiond: cmd.cpp: iterate on list using list_iteration_adapter

Change-Id: I79eeaad0b57da7d7650ca77c26a781d44b3a8152
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: buffer-registry.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 03:26:08 +0000 (03:26 +0000)] 
sessiond: buffer-registry.cpp: iterate on list using list_iteration_adapter

Change-Id: I30a861585a5c5c398f9999ab2efa687a133e09e6
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: session.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 03:22:07 +0000 (03:22 +0000)] 
sessiond: session.cpp: iterate on list using list_iteration_adapter

Change-Id: Ie138974d18f25db7e449a856c59bfb3be87ac06a
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: context.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 03:16:18 +0000 (03:16 +0000)] 
sessiond: context.cpp: iterate on list using list_iteration_adapter

Change-Id: I2e9d80dcf167d28c33d78bc269cd3e179c22f299
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: ust-consumer.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 03:09:39 +0000 (03:09 +0000)] 
consumerd: ust-consumer.cpp: iterate on list using list_iteration_adapter

Change-Id: I90d06ef8bbe674bc91fc19f489758a8c7c07cad1
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: kernel-consumer.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 02:59:29 +0000 (02:59 +0000)] 
consumerd: kernel-consumer.cpp: iterate on list using list_iteration_adapter

Change-Id: I4464898e56cc88baa9a9b2b4c56461d95f342ac0
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: consumer.cpp: iterate on list using list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 02:44:58 +0000 (02:44 +0000)] 
consumerd: consumer.cpp: iterate on list using list_iteration_adapter

Change-Id: Iad57a1bfdce8b2b3f14702e93f2eceb4ff535f6a
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agourcu: add list_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 02:35:32 +0000 (02:35 +0000)] 
urcu: add list_iteration_adapter

Add a type-safe cds_list iteration adapter. Like those provided for
the lfht, this adapter provides type-safe range-for semantics for
cds_list structures.

Change-Id: I03d3b3c31911d495c9c6187000400563a3d05ad8
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: ust-consumer.cpp: iterate on lfht using lfht_filtered_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 01:38:23 +0000 (01:38 +0000)] 
consumerd: ust-consumer.cpp: iterate on lfht using lfht_filtered_iteration_adapter

Change-Id: If4f54d8e79a8eb68e2214d3182150b974b806398
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: consumer.cpp: iterate on lfht using lfht_filtered_iteration_adapter
Jérémie Galarneau [Tue, 30 Jul 2024 01:26:10 +0000 (01:26 +0000)] 
consumerd: consumer.cpp: iterate on lfht using lfht_filtered_iteration_adapter

Change-Id: I6f7e66d8446e1ebc05679a61fd190053f252902f
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: consumer-timer.cpp: iterate on lfht using lfht_filtered_iteration_adapter
Jérémie Galarneau [Mon, 29 Jul 2024 20:45:36 +0000 (20:45 +0000)] 
consumerd: consumer-timer.cpp: iterate on lfht using lfht_filtered_iteration_adapter

Change-Id: I3fc6eab351d901379e2ebcbf81e98d7b54c09586
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: consumer-stream.cpp: iterate on lfht using lfht_filtered_iteration_adapter
Jérémie Galarneau [Mon, 29 Jul 2024 20:26:13 +0000 (20:26 +0000)] 
consumerd: consumer-stream.cpp: iterate on lfht using lfht_filtered_iteration_adapter

Change-Id: I625c1a942fc7aa635d78a62cf468b17651596412
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agourcu: add lfht_filtered_iteration_adapter helper
Jérémie Galarneau [Mon, 29 Jul 2024 20:23:47 +0000 (20:23 +0000)] 
urcu: add lfht_filtered_iteration_adapter helper

The urcu lfht macros often make use of caa_container_of (and other equivalent
variations) which use offsetof. Unfortunately, offsetof is conditionally
supported by compilers for non-POD types.

The tree already has lttng::utils::container_of to work around this
problem. This new utils makes it possible to iterate on the
elements of an lfht that match a given key without using those macros. Those iterations are the
main reason such warnings are emitted. The interface of
lfht_filtered_iteration_adapter also allows the use of ranged-for loops.

Change-Id: I9acd3fa9f6523de8006bc9107bcca6b6b654d6fa
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: consumer.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 21:54:59 +0000 (21:54 +0000)] 
consumerd: consumer.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Icecd70d1023847b1489b298e4c04625bac4ebcc9
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: ust-consumer.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 21:49:06 +0000 (21:49 +0000)] 
consumerd: ust-consumer.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Idbbfd6be4666bca420faf408241f5f195818981a
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agocommon: fd-tracker.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 21:47:36 +0000 (21:47 +0000)] 
common: fd-tracker.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ic28cf4f9a8534540f2e28dd5d69a146367280a9b
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agocommon: trace-chunk.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 21:44:20 +0000 (21:44 +0000)] 
common: trace-chunk.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ia05a6b974a9bafac993de76a781a22be487e94cd
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: ust-registry-session.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 21:31:00 +0000 (21:31 +0000)] 
sessiond: ust-registry-session.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I0bc5ff2754be9ba417c6fa16535cf20cd23875f3
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: ust-registry-channel.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 21:20:18 +0000 (21:20 +0000)] 
sessiond: ust-registry-channel.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ie415952021ef795259b9290e4b16d68051403524
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: tracker.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 21:11:16 +0000 (21:11 +0000)] 
sessiond: tracker.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I96b0cd3bfe84357f9ec09d254a6d7f8757c52c69
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: trace-ust.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 21:07:41 +0000 (21:07 +0000)] 
sessiond: trace-ust.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I5f87aebb6d8e4fc0ef6a4088faf0b7b1a84f37d0
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: snapshot.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:55:53 +0000 (20:55 +0000)] 
sessiond: snapshot.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I826575008b4ba2d828ad5ac52dc28d78ccca5e7d
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: session.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:53:58 +0000 (20:53 +0000)] 
sessiond: session.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I2deae4866e0664e32cc40b891fc9e19b9936d66e
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: save.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:51:42 +0000 (20:51 +0000)] 
sessiond: save.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I760ad9294584718e308775af65279688c2f58c65
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: rotation-thread.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:47:01 +0000 (20:47 +0000)] 
sessiond: rotation-thread.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I00f293b25e8747058c643ba63c07813a8d9a24ec
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: manage-kernel.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:43:11 +0000 (20:43 +0000)] 
sessiond: manage-kernel.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Id6a47ca1971f48dec5563085fa9e5affd48a1567
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: lttng-syscall.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:41:58 +0000 (20:41 +0000)] 
sessiond: lttng-syscall.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ib4439701c48b64b2244b346c86c7b1abb55503c4
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: notification-thread-events.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:38:54 +0000 (20:38 +0000)] 
sessiond: notification-thread-events.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I15de31ca184c255b4a7540c2bf15f90ddf633da0
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: kernel.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:32:36 +0000 (20:32 +0000)] 
sessiond: kernel.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ib129073617fc79c0dc9844129e637cac3d715598
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: event.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 20:16:02 +0000 (20:16 +0000)] 
sessiond: event.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I12292f505e9f867898c92bcf6cbd81c10204d5d8
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: event-notifier-error-accounting.cpp: iterate on lfht using lfht_iteration_a...
Jérémie Galarneau [Fri, 26 Jul 2024 20:07:03 +0000 (20:07 +0000)] 
sessiond: event-notifier-error-accounting.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I8a4486f86e634187439b8e6c13fdd1a52fd051de
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: context.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:52:38 +0000 (19:52 +0000)] 
sessiond: context.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Idbcd23b281188732f1746e9f1f911c527b1f0903
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: consumer.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:51:14 +0000 (19:51 +0000)] 
sessiond: consumer.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ie970c9da116aa7daa87287366dc4935353152bbb
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: cmd.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:47:06 +0000 (19:47 +0000)] 
sessiond: cmd.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I6118ba8c0b5177f4c82b3c2bac77e9bc2eefecc1
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: buffer-registry.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:39:32 +0000 (19:39 +0000)] 
sessiond: buffer-registry.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I75daca3d9556c36bf2f08ec2c4c0184f2a2939e6
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: agent.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:30:31 +0000 (19:30 +0000)] 
sessiond: agent.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I4c590968f244bbffc4f685a611bfc8ec28c46688
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: agent-thread.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:18:59 +0000 (19:18 +0000)] 
sessiond: agent-thread.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I059c11d8820ffb8416f265a59e21b66d884d722d
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: viewer-stream.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:17:26 +0000 (19:17 +0000)] 
relayd: viewer-stream.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Idd3de68df6d9a81b3b04d8bc36a24aad14333916
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: viewer-session.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:15:48 +0000 (19:15 +0000)] 
relayd: viewer-session.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ice79de9905f6fd374c6de897541ac7915a3f8231
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: stream.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:13:44 +0000 (19:13 +0000)] 
relayd: stream.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I42d455ed488a5992705a5e59ac55104da948b592
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: session.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:11:51 +0000 (19:11 +0000)] 
relayd: session.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: I113be144c1a7da100106b12d85a244f603472fed
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: main.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:06:54 +0000 (19:06 +0000)] 
relayd: main.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ibe839a6733432e2ed464e1785569ed92087cf329
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: ust-app.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Fri, 26 Jul 2024 19:02:49 +0000 (19:02 +0000)] 
sessiond: ust-app.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Ibe4990750a371f67d41b02061500ab8b1cdbe60e
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agorelayd: live.cpp: iterate on lfht using lfht_iteration_adapter
Jérémie Galarneau [Wed, 24 Jul 2024 20:07:09 +0000 (20:07 +0000)] 
relayd: live.cpp: iterate on lfht using lfht_iteration_adapter

Change-Id: Id738d57f3bdfc26e08dc865dfdfed06834a09bc7
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoClean-up: sessiond: ust-ctl-internal: fix clang-tidy warnings
Jérémie Galarneau [Wed, 24 Jul 2024 18:22:22 +0000 (18:22 +0000)] 
Clean-up: sessiond: ust-ctl-internal: fix clang-tidy warnings

Change-Id: I797e49ed73524d19decb9fc53a5423ccfd5df7a1
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoclang-tidy: LTTNG_IOCTL_CHECK can use const return variable
Jérémie Galarneau [Wed, 24 Jul 2024 17:26:52 +0000 (17:26 +0000)] 
clang-tidy: LTTNG_IOCTL_CHECK can use const return variable

clang-tidy reports:
kernel-ctl/kernel-ctl.cpp:70:9: warning: variable '_ioctl_ret' of type 'int' can be declared 'const' [misc-const-correctness]

Change-Id: I87ca5168eeca6af3e9ec459a1887493df1a51793
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoFix: sessiond: missing include causes multiple conflicting definitions
Jérémie Galarneau [Wed, 24 Jul 2024 17:14:44 +0000 (17:14 +0000)] 
Fix: sessiond: missing include causes multiple conflicting definitions

clang-tidy reports that
/root/lttng-tools/src/bin/lttng-sessiond/ust-ctl-internal.hpp:346:3: error: redefinition of 'LTTNG_PACKED' with a different type: 'struct lttng_ust_ctl_integer_type' vs 'struct lttng_ust_ctl_consumer_channel_attr' [clang-diagnostic-error]
  346 | } LTTNG_PACKED;

Indeed, that header is missing macros.hpp causing LTTNG_PACKED
to be misinterpreted.

Change-Id: I9a0ec916e7ad1c4d926f4d9a33dd6a85fb5b809c
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoclang-tidy: cppcoreguidelines-special-member-functions
Jérémie Galarneau [Tue, 23 Jul 2024 21:00:34 +0000 (21:00 +0000)] 
clang-tidy: cppcoreguidelines-special-member-functions

clang-tidy reports an infringement of
cppcoreguidelines-special-member-functions[1] for
_scoped_rcu_read_lock, iterator, session_not_found_error,
and session_not_found_error.

The copy constructor, move constructor, and assignment operators
are deleted when they are not explicitly defined.

[1] https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c21-if-you-define-or-delete-any-copy-move-or-destructor-function-define-or-delete-them-all

Change-Id: I1ec5470fed8ddf30025d7c71994bff9bafcfbf56
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoclang-tidy: remove performance-enum-size
Jérémie Galarneau [Wed, 24 Jul 2024 15:15:22 +0000 (15:15 +0000)] 
clang-tidy: remove performance-enum-size

Specifying the size of enumerators is verbose and provides dubious
performance benefits for most of our uses. Silence the warning.

Change-Id: I2dd482437f649f031b5b425d8952360bbe8ceae0
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: lttng_consumer_channel: use lttng::utils::container_of
Jérémie Galarneau [Mon, 22 Jul 2024 20:12:01 +0000 (20:12 +0000)] 
consumerd: lttng_consumer_channel: use lttng::utils::container_of

caa_container_of makes use of offsetof which is conditionally
supported for non-POD types. Replace its use by
lttng::utils::container_of.

Change-Id: I69a15b9ad2e086d02beabb5c5f98d54d2ebf538d
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agoconsumerd: lttng_consumer_stream: use lttng::utils::container_of
Jérémie Galarneau [Mon, 22 Jul 2024 20:09:57 +0000 (20:09 +0000)] 
consumerd: lttng_consumer_stream: use lttng::utils::container_of

caa_container_of makes use of offsetof which is conditionally
supported for non-POD types. Replace its use by
lttng::utils::container_of.

Change-Id: I1b8075c3ab3bdda7a345c3278ee251c6f6ee1023
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: iterate on ust_app_ht using lfht_iteration_adapter
Jérémie Galarneau [Mon, 22 Jul 2024 20:03:43 +0000 (20:03 +0000)] 
sessiond: iterate on ust_app_ht using lfht_iteration_adapter

offsetof conditionally support for non-POD types and is used by
the cds_lfht_for_each_[...] macros. Replace them with
lfht_iteration_adapter which also provides ranged-for semantics.

Change-Id: I7759c7e6e0ae5a83a8c3a2e98b74d3c3c1993af7
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: ust_app_channel: use lttng::utils::container_of
Jérémie Galarneau [Mon, 22 Jul 2024 20:05:35 +0000 (20:05 +0000)] 
sessiond: ust_app_channel: use lttng::utils::container_of

caa_container_of makes use of offsetof which is conditionally
supported for non-POD types. Replace its use by
lttng::utils::container_of.

Change-Id: I29980d41d068b29a41f8148188d66a636ea5b46f
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 months agosessiond: ust_app_ctx: use lttng::utils::container_of
Jérémie Galarneau [Mon, 22 Jul 2024 20:01:19 +0000 (20:01 +0000)] 
sessiond: ust_app_ctx: use lttng::utils::container_of

caa_container_of makes use of offsetof which is conditionally
supported for non-POD types. Replace its use by
lttng::utils::container_of.

Change-Id: I9d3616ccccd15d94447456df415ead2b9b4ff2c3
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.047109 seconds and 4 git commands to generate.