Message ID | 20240613-dev-andyc-dyn-ftrace-v4-v1-2-1a538e12c01e@sifive.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | riscv: ftrace: atmoic patching and preempt improvements | expand |
On Thu, 13 Jun 2024 15:11:07 +0800 Andy Chiu <andy.chiu@sifive.com> wrote: > kernel_text_address() and __kernel_text_address() are called in > arch_stack_walk() of riscv. This results in excess amount of un-related > traces when the kernel is compiled with CONFIG_TRACE_IRQFLAGS. The > situation worsens when function_graph is active, as it calls > local_irq_save/restore in each function's entry/exit. This patch adds > both functions to notrace, so they won't show up on the trace records. I rather not add notrace just because something is noisy. You can always just add: echo '*kernel_text_address' > /sys/kernel/tracing/set_ftrace_notrace and achieve the same result. -- Steve
On Thu, Jun 13, 2024 at 9:32 PM Steven Rostedt <rostedt@goodmis.org> wrote: > > On Thu, 13 Jun 2024 15:11:07 +0800 > Andy Chiu <andy.chiu@sifive.com> wrote: > > > kernel_text_address() and __kernel_text_address() are called in > > arch_stack_walk() of riscv. This results in excess amount of un-related > > traces when the kernel is compiled with CONFIG_TRACE_IRQFLAGS. The > > situation worsens when function_graph is active, as it calls > > local_irq_save/restore in each function's entry/exit. This patch adds > > both functions to notrace, so they won't show up on the trace records. > > I rather not add notrace just because something is noisy. > > You can always just add: > > echo '*kernel_text_address' > /sys/kernel/tracing/set_ftrace_notrace > > and achieve the same result. Sounds good, I am going to drop this patch for the next revision > > -- Steve Thanks, Andy
diff --git a/kernel/extable.c b/kernel/extable.c index 71f482581cab..d03fa462fa8b 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -74,7 +74,7 @@ int notrace core_kernel_text(unsigned long addr) return 0; } -int __kernel_text_address(unsigned long addr) +int notrace __kernel_text_address(unsigned long addr) { if (kernel_text_address(addr)) return 1; @@ -91,7 +91,7 @@ int __kernel_text_address(unsigned long addr) return 0; } -int kernel_text_address(unsigned long addr) +int notrace kernel_text_address(unsigned long addr) { bool no_rcu; int ret = 1;
kernel_text_address() and __kernel_text_address() are called in arch_stack_walk() of riscv. This results in excess amount of un-related traces when the kernel is compiled with CONFIG_TRACE_IRQFLAGS. The situation worsens when function_graph is active, as it calls local_irq_save/restore in each function's entry/exit. This patch adds both functions to notrace, so they won't show up on the trace records. Signed-off-by: Andy Chiu <andy.chiu@sifive.com> --- kernel/extable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)