linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing: use ring_buffer_record_is_set_on() in tracer_tracing_is_on()
@ 2024-02-05  6:53 Sven Schnelle
  2024-02-05 12:55 ` Steven Rostedt
  2024-02-06  7:05 ` Mete Durlu
  0 siblings, 2 replies; 19+ messages in thread
From: Sven Schnelle @ 2024-02-05  6:53 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers
  Cc: linux-kernel, linux-trace-kernel, Mete Durlu

tracer_tracing_is_on() checks whether record_disabled is not zero. This
checks both the record_disabled counter and the RB_BUFFER_OFF flag.
Reading the source it looks like this function should only check for
the RB_BUFFER_OFF flag. Therefore use ring_buffer_record_is_set_on().
This fixes spurious fails in the 'test for function traceon/off triggers'
test from the ftrace testsuite when the system is under load.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2a7c6fd934e9..47e221e1e720 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1532,7 +1532,7 @@ void disable_trace_on_warning(void)
 bool tracer_tracing_is_on(struct trace_array *tr)
 {
 	if (tr->array_buffer.buffer)
-		return ring_buffer_record_is_on(tr->array_buffer.buffer);
+		return ring_buffer_record_is_set_on(tr->array_buffer.buffer);
 	return !tr->buffer_disabled;
 }
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-02-12 23:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05  6:53 [PATCH] tracing: use ring_buffer_record_is_set_on() in tracer_tracing_is_on() 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).