Re: [PATCH 2/2] tracing: Keep pid and comm[] in the same structure
From: Steven Rostedt
Date: Wed Jul 01 2026 - 06:39:42 EST
On Wed, 1 Jul 2026 11:04:07 +0100
David Laight <david.laight.linux@xxxxxxxxx> wrote:
>
> I thought it was just used to do a pid->string lookup when you run 'cat trace'.
> But then I found the code that lets userspace read the table....
> I guess the latter is used by the userspace code that reads the raw trace buffer.
Yes, trace-cmd uses it.
> (I found some instructions that did it that way, the output was unparseable
> when tracing things that are happening on multiple cpu.)
> The userspace code could probably be given comm[] for all the running
> processes and those that exited while tracing_on() set.
> (I didn't see anything that would clear the table when the trace buffer
> was cleared.)
Well, that would break trace-cmd. As reading the raw buffers clears the
trace, and trace-cmd reads the saved_cmdlines file *after* it reads the
trace, as during the trace it gets populated.
-- Steve