[PATCH] tracing: Increase stack skip on event trigger

From: Namhyung Kim
Date: Wed Mar 25 2015 - 20:46:10 EST


When 'stacktrace' trigger is used for event tracing, it should skip 4
functions instead of 3. Otherwise it'll contain ftrace_raw_event_XXX
like below:

# echo stacktrace > events/sched/sched_switch/trigger
# tail trace
=> rcu_gp_kthread
=> kthread
=> ret_from_fork
ksoftirqd/0-3 [000] d..3 53.343993: <stack trace>
=> ftrace_raw_event_sched_switch
=> __schedule
=> schedule
=> smpboot_thread_fn
=> kthread
=> ret_from_fork

Reported-by: Minchan Kim <minchan@xxxxxxxxxx>
Cc: Tom Zanussi <tom.zanussi@xxxxxxxxxxxxxxx>
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
kernel/trace/trace_events_trigger.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
index 8712df9decb4..c58fbdd3053e 100644
--- a/kernel/trace/trace_events_trigger.c
+++ b/kernel/trace/trace_events_trigger.c
@@ -965,12 +965,13 @@ static __init int register_trigger_snapshot_cmd(void) { return 0; }

#ifdef CONFIG_STACKTRACE
/*
- * Skip 3:
+ * Skip 4:
* stacktrace_trigger()
* event_triggers_post_call()
+ * ftrace_event_buffer_commit()
* ftrace_raw_event_xxx()
*/
-#define STACK_SKIP 3
+#define STACK_SKIP 4

static void
stacktrace_trigger(struct event_trigger_data *data)
--
2.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/