[tip:tracing/core] tracing: Add ftrace events for graph tracer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: tip-bot for Jiri Olsa
Date: Friday, April 30, 2010 - 1:45 am

Commit-ID:  9106b69382912ddc403a307b69bf894a6f3004e4
Gitweb:     http://git.kernel.org/tip/9106b69382912ddc403a307b69bf894a6f3004e4
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Fri, 2 Apr 2010 19:01:20 +0200
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Mon, 26 Apr 2010 16:55:08 -0400

tracing: Add ftrace events for graph tracer

Add ftrace events for graph tracer, so the graph output could be shared
with other tracers.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
LKML-Reference: <1270227683-14631-2-git-send-email-jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_functions_graph.c |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 669b9c3..db9e06b 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -40,7 +40,7 @@ struct fgraph_data {
 #define TRACE_GRAPH_PRINT_OVERHEAD	0x4
 #define TRACE_GRAPH_PRINT_PROC		0x8
 #define TRACE_GRAPH_PRINT_DURATION	0x10
-#define TRACE_GRAPH_PRINT_ABS_TIME	0X20
+#define TRACE_GRAPH_PRINT_ABS_TIME	0x20
 
 static struct tracer_opt trace_opts[] = {
 	/* Display overruns? (for self-debug purpose) */
@@ -1096,6 +1096,12 @@ print_graph_function(struct trace_iterator *iter)
 	return TRACE_TYPE_HANDLED;
 }
 
+static enum print_line_t
+print_graph_function_event(struct trace_iterator *iter, int flags)
+{
+	return print_graph_function(iter);
+}
+
 static void print_lat_header(struct seq_file *s)
 {
 	static const char spaces[] = "                "	/* 16 spaces */
@@ -1199,6 +1205,16 @@ static void graph_trace_close(struct trace_iterator *iter)
 	}
 }
 
+static struct trace_event graph_trace_entry_event = {
+	.type		= TRACE_GRAPH_ENT,
+	.trace		= print_graph_function_event,
+};
+
+static struct trace_event graph_trace_ret_event = {
+	.type		= TRACE_GRAPH_RET,
+	.trace		= print_graph_function_event,
+};
+
 static struct tracer graph_trace __read_mostly = {
 	.name		= "function_graph",
 	.open		= graph_trace_open,
@@ -1220,6 +1236,16 @@ static __init int init_graph_trace(void)
 {
 	max_bytes_for_cpu = snprintf(NULL, 0, "%d", nr_cpu_ids - 1);
 
+	if (!register_ftrace_event(&graph_trace_entry_event)) {
+		pr_warning("Warning: could not register graph trace events\n");
+		return 1;
+	}
+
+	if (!register_ftrace_event(&graph_trace_ret_event)) {
+		pr_warning("Warning: could not register graph trace events\n");
+		return 1;
+	}
+
 	return register_tracer(&graph_trace);
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCHv6 3/4] tracing: graph output support for irqsof ..., Frederic Weisbecker, (Mon Apr 12, 4:33 pm)
Re: [PATCHv6 3/4] tracing: graph output support for irqsof ..., Frederic Weisbecker, (Thu Apr 15, 12:50 pm)
[tip:tracing/core] tracing: Add ftrace events for graph tracer, tip-bot for Jiri Olsa, (Fri Apr 30, 1:45 am)
[tip:tracing/core] tracing: Have graph flags passed in to ..., tip-bot for Jiri Olsa, (Fri Apr 30, 1:45 am)
[tip:tracing/core] tracing: Add graph output support for i ..., tip-bot for Jiri Olsa, (Fri Apr 30, 1:46 am)