aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/events/sched.h')
-rw-r--r--include/trace/events/sched.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 0a68d5ae584e..30fedaf3e56a 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -97,16 +97,19 @@ static inline long __trace_sched_switch_state(struct task_struct *p)
97 long state = p->state; 97 long state = p->state;
98 98
99#ifdef CONFIG_PREEMPT 99#ifdef CONFIG_PREEMPT
100#ifdef CONFIG_SCHED_DEBUG
101 BUG_ON(p != current);
102#endif /* CONFIG_SCHED_DEBUG */
100 /* 103 /*
101 * For all intents and purposes a preempted task is a running task. 104 * For all intents and purposes a preempted task is a running task.
102 */ 105 */
103 if (task_preempt_count(p) & PREEMPT_ACTIVE) 106 if (preempt_count() & PREEMPT_ACTIVE)
104 state = TASK_RUNNING | TASK_STATE_MAX; 107 state = TASK_RUNNING | TASK_STATE_MAX;
105#endif 108#endif /* CONFIG_PREEMPT */
106 109
107 return state; 110 return state;
108} 111}
109#endif 112#endif /* CREATE_TRACE_POINTS */
110 113
111/* 114/*
112 * Tracepoint for task switches, performed by the scheduler: 115 * Tracepoint for task switches, performed by the scheduler: