From: Steven Rostedt <rostedt@goodmis.org>
To: David Laight <david.laight.linux@gmail.com>
Cc: "Masami Hiramatsu" <mhiramat@kernel.org>,
"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
"Michal Koutný" <mkoutny@suse.com>
Subject: Re: [PATCH 2/2] tracing: Keep pid and comm[] in the same structure
Date: Wed, 1 Jul 2026 08:23:40 -0400 [thread overview]
Message-ID: <20260701082340.5b0bd4e7@gandalf.local.home> (raw)
In-Reply-To: <20260701130404.3887c0e5@pumpkin>
On Wed, 1 Jul 2026 13:04:04 +0100
David Laight <david.laight.linux@gmail.com> wrote:
> > 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.
>
> So you'd need to clear it when tracing is enabled after the buffer is cleared.
> Just a matter of getting the timing right.
Why? Note, saved_cmdlines is for *all* instances. You can have multiple
instances tracing different things and they still all use the one
saved_cmdlines file. It's not tied to any specific buffer. It's a cache. It
gets populated at the next schedule switch after an event occurs.
>
> If trace-cmd is currently given all 6000 entries (if you've run tracing for
> long enough), then giving it all the active processes isn't going to be any
> more of a problem.
I'm much more concerned about losing processes that were traced! A lot of
tracing happens to tasks while running hackbench. Hackbench isn't being
traced, but if we record it, it will blow away all the cache and we lose
the task names we care about.
> So you could just save comm[] in the process exit path when the trace buffer
> is non-empty, or better those started before tracing was last stopped.
Again, which tracer? You can have multiple instances.
> You'd need to give trace-cmd the active ones first and delete the entry
> from the cache because the pid might have been reused.
>
> All just needs some coding, testing, and fixing of corner cases.
What exactly are you trying to solve? This hasn't been perfect, but it's
been good enough since 2009.
-- Steve
next prev parent reply other threads:[~2026-07-01 12:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 21:23 [PATCH rfc 0/2] Improvements to ftrace comm[] handling David Laight
2026-06-26 21:23 ` [PATCH 1/2] tracing: Embed 'char comm[16]' in a structure David Laight
2026-06-29 20:26 ` Steven Rostedt
2026-06-30 9:26 ` David Laight
2026-06-26 21:23 ` [PATCH 2/2] tracing: Keep pid and comm[] in the same structure David Laight
2026-06-29 20:49 ` Steven Rostedt
2026-06-30 10:01 ` David Laight
2026-06-30 19:03 ` Steven Rostedt
2026-07-01 10:04 ` David Laight
2026-07-01 10:38 ` Steven Rostedt
2026-07-01 12:04 ` David Laight
2026-07-01 12:23 ` Steven Rostedt [this message]
2026-07-01 16:52 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260701082340.5b0bd4e7@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=david.laight.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mkoutny@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox