diff mbox series

tracing: fix compile failure on RT with PREEMPT_RT off

Message ID 20201010214554.389157-1-clrkwllms@kernel.org
State New
Headers show
Series tracing: fix compile failure on RT with PREEMPT_RT off | expand

Commit Message

Clark Williams Oct. 10, 2020, 9:45 p.m. UTC
This patch is against v5.9-rc8-rt14

Fix a compile issue when CONFIG_PREEMPT_RT is not defined. If
we're not on an RT kernel, just set the migration disabled
status to zero.

Signed-off-by: Clark Williams <clrkwllms@kernel.org>
---
 kernel/trace/trace.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Sebastian Andrzej Siewior Oct. 12, 2020, 10:12 a.m. UTC | #1
On 2020-10-10 16:45:54 [-0500], Clark Williams wrote:
> This patch is against v5.9-rc8-rt14

> 

> Fix a compile issue when CONFIG_PREEMPT_RT is not defined. If

> we're not on an RT kernel, just set the migration disabled

> status to zero.


Thank you. Let me fold it where it belongs. As of now, I don't know if
we can keep it or have to use the trace events Peter made.

> Signed-off-by: Clark Williams <clrkwllms@kernel.org>


Sebastian
diff mbox series

Patch

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index aa7f3bef6d4f..896573d39baf 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2437,6 +2437,16 @@  enum print_line_t trace_handle_return(struct trace_seq *s)
 }
 EXPORT_SYMBOL_GPL(trace_handle_return);
 
+static inline unsigned short
+migration_disable_value(struct task_struct *tsk)
+{
+#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT)
+	return (tsk) ? tsk->migration_disabled : 0;
+#else
+	return 0;
+#endif
+}
+
 void
 tracing_generic_entry_update(struct trace_entry *entry, unsigned short type,
 			     unsigned long flags, int pc)
@@ -2460,7 +2470,7 @@  tracing_generic_entry_update(struct trace_entry *entry, unsigned short type,
 		(need_resched_lazy() ? TRACE_FLAG_NEED_RESCHED_LAZY : 0) |
 		(test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0);
 
-	entry->migrate_disable = (tsk) ? tsk->migration_disabled & 0xFF : 0;
+	entry->migrate_disable = migration_disable_value(tsk) & 0xFF : 0;
 }
 EXPORT_SYMBOL_GPL(tracing_generic_entry_update);