* [for-linus][PATCH 0/2] tracing: A couple of fixes for v6.8
@ 2024-02-13 23:14 Steven Rostedt
2024-02-13 23:14 ` [for-linus][PATCH 1/2] tracing: Fix HAVE_DYNAMIC_FTRACE_WITH_REGS ifdef Steven Rostedt
2024-02-13 23:14 ` [for-linus][PATCH 2/2] tracing: Use ring_buffer_record_is_set_on() in tracer_tracing_is_on() Steven Rostedt
0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2024-02-13 23:14 UTC (permalink / raw)
To: linux-kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, Andrew Morton
Two tracing fixes for v6.8:
- Fix the #ifndef that didn't have CONFIG_ on HAVE_DYNAMIC_FTRACE_WITH_REGS
The fix to have dynamic trampolines work with x86 broke arm64 as
the config used in the #ifdef was HAVE_DYNAMIC_FTRACE_WITH_REGS and not
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS which removed the fix that the
previous fix was to fix.
- Fix tracing_on state
The code to test if "tracing_on" is set used ring_buffer_record_is_on()
which returns false if the ring buffer isn't able to be written to.
But the ring buffer disable has several bits that disable it.
One is internal disabling which is used for resizing and other
modifications of the ring buffer. But the "tracing_on" user space
visibile flag should only report if tracing is actually on and not
internally disabled, as this can cause confusion as writing "1"
when it is disabled will not enable it.
Instead use ring_buffer_record_is_set_on() which shows the user space
visible settings.
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/urgent
Head SHA1: a6eaa24f1cc2c7aecec6047556bdfe32042094c3
Petr Pavlu (1):
tracing: Fix HAVE_DYNAMIC_FTRACE_WITH_REGS ifdef
Sven Schnelle (1):
tracing: Use ring_buffer_record_is_set_on() in tracer_tracing_is_on()
----
kernel/trace/ftrace.c | 2 +-
kernel/trace/trace.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [for-linus][PATCH 1/2] tracing: Fix HAVE_DYNAMIC_FTRACE_WITH_REGS ifdef
2024-02-13 23:14 [for-linus][PATCH 0/2] tracing: A couple of fixes for v6.8 Steven Rostedt
@ 2024-02-13 23:14 ` Steven Rostedt
2024-02-13 23:14 ` [for-linus][PATCH 2/2] tracing: Use ring_buffer_record_is_set_on() in tracer_tracing_is_on() Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2024-02-13 23:14 UTC (permalink / raw)
To: linux-kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, Andrew Morton,
Petr Pavlu
From: Petr Pavlu <petr.pavlu@suse.com>
Commit a8b9cf62ade1 ("ftrace: Fix DIRECT_CALLS to use SAVE_REGS by
default") attempted to fix an issue with direct trampolines on x86, see
its description for details. However, it wrongly referenced the
HAVE_DYNAMIC_FTRACE_WITH_REGS config option and the problem is still
present.
Add the missing "CONFIG_" prefix for the logic to work as intended.
Link: https://lore.kernel.org/linux-trace-kernel/20240213132434.22537-1-petr.pavlu@suse.com
Fixes: a8b9cf62ade1 ("ftrace: Fix DIRECT_CALLS to use SAVE_REGS by default")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index c060d5b47910..83ba342aef31 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5331,7 +5331,7 @@ static int register_ftrace_function_nolock(struct ftrace_ops *ops);
* not support ftrace_regs_caller but direct_call, use SAVE_ARGS so that it
* jumps from ftrace_caller for multiple ftrace_ops.
*/
-#ifndef HAVE_DYNAMIC_FTRACE_WITH_REGS
+#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS
#define MULTI_FLAGS (FTRACE_OPS_FL_DIRECT | FTRACE_OPS_FL_SAVE_ARGS)
#else
#define MULTI_FLAGS (FTRACE_OPS_FL_DIRECT | FTRACE_OPS_FL_SAVE_REGS)
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [for-linus][PATCH 2/2] tracing: Use ring_buffer_record_is_set_on() in tracer_tracing_is_on()
2024-02-13 23:14 [for-linus][PATCH 0/2] tracing: A couple of fixes for v6.8 Steven Rostedt
2024-02-13 23:14 ` [for-linus][PATCH 1/2] tracing: Fix HAVE_DYNAMIC_FTRACE_WITH_REGS ifdef Steven Rostedt
@ 2024-02-13 23:14 ` Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2024-02-13 23:14 UTC (permalink / raw)
To: linux-kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, Andrew Morton,
Mete Durlu, Sven Schnelle
From: Sven Schnelle <svens@linux.ibm.com>
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.
Link: https://lore.kernel.org/linux-trace-kernel/20240205065340.2848065-1-svens@linux.ibm.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tested-By: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
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 9ff8a439d674..aa54810e8b56 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.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-13 23:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 23:14 [for-linus][PATCH 0/2] tracing: A couple of fixes for v6.8 Steven Rostedt
2024-02-13 23:14 ` [for-linus][PATCH 1/2] tracing: Fix HAVE_DYNAMIC_FTRACE_WITH_REGS ifdef Steven Rostedt
2024-02-13 23:14 ` [for-linus][PATCH 2/2] tracing: Use ring_buffer_record_is_set_on() in tracer_tracing_is_on() Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox