All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing: fix missing osnoise tracer on max_latency
@ 2021-09-18  5:11 Jackie Liu
  2021-09-19 16:01 ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Jackie Liu @ 2021-09-18  5:11 UTC (permalink / raw)
  To: rostedt, mingo; +Cc: linux-kernel, bristot, liu.yun

From: Jackie Liu <liuyun01@kylinos.cn>

The compiler warns when the data are actually unused:

  kernel/trace/trace.c:1712:13: error: ‘trace_create_maxlat_file’ defined but not used [-Werror=unused-function]
   1712 | static void trace_create_maxlat_file(struct trace_array *tr,
        |             ^~~~~~~~~~~~~~~~~~~~~~~~

[Why]
CONFIG_HWLAT_TRACER=n, CONFIG_TRACER_MAX_TRACE=n, CONFIG_OSNOISE_TRACER=y
gcc report warns.

[How]
Now trace_create_maxlat_file will only take effect when
CONFIG_HWLAT_TRACER=y or CONFIG_TRACER_MAX_TRACE=y. In fact, after
adding osnoise trace, it also needs to take effect.

BTW, Fixed the conflicting defined comment information.

Fixes: bce29ac9ce0b ("trace: Add osnoise tracer")
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
 kernel/trace/trace.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 7896d30d90f7..d7e3ed82fafd 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1744,11 +1744,7 @@ void latency_fsnotify(struct trace_array *tr)
 	irq_work_queue(&tr->fsnotify_irqwork);
 }
 
-/*
- * (defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)) && \
- *  defined(CONFIG_FSNOTIFY)
- */
-#else
+#else /* LATENCY_FS_NOTIFY */
 
 #define trace_create_maxlat_file(tr, d_tracer)				\
 	trace_create_file("tracing_max_latency", 0644, d_tracer,	\
@@ -9473,7 +9469,8 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer)
 
 	create_trace_options_dir(tr);
 
-#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
+#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) \
+	|| defined(CONFIG_OSNOISE_TRACER)
 	trace_create_maxlat_file(tr, d_tracer);
 #endif
 
-- 
2.25.1


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

end of thread, other threads:[~2021-09-22  2:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-18  5:11 [PATCH] tracing: fix missing osnoise tracer on max_latency Jackie Liu
2021-09-19 16:01 ` Steven Rostedt
2021-09-22  2:26   ` Jackie Liu
2021-09-22  2:40     ` Steven Rostedt
2021-09-22  2:45       ` Jackie Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.