Skip to content

Commit 089c02a

Browse files
Valentin SchneiderPeter Zijlstra
authored andcommitted
ftrace: Use preemption model accessors for trace header printout
Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual preemption model of the live kernel. Use the newly-introduced accessors instead. Signed-off-by: Valentin Schneider <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Steven Rostedt (VMware) <[email protected]> Acked-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5693fa7 commit 089c02a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

kernel/trace/trace.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4289,17 +4289,11 @@ print_trace_header(struct seq_file *m, struct trace_iterator *iter)
42894289
entries,
42904290
total,
42914291
buf->cpu,
4292-
#if defined(CONFIG_PREEMPT_NONE)
4293-
"server",
4294-
#elif defined(CONFIG_PREEMPT_VOLUNTARY)
4295-
"desktop",
4296-
#elif defined(CONFIG_PREEMPT)
4297-
"preempt",
4298-
#elif defined(CONFIG_PREEMPT_RT)
4299-
"preempt_rt",
4300-
#else
4292+
preempt_model_none() ? "server" :
4293+
preempt_model_voluntary() ? "desktop" :
4294+
preempt_model_full() ? "preempt" :
4295+
preempt_model_rt() ? "preempt_rt" :
43014296
"unknown",
4302-
#endif
43034297
/* These are reserved for later use */
43044298
0, 0, 0, 0);
43054299
#ifdef CONFIG_SMP

0 commit comments

Comments
 (0)