Hello all, I am currently facing the issue of having to efficiently read the events from a user-space application for tracing for programmatic use in automotive (AUTOSAR AP). It is for programmatically reacting to events on the system, and I am currently using the trace_pipe_raw to do that, to reduce the overhead compared with parsing the textual output of trace_pipe. After merging the sorted streams from all cpus, in order to reconstruct the task state, we are still way more CPU-efficient compared with using the textual output. I would like to make use of the implemented support for recording tgids, commit d914ba37d714 ("tracing: Add support for recording tgid of tasks") commit 441dae8f2f29 ("tracing: Add support for display of tgid in trace output") but it seems to me that, while for COMM recording there is explicit support in the binary events for the information, it seems that tgid is not stored in the binary format. Is such an extension of the binary format a possibility for sched-class events, that takes into account backward compatibility, or is there some better way to do it? Is this problem addressed by libtracevent / trace-cmd? Currently I was thinking to look into the NETLINK interface to get the task information, however the issue is the race condition between the time of tracing and the time of reading the trace, to be fully correct, but if nothing else is possible I will have to accept the compromise. Thank you for any hints on this. Ciao, Claudio
![]() |