<div dir="auto"><p dir="ltr">Hi Kienan,</p>
<p dir="ltr">switching to tracing per uid solved the Problem.</p><p dir="ltr">Huge thanks for your patients!</p><p dir="ltr"><br></p><p dir="ltr">Best regards,</p><p dir="ltr">Georg </p><p dir="ltr"><br></p><div data-smartmail="gmail_signature"><div dir="ltr"><span style="color:rgb(80,0,80)">Never burn the bridges before you</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">If you've burned the bridges behind</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">Never burn the one that you're walking upon</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">Or you're sure to hit the water in time. <i>(Savatage, Streets, 1991)</i></span><br></div></div></div>
<br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Kienan Stewart <<a href="mailto:kstewart@efficios.com" target="_blank" rel="noreferrer">kstewart@efficios.com</a>> schrieb am Mi., 25. Juni 2025, 22:52:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Georg,<br>
<br>
On 6/25/25 1:27 PM, Georg Muck wrote:<br>
> Hi Kienan,<br>
> <br>
> thanks for your quick response. :)<br>
> <br>
> I replaced "--daemonize" with "--background".<br>
> <br>
> I guess I should briefly describe my goal to avoid confusion: I want to<br>
> trace a ROS2-session online (tried LTTng-live, but it costs too much<br>
> ressources, hence the aggressive rotation of 1s). LTTng gives me the path<br>
> to a newly created trace-file as soon as it is created. This path is<br>
> forwarded to a Thread-Pool that does the rest (analyses each tracefile by<br>
> itself)… . However, the tracefiles are removed in the end, cause I'm not<br>
> interested in them, only the program should be interested in them (forgot<br>
> to remove it in the example). The problem only occurs when I start to many<br>
> ROS2 instances at once, meaning gathering too many tracepoints at once (at<br>
> once meaning in a very short amount of time). It works fine for 1-2<br>
> instances, but it doesn't work for 16 instances.<br>
> <br>
>> 1. *Before any traced application is run, babeltrace2 has the following<br>
> error output:* Ah ok, thought I would be on the right track.<br>
>> 2. *After a traced application is run whether is produces enabled events<br>
> or not, I see the events recorded*: What do you mean by that? There is no<br>
> babeltrace2 error if traced instances are running, even tho they are not<br>
> creating events?<br>
<br>
This is what I observed with a fresh start:<br>
<br>
before running any traced application: bt2 error with no traced content<br>
<br>
after running a traced application with no events: bt2 no longer <br>
produced an error, but output 0 events (as expected).<br>
<br>
In this case I expect that it is because the consumer started and basic <br>
metadata was available so that was written in the snapshot. If I recall <br>
correctly, the consumer daemon only starts when the first application <br>
connects<br>
<br>
after running a traced application with some events: as usual<br>
>> 3. *When your session script stops, the output folder is deleted*: like<br>
> described, forgot to remove, but it is on purpose<br>
> <br>
> I tried *tp**:tptest*, but there is no output shown by babeltrace2 (is that<br>
> intended?):<br>
> <br>
<br>
I had the 100 events produced by gen-ust-events binary that invoked. You <br>
ran it but the events weren't recorded? Regardless I think we're on the <br>
same page that the session setup program you are using is fine right now.<br>
<br>
> [georg@KARTOFF8xE-zenbook /tmp/structural_traces]$ babeltrace2 archives<br>
> [georg@KARTOFF8xE-zenbook /tmp/structural_traces]$<br>
> <br>
> <br>
> However, I figured something out:<br>
> When I trace the "ros:rcl_node_init"-Tracepoint and start 12 ROS2<br>
> Instances, I receive the following output for the entire archive-directory:<br>
> [georg@KARTOFF8xE-zenbook /tmp/structural_traces/archives]$ babeltrace2 .<br>
> <br>
> [19:01:41.474172508] (+?.?????????) KARTOFF8xE-zenbook:listener:(24897)<br>
> ros2:rcl_node_init: { cpu_id = 1 }, { procname = "listener", vpid = 24897<br>
> }, { node_handle = 0x5CCBD0EFA280, rmw_handle = 0x5CCBD107A420, node_name =<br>
> "saturn_listener", namespace = "/hallo/saturn" }<br>
> [19:01:41.493613263] (+0.019440755) KARTOFF8xE-zenbook:talker:(24898)<br>
> ros2:rcl_node_init: { cpu_id = 4 }, { procname = "talker", vpid = 24898 },<br>
> { node_handle = 0x5A8E10DFC6E0, rmw_handle = 0x5A8E10F8AA60, node_name =<br>
> "erde_talker", namespace = "/hallo/erde" }<br>
> <br>
> All coming from archive-file number 10:<br>
> [georg@KARTOFF8xE-zenbook<br>
> /tmp/structural_traces/archives/20250625T190141+0200-20250625T190142+0200-10]$<br>
> babeltrace2 .<br>
> <br>
> [19:01:41.474172508] (+?.?????????) KARTOFF8xE-zenbook:listener:(*24897*)<br>
> ros2:rcl_node_init: { cpu_id = 1 }, { procname = "listener", vpid = 24897<br>
> }, { node_handle = 0x5CCBD0EFA280, rmw_handle = 0x5CCBD107A420, node_name =<br>
> "saturn_listener", namespace = "/hallo/saturn" }<br>
> [19:01:41.493613263] (+0.019440755) KARTOFF8xE-zenbook:talker:(24898)<br>
> ros2:rcl_node_init: { cpu_id = 4 }, { procname = "talker", vpid = 24898 },<br>
> { node_handle = 0x5A8E10DFC6E0, rmw_handle = 0x5A8E10F8AA60, node_name =<br>
> "erde_talker", namespace = "/hallo/erde" }<br>
> <br>
> However, looking deeper into that file I saw that there are all 12<br>
> instances (+some of ros2 itself) I started within the trace-directory<br>
> number 10!<br>
> [georg@KARTOFF8xE-zenbook<br>
> /tmp/structural_traces/archives/20250625T190141+0200-20250625T190142+0200-10/ust/pid]$<br>
> ls<br>
> <br>
> listener-24897-20250625-190141  listener-24903-20250625-190141<br>
>   ros2-24447-20250625-190131  ros2-24887-20250625-190141<br>
>   talker-24900-20250625-190141  talker-24916-20250625-190141<br>
> listener-24899-20250625-190141  listener-24914-20250625-190141<br>
>   ros2-24451-20250625-190131  talker-24896-20250625-190141<br>
>   talker-24902-20250625-190141<br>
> listener-24901-20250625-190141  listener-24917-20250625-190141<br>
>   ros2-24834-20250625-190134  talker-24898-20250625-190141<br>
>   talker-24904-20250625-190141<br>
> <br>
> BUT:<br>
> I looked into the specific directory of a traced instance (underlined it)<br>
> [georg@KARTOFF8xE-zenbook<br>
> /tmp/structural_traces/archives/20250625T190141+0200-20250625T190142+0200-10/ust/pid]$<br>
> ls listener-*24897*-20250625-190141/<br>
> <br>
> index     structuralChannel_0  structuralChannel_2  structuralChannel_4<br>
>   structuralChannel_6  structuralChannel_8  structuralChannel_10<br>
> *metadata*  structuralChannel_1  structuralChannel_3  structuralChannel_5<br>
>   structuralChannel_7  structuralChannel_9  structuralChannel_11<br>
> <br>
> and of a non-traced instance:<br>
> [georg@KARTOFF8xE-zenbook     <br>
> /tmp/structural_traces/archives/20250625T190141+0200-20250625T190142+0200-10/ust/pid]$<br>
> ls listener-24899-20250625-190141<br>
> <br>
> index                structuralChannel_1  structuralChannel_3<br>
>   structuralChannel_5  structuralChannel_7  structuralChannel_9<br>
> structuralChannel_11<br>
> structuralChannel_0  structuralChannel_2  structuralChannel_4<br>
>   structuralChannel_6  structuralChannel_8  structuralChannel_10<br>
> <br>
> Turns out: There is no metadata file within the second one. Therefore<br>
> babeltrace2 is not able to parse the file. Do you have an idea why?<br>
> <br>
<br>
 From your later e-mail with the updated sessiond log which shows the <br>
PERROR for too many open files it sounds like you have a thread to pull on.<br>
<br>
You can try using the per-uid buffering scheme to reduce the number of <br>
FDs required when running 12 concurrent instances of ros.<br>
<br>
> Best regards,<br>
> Georg<br>
> <br>
> Never burn the bridges before you<br>
> If you've burned the bridges behind<br>
> Never burn the one that you're walking upon<br>
> Or you're sure to hit the water in time. *(Savatage, Streets, 1991)*<br>
> <br>
> <br>
> Am Mi., 25. Juni 2025 um 17:50 Uhr schrieb Kienan Stewart <<br>
> <a href="mailto:kstewart@efficios.com" rel="noreferrer noreferrer" target="_blank">kstewart@efficios.com</a>>:<br>
> <br>
>> Hi Georg,<br>
>><br>
>> On 6/25/25 9:36 AM, Georg Muck wrote:<br>
>>> Hi Kienan,<br>
>>><br>
>>> I did exactly that, without success.<br>
>>><br>
>>> The log of the lttng-sessiond (lttng.log) did not change after starting<br>
>> the<br>
>>> ROS2 instances. I have also added the output of "lttng list<br>
>>> structuralSession"<br>
>>> I start my tracing instance as follows:<br>
>>><br>
>>> At first there is a bash-script that sets everything up, it does the<br>
>>> following:<br>
>>><br>
>>> lttng destroy -a # to destroy all existing sessions<br>
>>> lttng-sessiond --daemonize --verbose-consumer -vvv &> "/tmp/lttng.log" #<br>
>><br>
>> When started with '--daemonize', the file descriptors are closed[1]<br>
>> after forking which is why you don't see any further output to<br>
>> /tmp/lttng.log. Try with '--background' instead.<br>
>><br>
>>> starting a new session Deamon<br>
>>> ./exemplary_tracing_session # starting my exemplary tracing session<br>
>>><br>
>>> The exemplary tracing session is written by the help of the c Api<br>
>>> (appendix).<br>
>>><br>
>><br>
>> I modified your script to add 'tp:tptest' (a tracepoint from the<br>
>> lttng-tools test suite program gen-ust-events) and did the following:<br>
>><br>
>> ```<br>
>> $ lttng-sessiond --background --verbose-consumer -vvv &> sessiond.log<br>
>> $ ./exemplary_tracing_session &<br>
>> $ lttng-tools/./tests/utils/testapp/gen-ust-events/gen-ust-events<br>
>> babeltrace2 /tmp/structural_traces | wc -l<br>
>> 100<br>
>> ```<br>
>><br>
>> It seems to be working fine for me. A couple of notes:<br>
>><br>
>> 1. Before any traced application is run, babeltrace2 has the following<br>
>> error output: No trace was found based on input `/tmp/structural_traces`<br>
>> 2. After a traced application is run whether is produces enabled events<br>
>> or not, I see the events recorded.<br>
>> 3. When your session script stops, the output folder is deleted.<br>
>><br>
>>> I started the the same procedure on another machine. The same fault<br>
>><br>
>> The fault is that the babeltrace2 has an error, right? Are you willing<br>
>> to share your trace that has the problem and/or show the output of<br>
>> babeltrace2's error?<br>
>><br>
>>> occurred. I think I need to configure more within the `lttngDomain`. But<br>
>> I<br>
>>> don't know how, would you have an idea/hint?<br>
>>><br>
>>> Thanks for your help.<br>
>>><br>
>>> Best regards,<br>
>>> Georg<br>
>>><br>
>>> Ps.: I also added the log of my tracing tool (structural.log)<br>
>>><br>
>>> Never burn the bridges before you<br>
>>> If you've burned the bridges behind<br>
>>> Never burn the one that you're walking upon<br>
>>> Or you're sure to hit the water in time. *(Savatage, Streets, 1991)*<br>
>>><br>
>>><br>
>>> Am Mo., 23. Juni 2025 um 16:26 Uhr schrieb Kienan Stewart <<br>
>>> <a href="mailto:kstewart@efficios.com" rel="noreferrer noreferrer" target="_blank">kstewart@efficios.com</a>>:<br>
>>><br>
>>>> Hi Georg,<br>
>>>><br>
>>>> a good first step is to run lttng-session with `-vvv --verbose-consumer`<br>
>>>> and inspect the log file and `LTTNG_UST_DEBUG=1` in the environment.<br>
>>>><br>
>>>> It may also be useful to run your traced applications with<br>
>>>> `LTTNG_UST_DEBUG=1` set in the environment.<br>
>>>><br>
>>>> Do you have steps that reproduce the issue? E.g., all the commands to<br>
>>>> set up the tracing session and so forth.<br>
>>>><br>
>>>> thanks,<br>
>>>> kienan<br>
>>>><br>
>>>> On 6/19/25 10:58 AM, Georg Muck via lttng-dev wrote:<br>
>>>>> Hey,<br>
>>>>><br>
>>>>> I am using the LTTng tracer (2.13.11, C-API, rotation=1s) to trace my<br>
>>>> ROS2<br>
>>>>> system (userspace only). Everything works just fine within my Docker<br>
>>>>> Container (Ubuntu 24.04), but if I start the same procedure on the host<br>
>>>>> itself (also Ubuntu 24.04), it does not create a TraceFile if to many<br>
>>>>> tracepoints occur (speaking of roundabout 1500+ per second) (sometimes<br>
>> it<br>
>>>>> malformed the tracefile, but I was not able to recreate that. If I<br>
>>>> remember<br>
>>>>> correctly, Babeltrace2 threw an error that said that there was no<br>
>>>>> metadata-file). I played around with some configurations (like<br>
>> increasing<br>
>>>>> the buffer size from ~16kB to ~512kB or a less aggressive rotation),<br>
>> but<br>
>>>>> the problem stayed.<br>
>>>>><br>
>>>>> Would be thankful for help. I guess I delivered to less information,<br>
>>>> please<br>
>>>>> reach out what is interesting at this point, I am not sure about that<br>
>> :).<br>
>>>>><br>
>>>>> Best regards,<br>
>>>>> Georg<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> Never burn the bridges before you<br>
>>>>> If you've burned the bridges behind<br>
>>>>> Never burn the one that you're walking upon<br>
>>>>> Or you're sure to hit the water in time. *(Savatage, Streets, 1991)*<br>
>>>>><br>
>>>><br>
>>>><br>
>>><br>
>><br>
>> thanks,<br>
>> kienan<br>
>><br>
>> [1]: <a href="https://lttng.org/man/8/lttng-sessiond/v2.13/#doc-opt--daemonize" rel="noreferrer noreferrer noreferrer" target="_blank">https://lttng.org/man/8/lttng-sessiond/v2.13/#doc-opt--daemonize</a><br>
>><br>
> <br>
<br>
</blockquote></div>