Re: [PATCH 2/2] tracing: Keep pid and comm[] in the same structure
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2026-07-01 10:38:24
Also in:
lkml
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2026-07-01 10:38:24
Also in:
lkml
On Wed, 1 Jul 2026 11:04:07 +0100 David Laight [off-list ref] 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