Skip to contentSkip to conversation

trace: eradicate noisy warning in trace_osnoise.c

PATCH In review Randy Dunlap 3 participants 5 messages Jul 31, 2021 – Aug 3, 2021 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace: eradicate noisy warning in trace_osnoise.c

OK, I'm officially tired of this noise warning coming from trace_osnoise.c, so shut it up. Also, adding new warnings is not OK.

../kernel/trace/trace_osnoise.c: In function ‘start_kthread’:
../kernel/trace/trace_osnoise.c:1461:8: warning: ‘main’ is usually a function [-Wmain]

  void *main = osnoise_main;
        ^~~~
Fixes c8895e271f79 ("trace/osnoise: Support hotplug operations")
Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Daniel Bristot de Oliveira <[email protected]>
---
 kernel/trace/Makefile |    2 ++
 1 file changed, 2 insertions(+)
kernel/trace/Makefile +2 -0
@@ -36,6 +36,8 @@ CFLAGS_bpf_trace.o := -I$(src)
 CFLAGS_trace_benchmark.o := -I$(src)
 CFLAGS_trace_events_filter.o := -I$(src)
 
+CFLAGS_trace_osnoise.o := -Wno-main
+
 obj-$(CONFIG_TRACE_CLOCK) += trace_clock.o
 
 obj-$(CONFIG_FUNCTION_TRACER) += libftrace.o
maintainer
#1 lore raw
Quoted 2 lines · On Fri, 30 Jul 2021 17:00:55 -0700 Randy Dunlap <[email protected]> wrote:

OK, I'm officially tired of this noise warning coming from trace_osnoise.c, so shut it up. Also, adding new warnings is not OK.

I agree adding "new warnings" is not OK, but this is a stupid warning.

Quoted 19 lines

../kernel/trace/trace_osnoise.c: In function ‘start_kthread’:
../kernel/trace/trace_osnoise.c:1461:8: warning: ‘main’ is usually a function [-Wmain]

  void *main = osnoise_main;
        ^~~~
Fixes c8895e271f79 ("trace/osnoise: Support hotplug operations")
Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Daniel Bristot de Oliveira <[email protected]>
---
 kernel/trace/Makefile |    2 ++
 1 file changed, 2 insertions(+)

kernel/trace/Makefile CFLAGS_bpf_trace.o := -I$(src) · line 39

Quoted 4 lines
kernel/trace/Makefile +1 -0
@@ -36,6 +36,8 @@ CFLAGS_bpf_trace.o := -I$(src)
 CFLAGS_trace_benchmark.o := -I$(src)
 CFLAGS_trace_events_filter.o := -I$(src)
 
+CFLAGS_trace_osnoise.o := -Wno-main

Why just add it here. It's a silly warning to have for the kernel at all. Should this not be added in a more global place?

-- Steve

Quoted 4 lines
kernel/trace/Makefile +1 -0
+
 obj-$(CONFIG_TRACE_CLOCK) += trace_clock.o
 
 obj-$(CONFIG_FUNCTION_TRACER) += libftrace.o
#2 lore raw
Quoted 30 lines · Steven Rostedt
Quoted 2 lines · On Fri, 30 Jul 2021 17:00:55 -0700 Randy Dunlap <[email protected]> wrote:

OK, I'm officially tired of this noise warning coming from trace_osnoise.c, so shut it up. Also, adding new warnings is not OK.

I agree adding "new warnings" is not OK, but this is a stupid warning.

Quoted 22 lines

../kernel/trace/trace_osnoise.c: In function ‘start_kthread’:
../kernel/trace/trace_osnoise.c:1461:8: warning: ‘main’ is usually a function [-Wmain]

  void *main = osnoise_main;
        ^~~~
Fixes c8895e271f79 ("trace/osnoise: Support hotplug operations")
Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Daniel Bristot de Oliveira <[email protected]>
---
 kernel/trace/Makefile |    2 ++
 1 file changed, 2 insertions(+)
kernel/trace/Makefile +0 -0
@@ -36,6 +36,8 @@ CFLAGS_bpf_trace.o := -I$(src)
 CFLAGS_trace_benchmark.o := -I$(src)
 CFLAGS_trace_events_filter.o := -I$(src)
 
Quoted 4 lines

kernel/trace/Makefile CFLAGS_bpf_trace.o := -I$(src) · line 39

Quoted 1 line
kernel/trace/Makefile +1 -0
+CFLAGS_trace_osnoise.o := -Wno-main

Why just add it here. It's a silly warning to have for the kernel at all. Should this not be added in a more global place?

I don't know of any other places that name something 'main' when it is not a main() function.

Quoted 8 lines

-- Steve

Quoted 4 lines
kernel/trace/Makefile +1 -0
+
 obj-$(CONFIG_TRACE_CLOCK) += trace_clock.o
 
 obj-$(CONFIG_FUNCTION_TRACER) += libftrace.o
Signature · 1 line
~Randy
#3 lore raw
Quoted 29 lines · Randy Dunlap
Quoted 28 lines · Steven Rostedt
Quoted 2 lines · On Fri, 30 Jul 2021 17:00:55 -0700 Randy Dunlap <[email protected]> wrote:

OK, I'm officially tired of this noise warning coming from trace_osnoise.c, so shut it up. Also, adding new warnings is not OK.

I agree adding "new warnings" is not OK, but this is a stupid warning.

Quoted 21 lines

../kernel/trace/trace_osnoise.c: In function ‘start_kthread’:
../kernel/trace/trace_osnoise.c:1461:8: warning: ‘main’ is usually a function [-Wmain]

  void *main = osnoise_main;
        ^~~~
Fixes c8895e271f79 ("trace/osnoise: Support hotplug operations")
Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Daniel Bristot de Oliveira <[email protected]>
---
 kernel/trace/Makefile |    2 ++
 1 file changed, 2 insertions(+)
kernel/trace/Makefile +0 -0
@@ -36,6 +36,8 @@ CFLAGS_bpf_trace.o := -I$(src)
 CFLAGS_trace_benchmark.o := -I$(src)
 CFLAGS_trace_events_filter.o := -I$(src)
 
Quoted 6 lines
Quoted 3 lines

kernel/trace/Makefile CFLAGS_bpf_trace.o := -I$(src) · line 39

Quoted 1 line
kernel/trace/Makefile +1 -0
+CFLAGS_trace_osnoise.o := -Wno-main

Why just add it here. It's a silly warning to have for the kernel at all. Should this not be added in a more global place?

I don't know of any other places that name something 'main' when it is not a main() function.

I would say that we either use -Wno-main for the entire kernel or rename the main variable to tracer_main....

-- Daniel

#4 lore raw
Quoted 33 lines · Daniel Bristot de Oliveira
Quoted 32 lines · Randy Dunlap
Quoted 31 lines · Steven Rostedt
Quoted 2 lines · On Fri, 30 Jul 2021 17:00:55 -0700 Randy Dunlap <[email protected]> wrote:

OK, I'm officially tired of this noise warning coming from trace_osnoise.c, so shut it up. Also, adding new warnings is not OK.

I agree adding "new warnings" is not OK, but this is a stupid warning.

Quoted 18 lines

../kernel/trace/trace_osnoise.c: In function ‘start_kthread’:
../kernel/trace/trace_osnoise.c:1461:8: warning: ‘main’ is usually a function [-Wmain]

   void *main = osnoise_main;
         ^~~~
Fixes c8895e271f79 ("trace/osnoise: Support hotplug operations")
Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Daniel Bristot de Oliveira <[email protected]>
---
  kernel/trace/Makefile |    2 ++
  1 file changed, 2 insertions(+)

kernel/trace/Makefile CFLAGS_bpf_trace.o := -I$(src) · line 39

Quoted 4 lines
kernel/trace/Makefile +1 -0
@@ -36,6 +36,8 @@ CFLAGS_bpf_trace.o := -I$(src)
  CFLAGS_trace_benchmark.o := -I$(src)
  CFLAGS_trace_events_filter.o := -I$(src)
 
+CFLAGS_trace_osnoise.o := -Wno-main

Why just add it here. It's a silly warning to have for the kernel at all. Should this not be added in a more global place?

Quoted 6 lines
Quoted 3 lines

I don't know of any other places that name something 'main' when it is not a main() function.

I would say that we either use -Wno-main for the entire kernel or rename the main variable to tracer_main....

I'm OK with the latter...

thanks.