aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-02-12 23:46:51 -0500
committerSteven Rostedt <rostedt@goodmis.org>2015-02-12 23:46:51 -0500
commitce85233674ba2b207da68778ba30e6dc1daeeff6 (patch)
tree78dea30aa9d0eb94573394f22be4b70c59714351
parent02c326f441360549311698af9f1b3edb543ce514 (diff)
downloadtrace-cmd-ce85233674ba2b207da68778ba30e6dc1daeeff6.tar.gz
trace-cmd profile: Fix spurious stacktraces from wakeup event
If a wakeup event occurred when a task was not "asleep", which could happen from dropped events, the wake up is ignored. But if the proxy task does not have its last-event removed, and if a stack trace occurs after the wakeup event, it will be hooked to whatever was the proxy tasks's last event. This caused the output to show spurious stack traces for various events (mostly the timer softirq). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-profile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/trace-profile.c b/trace-profile.c
index f19bfb40..f71a7c68 100644
--- a/trace-profile.c
+++ b/trace-profile.c
@@ -1136,8 +1136,13 @@ static int handle_sched_wakeup_event(struct handle_data *h,
add_task_comm(task, h->wakeup_comm, record);
/* if the task isn't sleeping, then ignore the wake up */
- if (!task->sleeping)
+ if (!task->sleeping) {
+ /* Ignore any following stack traces */
+ proxy->proxy = NULL;
+ proxy->last_start = NULL;
+ proxy->last_event = NULL;
return 0;
+ }
/* It's being woken up */
task->sleeping = 0;