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>
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>
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>
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>
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>
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Jérémie Galarneau [Mon, 22 Jul 2024 19:59:40 +0000 (19:59 +0000)]
sessiond: delete_ust_app_channel: iterate on lfht 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: I163697d83f235f46a1d70b596a34b6e010ec4169
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:58:33 +0000 (19:58 +0000)]
sessiond: ust_app_event: 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: Ica13ae34db7c0fd04118d0e80c7ae71b77f66ad6
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:56:56 +0000 (19:56 +0000)]
sessiond: ust_id_tracker_node: 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: I6c45b7d5138152728f67885ac5cc00ea1bc1603a
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:16:27 +0000 (19:16 +0000)]
Clean-up: sessiond: automatic memory management of ltt_ust_event
Simplify trace_ust_create_event by wrapping the created ltt_ust_event
in a unique_ptr until it is returned (on success).
Change-Id: I1b14df589f30d4cd19c9712b70f6c5656335123b
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:15:32 +0000 (19:15 +0000)]
sessiond: ltt_ust_event: 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: I043c6a01ea4f96624d21bb034e545503995a2794
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:14:18 +0000 (19:14 +0000)]
sessiond: consumer_socket: 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: I49b36b3ba7be6f4cacde7f44022db459c97bf950
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:13:11 +0000 (19:13 +0000)]
sessiond: index_ht_entry: 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: Ic2ed13700b8258b274aef9153ebc9d2a6a3536f3
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:12:15 +0000 (19:12 +0000)]
sessiond: ust_error_accounting_entry: 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: I8b9167ad2e8100ed9a9f99d2ef23a8859713838d
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:11:32 +0000 (19:11 +0000)]
sessiond: ust_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: Ib00bfa536d9412824d49f7c8bff429b0aa03762e
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:10:37 +0000 (19:10 +0000)]
sessiond: buffer_reg_uid: 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: I96a42df9c82ad6b520d3b53a6445159bce692120
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:09:53 +0000 (19:09 +0000)]
sessiond: agent_event: 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: I28f5b7db71ce0c7a7d0ff367d88a8350bd66d988
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:08:47 +0000 (19:08 +0000)]
relayd: viewer_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: Ied676a7003749a82b0ae4eeb8a1bcedb0e081673
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:08:00 +0000 (19:08 +0000)]
sessiond: relay_session: 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: I0fb69c7132665ea0ee3067445884ec1115ba9872
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:04:48 +0000 (19:04 +0000)]
relayd: use lfht_iteration_adapter to iterate on stream indices
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: Id1460004322e1e778a1affd41c82527a05190f59
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 22 Jul 2024 19:02:49 +0000 (19:02 +0000)]
relayd: offsetof conditionally supported for non-POD types
caa_container_of makes use of offsetof which is conditionally
supported for non-POD types. Replace its use by
lttng_ht_node_container_of.
Change-Id: If2f19ab1aba8c59cf9ca2e0d5b815a396512b2d9
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Wed, 17 Jul 2024 20:39:54 +0000 (20:39 +0000)]
urcu: add lfht_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 all of the
elements of an lfht without using those macros. Those iterations are the
main reason such warnings are emitted. The interface of
lfht_iteration_adapter also allows the use of ranged-for loops.
Change-Id: I61906e025bd0dd7512f02180700f3ddb3c9cf3ca
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Thu, 18 Jul 2024 17:37:43 +0000 (17:37 +0000)]
sessiond: manage syscall table allocation using std::vector
Transitioning to the use of std::vector to manage the allocation and
resizing of the syscall table allows us to do away with memset() of the
syscall structure. The memset becomes problematic when lttng_ht_node_*
becomes non-POD in a follow-up change.
Change-Id: I94096782360f85ffffb0f72d188224af15e54d07
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jérémie Galarneau [Mon, 8 Jul 2024 20:14:36 +0000 (16:14 -0400)]
Fix: remove use of offset_of for ust_app_session lists
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I17429be1ce0a48257b75532582552720aaec1e0d
Jérémie Galarneau [Mon, 8 Jul 2024 15:50:01 +0000 (11:50 -0400)]
Fix: sessiond: g++ reports shm_path truncation issue
On the CI, g++ reports:
char* strncpy(char*, const char*, size_t)' specified bound 4096 equals destination size [-Wstringop-truncation]
The shm_path provided by liblttng-ctl is truncated to PATH_MAX
regardless of its contents.
LTTN_ERR_INVALID is returned if the shm_path is not null terminated.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie369f2ee368c70e2b3b41c45a69da7e6d9fa45f8
Jérémie Galarneau [Fri, 19 Jul 2024 20:38:29 +0000 (20:38 +0000)]
Fix: relayd: incorrect use of lfht add_unique API
cds_lfht_add_unique is misused in relay_index_add_unique. The address
of the node is used instead of the address of the key for both the
key parameter and to compute the hash of the index entry's key.
This caused problems in an upcoming change that changes the layout
of the lttng_ht node since the key is no longer the first member
of the node.
Change-Id: Iec67f78b8ced4f4e520dc0dbebda8d30e283aa38
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Mathieu Desnoyers [Mon, 29 Jul 2024 13:55:50 +0000 (09:55 -0400)]
Adapt to LTTng-UST ABI/control API updates
Adapt to ABI/control API updates introduced by LTTng-UST commit
24f7193c9b91 ("Introduce extension points for trace hit counters")
Note that this commit reverts back to uint32_t for channel event ids.
UST notification LTTNG_UST_CTL_NOTIFY_CMD_KEY is currently handled as
-LTTNG_UST_ERR_NOSYS (TODO).
The type of the argument to is_max_event_id() is changed to
lttng::sessiond::ust::event_id to match the newly introduced event_id
type definition. Likewise for the registry_channel _next_event_id
member.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I6299b07c02d35b067aed5e94f11353d3cc14f24c
This page took 0.043753 seconds and 4 git commands to generate.