mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tracing, function graph: Remove the noisy output when use function graph filter
@ 2010-06-17  8:58 Lai Jiangshan
  2010-06-17 15:55 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2010-06-17  8:58 UTC (permalink / raw)
  To: Steven Rostedt, Frederic Weisbecker, LKML, Ingo Molnar

If we use function graph filter(echo some_functions >> set_graph_function)
we are only interested in the graph of some_functions.

But if a interrupt occurs when these functions are being traced(or preparing),
the graphs of the handlers of this interrupt are also recorded.
These events that we aren't interested in are totally noisy.

This patch remove them(very very seldom noise is still left,
It's OK for tracing, doesn't it?).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 79f4bac..9c130b3 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -12,6 +12,8 @@
 #include <linux/slab.h>
 #include <linux/fs.h>
 
+#include <asm/irq_regs.h>
+
 #include "trace.h"
 #include "trace_output.h"
 
@@ -213,13 +215,19 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
 	int ret;
 	int cpu;
 	int pc;
+	int depth = trace->depth;
+	unsigned long long cntxt = (unsigned long)(void *)get_irq_regs();
 
 	if (!ftrace_trace_task(current))
 		return 0;
 
 	/* trace it when it is-nested-in or is a function enabled. */
-	if (!(trace->depth || ftrace_graph_addr(trace->func)))
-		return 0;
+	if (!ftrace_graph_addr(trace->func)) {
+		if (!depth || current->ret_stack[depth - 1].subtime != cntxt)
+			return 0;
+	}
+	/* We don't use subtime here, reuse it to save context. */
+	current->ret_stack[depth].subtime = cntxt;
 
 	local_irq_save(flags);
 	cpu = raw_smp_processor_id();

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

end of thread, other threads:[~2010-06-17 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-17  8:58 [PATCH] tracing, function graph: Remove the noisy output when use function graph filter Lai Jiangshan
2010-06-17 15:55 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®