aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-sched.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 686af633b35b..3e003237c42f 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -129,6 +129,7 @@ enum thread_state {
129struct work_atom { 129struct work_atom {
130 struct list_head list; 130 struct list_head list;
131 enum thread_state state; 131 enum thread_state state;
132 u64 sched_out_time;
132 u64 wake_up_time; 133 u64 wake_up_time;
133 u64 sched_in_time; 134 u64 sched_in_time;
134 u64 runtime; 135 u64 runtime;
@@ -988,9 +989,11 @@ lat_sched_out(struct task_atoms *atoms,
988 if (!atom) 989 if (!atom)
989 die("Non memory"); 990 die("Non memory");
990 991
992 atom->sched_out_time = timestamp;
993
991 if (sched_out_state(switch_event) == 'R') { 994 if (sched_out_state(switch_event) == 'R') {
992 atom->state = THREAD_WAIT_CPU; 995 atom->state = THREAD_WAIT_CPU;
993 atom->wake_up_time = timestamp; 996 atom->wake_up_time = atom->sched_out_time;
994 } 997 }
995 998
996 atom->runtime = delta; 999 atom->runtime = delta;
@@ -1106,6 +1109,9 @@ latency_wakeup_event(struct trace_wakeup_event *wakeup_event,
1106 if (atom->state != THREAD_SLEEPING) 1109 if (atom->state != THREAD_SLEEPING)
1107 return; 1110 return;
1108 1111
1112 if (atom->sched_out_time > timestamp)
1113 return;
1114
1109 atom->state = THREAD_WAIT_CPU; 1115 atom->state = THREAD_WAIT_CPU;
1110 atom->wake_up_time = timestamp; 1116 atom->wake_up_time = timestamp;
1111} 1117}