aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-12-19 12:54:19 -0500
committerSteven Rostedt <rostedt@goodmis.org>2014-12-19 16:26:14 -0500
commit87e32497e7120eb6b7e8e95575c49e41fd132ce5 (patch)
treedbe89a7b346c4e2db5633fd21c5c84bece223a9f
parent99719c857de34c63b8c5812e0a929e9ed50e33cf (diff)
downloadtrace-cmd-rfc/profile.tar.gz
trace-cmd profile: Add function eventrfc/profile
Add a event_data for the function event. This will let users see the name of the function that was traced. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-profile.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/trace-profile.c b/trace-profile.c
index 2c42f8d2..4fe578fe 100644
--- a/trace-profile.c
+++ b/trace-profile.c
@@ -700,7 +700,7 @@ void mate_events(struct handle_data *h, struct event_data *start,
start->migrate = migrate;
}
-void fgraph_print(struct trace_seq *s, struct event_hash *event_hash)
+void func_print(struct trace_seq *s, struct event_hash *event_hash)
{
const char *func;
@@ -1035,7 +1035,7 @@ void trace_init_profile(struct tracecmd_input *handle)
if (fgraph_entry && fgraph_exit) {
mate_events(h, fgraph_entry, NULL, "func", fgraph_exit, "func", 1);
- fgraph_entry->print_func = fgraph_print;
+ fgraph_entry->print_func = func_print;
}
if (syscall_enter && syscall_exit)
@@ -1045,6 +1045,13 @@ void trace_init_profile(struct tracecmd_input *handle)
if (!events)
die("malloc");
+ /* Add some other events */
+ event_data = add_event(h, "ftrace", "function", EVENT_TYPE_FUNC);
+ if (event_data) {
+ event_data->data_field =
+ pevent_find_field(event_data->event, "ip");
+ }
+
/* Now add any defined event that we haven't processed */
for (i = 0; events[i]; i++) {
event_data = find_event_data(h, events[i]->id);
@@ -1455,6 +1462,8 @@ static void output_event(struct event_hash *event_hash)
if (event_data->print_func)
event_data->print_func(&s, event_hash);
+ else if (event_data->type == EVENT_TYPE_FUNC)
+ func_print(&s, event_hash);
else
trace_seq_printf(&s, "%s:%lld",
event_data->event->name,