[PATCH v3 07/17] rv: Adjust monitor dependencies

Gabriele Monaco posted 17 patches 5 months ago
There is a newer version of this series
[PATCH v3 07/17] rv: Adjust monitor dependencies
Posted by Gabriele Monaco 5 months ago
RV monitors relying on the preemptirqs tracepoints are set as dependent
on PREEMPT_TRACER and IRQSOFF_TRACER. In fact, those configurations do
enable the tracepoints but are not the minimal configurations enabling
them, which are TRACE_PREEMPT_TOGGLE and TRACE_IRQFLAGS (not selectable
manually).

Set TRACE_PREEMPT_TOGGLE and TRACE_IRQFLAGS as dependencies for
monitors.

Fixes: fbe6c09b7eb4 ("rv: Add scpd, snep and sncid per-cpu monitors")
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
---
 kernel/trace/rv/monitors/scpd/Kconfig  | 2 +-
 kernel/trace/rv/monitors/sncid/Kconfig | 2 +-
 kernel/trace/rv/monitors/snep/Kconfig  | 2 +-
 kernel/trace/rv/monitors/wip/Kconfig   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/rv/monitors/scpd/Kconfig b/kernel/trace/rv/monitors/scpd/Kconfig
index b9114fbf680f9..682d0416188b3 100644
--- a/kernel/trace/rv/monitors/scpd/Kconfig
+++ b/kernel/trace/rv/monitors/scpd/Kconfig
@@ -2,7 +2,7 @@
 #
 config RV_MON_SCPD
 	depends on RV
-	depends on PREEMPT_TRACER
+	depends on TRACE_PREEMPT_TOGGLE
 	depends on RV_MON_SCHED
 	default y
 	select DA_MON_EVENTS_IMPLICIT
diff --git a/kernel/trace/rv/monitors/sncid/Kconfig b/kernel/trace/rv/monitors/sncid/Kconfig
index 76bcfef4fd103..3a5639feaaaf6 100644
--- a/kernel/trace/rv/monitors/sncid/Kconfig
+++ b/kernel/trace/rv/monitors/sncid/Kconfig
@@ -2,7 +2,7 @@
 #
 config RV_MON_SNCID
 	depends on RV
-	depends on IRQSOFF_TRACER
+	depends on TRACE_IRQFLAGS
 	depends on RV_MON_SCHED
 	default y
 	select DA_MON_EVENTS_IMPLICIT
diff --git a/kernel/trace/rv/monitors/snep/Kconfig b/kernel/trace/rv/monitors/snep/Kconfig
index 77527f9712325..7dd54f434ff75 100644
--- a/kernel/trace/rv/monitors/snep/Kconfig
+++ b/kernel/trace/rv/monitors/snep/Kconfig
@@ -2,7 +2,7 @@
 #
 config RV_MON_SNEP
 	depends on RV
-	depends on PREEMPT_TRACER
+	depends on TRACE_PREEMPT_TOGGLE
 	depends on RV_MON_SCHED
 	default y
 	select DA_MON_EVENTS_IMPLICIT
diff --git a/kernel/trace/rv/monitors/wip/Kconfig b/kernel/trace/rv/monitors/wip/Kconfig
index e464b9294865b..87a26195792b4 100644
--- a/kernel/trace/rv/monitors/wip/Kconfig
+++ b/kernel/trace/rv/monitors/wip/Kconfig
@@ -2,7 +2,7 @@
 #
 config RV_MON_WIP
 	depends on RV
-	depends on PREEMPT_TRACER
+	depends on TRACE_PREEMPT_TOGGLE
 	select DA_MON_EVENTS_IMPLICIT
 	bool "wip monitor"
 	help
-- 
2.50.1
Re: [PATCH v3 07/17] rv: Adjust monitor dependencies
Posted by Nam Cao 5 months ago
On Tue, Jul 15, 2025 at 09:14:24AM +0200, Gabriele Monaco wrote:
> RV monitors relying on the preemptirqs tracepoints are set as dependent
> on PREEMPT_TRACER and IRQSOFF_TRACER. In fact, those configurations do
> enable the tracepoints but are not the minimal configurations enabling
> them, which are TRACE_PREEMPT_TOGGLE and TRACE_IRQFLAGS (not selectable
> manually).
> 
> Set TRACE_PREEMPT_TOGGLE and TRACE_IRQFLAGS as dependencies for
> monitors.
> 
> Fixes: fbe6c09b7eb4 ("rv: Add scpd, snep and sncid per-cpu monitors")
> Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>

I still dislike this. TRACE_PREEMPT_TOGGLE and TRACE_IRQFLAGS are not
selectable manually, making it hard to enable the monitors. You would need
to manually enable PREEMPT_TRACER and IRQSOFF_TRACER.

I prefer "select" instead.

But well, if you insist on doing it this way. It is not broken, it is just
inconvenient to configure.

Acked-by: Nam Cao <namcao@linutronix.de>
Re: [PATCH v3 07/17] rv: Adjust monitor dependencies
Posted by Gabriele Monaco 5 months ago

On Wed, 2025-07-16 at 10:19 +0200, Nam Cao wrote:
> On Tue, Jul 15, 2025 at 09:14:24AM +0200, Gabriele Monaco wrote:
> > RV monitors relying on the preemptirqs tracepoints are set as
> > dependent
> > on PREEMPT_TRACER and IRQSOFF_TRACER. In fact, those configurations
> > do
> > enable the tracepoints but are not the minimal configurations
> > enabling
> > them, which are TRACE_PREEMPT_TOGGLE and TRACE_IRQFLAGS (not
> > selectable
> > manually).
> > 
> > Set TRACE_PREEMPT_TOGGLE and TRACE_IRQFLAGS as dependencies for
> > monitors.
> > 
> > Fixes: fbe6c09b7eb4 ("rv: Add scpd, snep and sncid per-cpu
> > monitors")
> > Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
> 
> I still dislike this. TRACE_PREEMPT_TOGGLE and TRACE_IRQFLAGS are not
> selectable manually, making it hard to enable the monitors. You would
> need
> to manually enable PREEMPT_TRACER and IRQSOFF_TRACER.
> 

Right, they cannot but they are sufficient. For instance the debug
version of several distribution kernels has PROVE_LOCKING enabled but
not TRACE_PREEMPT_TOGGLE. Both of them set TRACE_IRQFLAGS, so the
monitor should be available on those builds.

> I prefer "select" instead.
> 
> But well, if you insist on doing it this way. It is not broken, it is
> just
> inconvenient to configure.

We had an internal discussion and my approach seems still better from a
distro maintainer/reviewer perspective.
Anyway, let's agree to disagree :)

> 
> Acked-by: Nam Cao <namcao@linutronix.de>

Thanks,
Gabriele