Linux-rt-users Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] tracing: fix compile failure on RT with PREEMPT_RT off
@ 2020-10-10 21:45 Clark Williams
  2020-10-12 10:12 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 2+ messages in thread
From: Clark Williams @ 2020-10-10 21:45 UTC (permalink / raw)
  To: rostedt; +Cc: bigeasy, linux-rt-users, linux-kernel

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(-)

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);
 
-- 
2.28.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] tracing: fix compile failure on RT with PREEMPT_RT off
  2020-10-10 21:45 [PATCH] tracing: fix compile failure on RT with PREEMPT_RT off Clark Williams
@ 2020-10-12 10:12 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2020-10-12 10:12 UTC (permalink / raw)
  To: Clark Williams; +Cc: rostedt, linux-rt-users, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-10 21:45 [PATCH] tracing: fix compile failure on RT with PREEMPT_RT off Clark Williams
2020-10-12 10:12 ` Sebastian Andrzej Siewior

Linux-rt-users Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rt-users/0 linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ https://lore.kernel.org/linux-rt-users \
		linux-rt-users@vger.kernel.org
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rt-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git