Skip to contentSkip to conversation

tracing/function-graph-tracer: drop the kernel_text_address check

PATCH Superseded Frederic Weisbecker 1 participant 1 message Jan 22, 2009

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 tracing/function-graph-tracer: drop the kernel_text_address check

When the function graph tracer picks a return address, it ensures this address is really a kernel text one by calling __kernel_text_address()
Actually this path has never been taken. Its role was more likely to debug the tracer on the beginning of its development but this function is wasteful since it is called for every traced function.

The fault check is already sufficient.

---
 arch/x86/kernel/ftrace.c |    7 -------
 kernel/extable.c         |    4 ++--
 kernel/module.c          |    2 +-
 3 files changed, 3 insertions(+), 10 deletions(-)
arch/x86/kernel/ftrace.c +0 -7
index 1b43086..838ff7c 100644
@@ -511,13 +511,6 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
 		return;
 	}
 
-	if (unlikely(!__kernel_text_address(old))) {
-		ftrace_graph_stop();
-		*parent = old;
-		WARN_ON(1);
-		return;
-	}
-
 	calltime = cpu_clock(raw_smp_processor_id());
 
 	if (push_return_trace(old, calltime,
kernel/extable.c +2 -2
index e136ed8..0df6253 100644
@@ -41,7 +41,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
 	return e;
 }
 
-__notrace_funcgraph int core_kernel_text(unsigned long addr)
+int core_kernel_text(unsigned long addr)
 {
 	if (addr >= (unsigned long)_stext &&
 	    addr <= (unsigned long)_etext)
@@ -54,7 +54,7 @@ __notrace_funcgraph int core_kernel_text(unsigned long addr)
 	return 0;
 }
 
-__notrace_funcgraph int __kernel_text_address(unsigned long addr)
+int __kernel_text_address(unsigned long addr)
 {
 	if (core_kernel_text(addr))
 		return 1;
kernel/module.c +1 -1
index e8b51d4..b60e5ab 100644
@@ -2720,7 +2720,7 @@ int is_module_address(unsigned long addr)
 
 
 /* Is this a valid kernel address? */
-__notrace_funcgraph struct module *__module_text_address(unsigned long addr)
+struct module *__module_text_address(unsigned long addr)
 {
 	struct module *mod;
 
Signature · 1 line
1.6.0.4