Adding new events / streams to an existing trace?
Alec Rivers
alec at shapertools.com
Tue Jul 22 02:21:48 EDT 2025
Hello,
I am trying to process an LTTng trace using babeltrace2's Python API. What
I want to do is add a new stream of events to an existing trace. My
approach is to create a custom source component that reads the existing
trace and forwards existing messages unchanged, but adds (interleaves, in
fact) some new events in a new stream.
So I have a custom UserMessageIterator that holds
a TraceCollectionMessageIterator that is reading from the original trace.
But if I output the unchanged events from the input iterator, that means
those events have a pre-baked trace and pre-baked trace class, to which I
am unable to add streams. (It seems that the C API may allow this, but the
Python one does not.) I could create a new trace class and a new stream for
my synthetic events, but then I'd have two parallel traces, and that's not
what I want (or is it? I'm new to all this).
For context, what I'm trying to achieve is to debug some erratic behavior
in an embedded Linux application, and I decided I'd like to see the
syscalls in the Flame Chart view in Trace Compass. So I'm my utility reads
all the syscall_entry_* and syscall_exit_* events and generates
corresponding func_entry and func_exit events. That part works fine -- but
getting the events into a trace alongside the existing events is what's
stymying me.
Thanks in advance for any help,
Alec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20250721/83262dc7/attachment-0001.htm>
More information about the lttng-dev
mailing list