[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241106102856.00ad694e@gandalf.local.home>
Date: Wed, 6 Nov 2024 10:28:56 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Marco Elver <elver@...gle.com>
Cc: Kees Cook <keescook@...omium.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Andrew Morton <akpm@...ux-foundation.org>, Oleg Nesterov <oleg@...hat.com>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Dmitry
Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com
Subject: Re: [PATCH] tracing: Add task_prctl_unknown tracepoint
On Wed, 6 Nov 2024 10:18:23 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> > Some trial and error led me to conclude it's a race between the logic
> > looking up the comm and the process exiting: If the test program exits
> > soon after the traced event, it doesn't print the comm. Adding a
> > generous usleep() before it exits reliably prints the comm.
>
> Thanks for letting me know. Let me see if I can fix that!
Hmm, that still doesn't make sense. Is this just a single line or do you
have other events being recorded?
The way the caching works is during the sched_switch tracepoint which still
gets called when the task exits. If a trace event is triggered, it sets a
per cpu flags to have the next sched_switch record the comm for both the
previous and next tasks.
Now the reason it can miss is that there's contention on the lock that
saves the comms (it does a trylock and if it fails, it just skips it). Or
if another task hits the same "comm cache line".
This is why I wonder if you have other events being traced.
-- Steve
Powered by blists - more mailing lists