Skip to contentSkip to conversation

kernel/trace/rv/monitors/sleep/sleep.c:219:26: error: static declaration of 'rv_sleep' follows non-static declaration

PATCH New kernel test robot 4 participants 6 messages Nov 13, 2025

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace latency/for-next
head:   69d8895cb9a9f6450374577af8584c2e21cb5a9f
commit: 4f739ed19d222de33b19ca639a34523fbbec20d0 [3/5] rv: Pass va_list to reactors
config: arc-randconfig-r071-20251113 (https://download.01.org/0day-ci/archive/20251113/[email protected]/config)
compiler: arc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251113/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> kernel/trace/rv/monitors/sleep/sleep.c:219:26: error: static declaration of 'rv_sleep' follows non-static declaration
    static struct rv_monitor rv_sleep = {
                             ^~~~~~~~
   In file included from include/linux/cleanup.h:7,
                    from include/linux/interrupt.h:8,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from kernel/trace/rv/monitors/sleep/sleep.c:2:
   include/rv/ltl_monitor.h:19:37: note: previous declaration of 'rv_sleep' was here
    #define RV_MONITOR_NAME CONCATENATE(rv_, MONITOR_NAME)
                                        ^~~
   include/linux/args.h:25:24: note: in definition of macro '__CONCAT'
    #define __CONCAT(a, b) a ## b
                           ^
   include/rv/ltl_monitor.h:19:25: note: in expansion of macro 'CONCATENATE'
    #define RV_MONITOR_NAME CONCATENATE(rv_, MONITOR_NAME)
                            ^~~~~~~~~~~
   include/rv/ltl_monitor.h:24:26: note: in expansion of macro 'RV_MONITOR_NAME'
    extern struct rv_monitor RV_MONITOR_NAME;
                             ^~~~~~~~~~~~~~~

vim +/rv_sleep +219 kernel/trace/rv/monitors/sleep/sleep.c

f74f8bb246cf22 Nam Cao 2025-07-09 218

f74f8bb246cf22 Nam Cao 2025-07-09 @219  static struct rv_monitor rv_sleep = {
f74f8bb246cf22 Nam Cao 2025-07-09  220  	.name = "sleep",
f74f8bb246cf22 Nam Cao 2025-07-09  221  	.description = "Monitor that RT tasks do not undesirably sleep",
f74f8bb246cf22 Nam Cao 2025-07-09  222  	.enable = enable_sleep,
f74f8bb246cf22 Nam Cao 2025-07-09  223  	.disable = disable_sleep,
f74f8bb246cf22 Nam Cao 2025-07-09  224  };

f74f8bb246cf22 Nam Cao 2025-07-09 225

:::::: The code at line 219 was first introduced by commit :::::: f74f8bb246cf22f27752977da62079cb615f55b2 rv: Add rtapp_sleep monitor

:::::: TO: Nam Cao <[email protected]> :::::: CC: Steven Rostedt (Google) <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#1 lore raw
Quoted 21 lines · kernel test robot

tree:
https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace latency/for-
next
head:   69d8895cb9a9f6450374577af8584c2e21cb5a9f
commit: 4f739ed19d222de33b19ca639a34523fbbec20d0 [3/5] rv: Pass va_list to reactors
config: arc-randconfig-r071-20251113
(https://download.01.org/0day-ci/archive/20251113/202511131948.vxi5mdjU-lkp@in
tel.com/config)
compiler: arc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build):
(https://download.01.org/0day-ci/archive/20251113/202511131948.vxi5mdjU-lkp@in
tel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags

Quoted 3 lines

Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/

Quoted 6 lines

All errors (new ones prefixed by >>):

Quoted 2 lines
Quoted 2 lines

kernel/trace/rv/monitors/sleep/sleep.c:219:26: error: static declaration of 'rv_sleep' follows non-static declaration

    static struct rv_monitor rv_sleep = {
                             ^~~~~~~~

My bad I didn't test with !CONFIG_RV_REACTORS, is there a reason why we'd want this non-static?

#ifdef CONFIG_RV_REACTORS
static struct rv_monitor RV_MONITOR_NAME;
#else
extern struct rv_monitor RV_MONITOR_NAME;
#endif

ltl_monitor is included only by the files defining the rv_MONITOR_NAME, that's definitely static as far as I see it.

I'd go with a Fix like this:

include/rv/ltl_monitor.h +0 -5
index 00c42b36f961..eff60cd61106 100644
@@ -17,12 +17,7 @@
 #endif
 
 #define RV_MONITOR_NAME CONCATENATE(rv_, MONITOR_NAME)
-
-#ifdef CONFIG_RV_REACTORS
 static struct rv_monitor RV_MONITOR_NAME;
-#else
-extern struct rv_monitor RV_MONITOR_NAME;
-#endif
 
 static int ltl_monitor_slot = RV_PER_TASK_MONITOR_INIT;
 

Any thought?

Thanks,
Gabriele

Quoted 38 lines

   In file included from include/linux/cleanup.h:7,
                    from include/linux/interrupt.h:8,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from kernel/trace/rv/monitors/sleep/sleep.c:2:
   include/rv/ltl_monitor.h:19:37: note: previous declaration of 'rv_sleep' was here
    #define RV_MONITOR_NAME CONCATENATE(rv_, MONITOR_NAME)
                                        ^~~ include/linux/args.h:25:24: note: in definition of macro '__CONCAT' #define __CONCAT(a, b) a ## b
                           ^
   include/rv/ltl_monitor.h:19:25: note: in expansion of macro 'CONCATENATE' #define RV_MONITOR_NAME CONCATENATE(rv_, MONITOR_NAME) ^~~~~~~~~~~ include/rv/ltl_monitor.h:24:26: note: in expansion of macro 'RV_MONITOR_NAME'
    extern struct rv_monitor RV_MONITOR_NAME;
                             ^~~~~~~~~~~~~~~

vim +/rv_sleep +219 kernel/trace/rv/monitors/sleep/sleep.c

f74f8bb246cf22 Nam Cao 2025-07-09  218
f74f8bb246cf22 Nam Cao 2025-07-09 @219  static struct rv_monitor rv_sleep = {
f74f8bb246cf22 Nam Cao 2025-07-09  220   .name = "sleep",
f74f8bb246cf22 Nam Cao 2025-07-09  221   .description = "Monitor that
RT tasks do not undesirably sleep",
f74f8bb246cf22 Nam Cao 2025-07-09  222   .enable = enable_sleep,
f74f8bb246cf22 Nam Cao 2025-07-09  223   .disable = disable_sleep,
f74f8bb246cf22 Nam Cao 2025-07-09  224  };
f74f8bb246cf22 Nam Cao 2025-07-09  225

:::::: The code at line 219 was first introduced by commit :::::: f74f8bb246cf22f27752977da62079cb615f55b2 rv: Add rtapp_sleep monitor

:::::: TO: Nam Cao <[email protected]> :::::: CC: Steven Rostedt (Google) <[email protected]>

#2 lore raw
In reply to kernel test robot
Quoted 26 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace latency/for-next
head:   69d8895cb9a9f6450374577af8584c2e21cb5a9f
commit: 4f739ed19d222de33b19ca639a34523fbbec20d0 [3/5] rv: Pass va_list to reactors
config: arc-randconfig-r071-20251113 (https://download.01.org/0day-ci/archive/20251113/[email protected]/config)
compiler: arc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251113/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/trace/rv/monitors/sleep/sleep.c:219:26: error: static declaration of 'rv_sleep' follows non-static declaration

    static struct rv_monitor rv_sleep = {
                             ^~~~~~~~
   In file included from include/linux/cleanup.h:7,
                    from include/linux/interrupt.h:8,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from kernel/trace/rv/monitors/sleep/sleep.c:2:
   include/rv/ltl_monitor.h:19:37: note: previous declaration of 'rv_sleep' was here
    #define RV_MONITOR_NAME CONCATENATE(rv_, MONITOR_NAME)
                                        ^~~
   include/linux/args.h:25:24: note: in definition of macro '__CONCAT'
Quoted 8 lines
    #define __CONCAT(a, b) a ## b
                           ^
   include/rv/ltl_monitor.h:19:25: note: in expansion of macro 'CONCATENATE'
    #define RV_MONITOR_NAME CONCATENATE(rv_, MONITOR_NAME)
                            ^~~~~~~~~~~
   include/rv/ltl_monitor.h:24:26: note: in expansion of macro 'RV_MONITOR_NAME'
    extern struct rv_monitor RV_MONITOR_NAME;
                             ^~~~~~~~~~~~~~~

That 'extern' declaration if !CONFIG_RV_REACTORS doesn't make sense. The whole conditional should go away and just always declare:

static struct rv_monitor RV_MONITOR_NAME;

Want me to send a new revision or will you fix it up directly?

Thomas

maintainer
#3 lore raw
Quoted 6 lines · Thomas Weißschuh

That 'extern' declaration if !CONFIG_RV_REACTORS doesn't make sense. The whole conditional should go away and just always declare:

static struct rv_monitor RV_MONITOR_NAME;

Want me to send a new revision or will you fix it up directly?

The commit is already on linux-next, I guess the easiest thing is to send a fix commit on top of that and Steven can decide whether to squash it before sending it to Linus or leave it as it is.

I can handle this.

Thanks,
Gabriele

maintainer
#4 lore raw

PATCH 1/1 Fix compilation if !CONFIG_RV_REACTORS

The kernel test robot spotted a compilation error if reactors are disabled.

Fix the warning by keeping LTL monitor variable as always static.

---

This patch fixes a patch that was just merged to trace:latency/for-next. It builds locally with both configurations. I started another kernel robot run and, if it passes, I'm going to send a pull request with only this.

 include/rv/ltl_monitor.h | 5 -----
 1 file changed, 5 deletions(-)
include/rv/ltl_monitor.h +0 -5
index 00c42b36f961..eff60cd61106 100644
@@ -17,12 +17,7 @@
 #endif
 
 #define RV_MONITOR_NAME CONCATENATE(rv_, MONITOR_NAME)
-
-#ifdef CONFIG_RV_REACTORS
 static struct rv_monitor RV_MONITOR_NAME;
-#else
-extern struct rv_monitor RV_MONITOR_NAME;
-#endif
 
 static int ltl_monitor_slot = RV_PER_TASK_MONITOR_INIT;
 

base-commit: 69d8895cb9a9f6450374577af8584c2e21cb5a9f

Signature · 1 line
2.51.1
maintainer
#5 lore raw
In reply to Gabriele Monaco
Quoted 5 lines · On Thu, 13 Nov 2025 14:17:25 +0100 Gabriele Monaco <[email protected]> wrote:

The commit is already on linux-next, I guess the easiest thing is to send a fix commit on top of that and Steven can decide whether to squash it before sending it to Linus or leave it as it is.

I can handle this.

I like to treat linux-next as final, and seldom rebase unless there's a major bug that needs a revert.

I'll pull in your patch directly.

Thanks,

-- Steve