From: Mete Durlu <meted@linux.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Sven Schnelle <svens@linux.ibm.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: use ring_buffer_record_is_set_on() in tracer_tracing_is_on()
Date: Wed, 7 Feb 2024 13:07:36 +0100 [thread overview]
Message-ID: <9a062196-ccbe-440e-a2f9-23eb8c5eb837@linux.ibm.com> (raw)
In-Reply-To: <20240207060923.182ecb55@rorschach.local.home>
On 2/7/24 12:09, Steven Rostedt wrote:
> On Wed, 07 Feb 2024 06:50:59 +0100
> Sven Schnelle <svens@linux.ibm.com> wrote:
>
>> Hi Steven,
>
>> Not sure whether that is enough, have to test. However, it's not really
>> a fix, it would just require a bit more load and the test would fail
>> again. The fundamental problem is that even after disabling tracing
>> there might be some tracing line added due to the lockless nature of
>> the ringbuffer. This might then replace some existing cmdline entry.
>> So maybe we should change the test to ignore the program name when
>> calculating the checksums.
>
> Have you figured out what caused the cmdlines to change when tracing is
> off. It shouldn't be updated even with just 128 entries.
>
> I'm also looking into a way to keep more of a LRU command lines around,
> but nothing concrete yet.
>
> -- Steve
Hi,
wouldn't the following scenario explain the behavior we are seeing.
When using event triggers, trace uses lockless ringbuffer control paths.
If cmdline update and trace output reading is happening on different
cpus, the ordering can get messed up.
1. event happens and trace trigger tells ring buffer to stop writes
2. (on cpu#1)test calculates checksum on current state of trace
output.
3. (on cpu#2)not knowing about the trace buffers status yet, writer adds
a one last entry which would collide with a pid in cmdline map before
actually stopping. While (on cpu#1) checksum is being calculated, new
saved cmdlines entry is waiting for spinlocks to be unlocked and then
gets added.
4. test calculates checksum again and finds that the trace output has
changed. <...> is put on collided pid.
next prev parent reply other threads:[~2024-02-07 12:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 6:53 Sven Schnelle
2024-02-05 12:55 ` Steven Rostedt
2024-02-05 13:16 ` Sven Schnelle
2024-02-05 14:23 ` Steven Rostedt
2024-02-05 15:09 ` Sven Schnelle
2024-02-06 6:32 ` Sven Schnelle
2024-02-06 8:48 ` Sven Schnelle
2024-02-06 11:01 ` Steven Rostedt
2024-02-07 5:50 ` Sven Schnelle
2024-02-07 11:09 ` Steven Rostedt
2024-02-07 12:07 ` Mete Durlu [this message]
2024-02-07 12:28 ` Steven Rostedt
2024-02-07 13:33 ` Sven Schnelle
2024-02-07 15:47 ` Steven Rostedt
2024-02-08 10:25 ` Mete Durlu
2024-02-12 18:53 ` Steven Rostedt
2024-02-12 22:54 ` Mete Durlu
2024-02-12 23:12 ` Steven Rostedt
2024-02-06 7:05 ` Mete Durlu
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=9a062196-ccbe-440e-a2f9-23eb8c5eb837@linux.ibm.com \
--to=meted@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=svens@linux.ibm.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
Powered by JetHome