mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rv/rtapp/wakeup: Use "rv_this" the rv_monitor variable
@ 2026-10-01  4:42 Nam Cao
  2026-10-01  6:31 ` Gabriele Monaco
  0 siblings, 1 reply; 3+ messages in thread
From: Nam Cao @ 2026-10-01  4:42 UTC (permalink / raw)
  To: Gabriele Monaco, Steven Rostedt, linux-trace-kernel,
	linux-kernel, John Ogness
  Cc: Nam Cao

Commit d9e4c61a12dd ("rv: Use generic rv_this for the rv_monitor
variable in LTL") renamed the rv_monitor variable to rv_this. But
rtapp/wakeup monitor was late to the party and missed that.

So for this monitor, rv_this is an empty struct. The reactor fails to
work, because rv_react() checks monitor->react and sees NULL.

Correct to "rv_this" and make the reactor work again.

Signed-off-by: Nam Cao <namcao@linutronix.de>
---
 kernel/trace/rv/monitors/wakeup/wakeup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/rv/monitors/wakeup/wakeup.c b/kernel/trace/rv/monitors/wakeup/wakeup.c
index 01b47416f24e..2e803e79181e 100644
--- a/kernel/trace/rv/monitors/wakeup/wakeup.c
+++ b/kernel/trace/rv/monitors/wakeup/wakeup.c
@@ -128,7 +128,7 @@ static void disable_wakeup(void)
 	ltl_monitor_destroy();
 }
 
-static struct rv_monitor rv_wakeup = {
+static struct rv_monitor rv_this = {
 	.name = "wakeup",
 	.description = "Monitor that real-time tasks are not woken by lower-priority tasks",
 	.enable = enable_wakeup,
@@ -137,12 +137,12 @@ static struct rv_monitor rv_wakeup = {
 
 static int __init register_wakeup(void)
 {
-	return rv_register_monitor(&rv_wakeup, &rv_rtapp);
+	return rv_register_monitor(&rv_this, &rv_rtapp);
 }
 
 static void __exit unregister_wakeup(void)
 {
-	rv_unregister_monitor(&rv_wakeup);
+	rv_unregister_monitor(&rv_this);
 }
 
 module_init(register_wakeup);
-- 
2.47.3


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

* Re: [PATCH] rv/rtapp/wakeup: Use "rv_this" the rv_monitor variable
  2026-10-01  4:42 [PATCH] rv/rtapp/wakeup: Use "rv_this" the rv_monitor variable Nam Cao
@ 2026-10-01  6:31 ` Gabriele Monaco
  2026-10-01 11:17   ` Gabriele Monaco
  0 siblings, 1 reply; 3+ messages in thread
From: Gabriele Monaco @ 2026-10-01  6:31 UTC (permalink / raw)
  To: Nam Cao, Steven Rostedt, linux-trace-kernel, linux-kernel, John Ogness

On Thu, 2026-10-01 at 06:42 +0200, Nam Cao wrote:
> Commit d9e4c61a12dd ("rv: Use generic rv_this for the rv_monitor
> variable in LTL") renamed the rv_monitor variable to rv_this. But
> rtapp/wakeup monitor was late to the party and missed that.
> 
> So for this monitor, rv_this is an empty struct. The reactor fails to
> work, because rv_react() checks monitor->react and sees NULL.
> 
> Correct to "rv_this" and make the reactor work again.
> 
> Signed-off-by: Nam Cao <namcao@linutronix.de>

Damn.. Thanks for noticing!

That's a weird one, I cannot think of a way to only declare the rv_this, so the
compiler is perfectly happy to give you the empty one..

I'm taking this, but I believe it deserves the Fixes tag. What do you think?

Thanks,
Gabriele

> ---
>  kernel/trace/rv/monitors/wakeup/wakeup.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/trace/rv/monitors/wakeup/wakeup.c
> b/kernel/trace/rv/monitors/wakeup/wakeup.c
> index 01b47416f24e..2e803e79181e 100644
> --- a/kernel/trace/rv/monitors/wakeup/wakeup.c
> +++ b/kernel/trace/rv/monitors/wakeup/wakeup.c
> @@ -128,7 +128,7 @@ static void disable_wakeup(void)
>  	ltl_monitor_destroy();
>  }
>  
> -static struct rv_monitor rv_wakeup = {
> +static struct rv_monitor rv_this = {
>  	.name = "wakeup",
>  	.description = "Monitor that real-time tasks are not woken by lower-
> priority tasks",
>  	.enable = enable_wakeup,
> @@ -137,12 +137,12 @@ static struct rv_monitor rv_wakeup = {
>  
>  static int __init register_wakeup(void)
>  {
> -	return rv_register_monitor(&rv_wakeup, &rv_rtapp);
> +	return rv_register_monitor(&rv_this, &rv_rtapp);
>  }
>  
>  static void __exit unregister_wakeup(void)
>  {
> -	rv_unregister_monitor(&rv_wakeup);
> +	rv_unregister_monitor(&rv_this);
>  }
>  
>  module_init(register_wakeup);


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

* Re: [PATCH] rv/rtapp/wakeup: Use "rv_this" the rv_monitor variable
  2026-10-01  6:31 ` Gabriele Monaco
@ 2026-10-01 11:17   ` Gabriele Monaco
  0 siblings, 0 replies; 3+ messages in thread
From: Gabriele Monaco @ 2026-10-01 11:17 UTC (permalink / raw)
  To: Nam Cao, Steven Rostedt, linux-trace-kernel, linux-kernel, John Ogness
  Cc: stable

On Thu, 2026-10-01 at 08:31 +0200, Gabriele Monaco wrote:
> On Thu, 2026-10-01 at 06:42 +0200, Nam Cao wrote:
> > Commit d9e4c61a12dd ("rv: Use generic rv_this for the rv_monitor
> > variable in LTL") renamed the rv_monitor variable to rv_this. But
> > rtapp/wakeup monitor was late to the party and missed that.
> > 
> > So for this monitor, rv_this is an empty struct. The reactor fails to
> > work, because rv_react() checks monitor->react and sees NULL.
> > 
> > Correct to "rv_this" and make the reactor work again.
> > 
> > Signed-off-by: Nam Cao <namcao@linutronix.de>

d9e4c61a12dd was introduced in the same pull request but after introducing the
wakeup monitor.
So for me that's the commit that is "broken" (should have accounted for wakeup):

Fixes: d9e4c61a12dd ("rv: Use generic rv_this for the rv_monitor variable in
LTL")

> 
> Damn.. Thanks for noticing!
> 
> That's a weird one, I cannot think of a way to only declare the rv_this, so
> the
> compiler is perfectly happy to give you the empty one..
> 
> I'm taking this, but I believe it deserves the Fixes tag. What do you think?
> 
> Thanks,
> Gabriele
> 
> > ---
> >  kernel/trace/rv/monitors/wakeup/wakeup.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/kernel/trace/rv/monitors/wakeup/wakeup.c
> > b/kernel/trace/rv/monitors/wakeup/wakeup.c
> > index 01b47416f24e..2e803e79181e 100644
> > --- a/kernel/trace/rv/monitors/wakeup/wakeup.c
> > +++ b/kernel/trace/rv/monitors/wakeup/wakeup.c
> > @@ -128,7 +128,7 @@ static void disable_wakeup(void)
> >  	ltl_monitor_destroy();
> >  }
> >  
> > -static struct rv_monitor rv_wakeup = {
> > +static struct rv_monitor rv_this = {
> >  	.name = "wakeup",
> >  	.description = "Monitor that real-time tasks are not woken by
> > lower-
> > priority tasks",
> >  	.enable = enable_wakeup,
> > @@ -137,12 +137,12 @@ static struct rv_monitor rv_wakeup = {
> >  
> >  static int __init register_wakeup(void)
> >  {
> > -	return rv_register_monitor(&rv_wakeup, &rv_rtapp);
> > +	return rv_register_monitor(&rv_this, &rv_rtapp);
> >  }
> >  
> >  static void __exit unregister_wakeup(void)
> >  {
> > -	rv_unregister_monitor(&rv_wakeup);
> > +	rv_unregister_monitor(&rv_this);
> >  }
> >  
> >  module_init(register_wakeup);


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

end of thread, other threads:[~2026-10-01 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01  4:42 [PATCH] rv/rtapp/wakeup: Use "rv_this" the rv_monitor variable Nam Cao
2026-10-01  6:31 ` Gabriele Monaco
2026-10-01 11:17   ` Gabriele Monaco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®