diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/events/core.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index fe88d6eea3c2..fd89000c9bf5 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -8682,13 +8682,12 @@ static void perf_event_switch(struct task_struct *task, }, }; - if (!sched_in && task->state == TASK_RUNNING) + if (!sched_in && task->on_rq) { switch_event.event_id.header.misc |= PERF_RECORD_MISC_SWITCH_OUT_PREEMPT; + } - perf_iterate_sb(perf_event_switch_output, - &switch_event, - NULL); + perf_iterate_sb(perf_event_switch_output, &switch_event, NULL); } /* |