public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing: remove duplicate  latency_fsnotify() stub
@ 2026-03-31 10:30 Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2026-03-31 10:30 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu
  Cc: Arnd Bergmann, Mathieu Desnoyers, linux-kernel,
	linux-trace-kernel

From: Arnd Bergmann <arnd@arndb.de>

During the move, an extra copy of latency_fsnotify() crept in:

kernel/trace/trace_snapshot.c:395:20: error: redefinition of 'latency_fsnotify'
  395 | static inline void latency_fsnotify(struct trace_array *tr) { }
      |                    ^~~~~~~~~~~~~~~~
In file included from kernel/trace/trace_snapshot.c:6:
kernel/trace/trace.h:858:20: note: previous definition of 'latency_fsnotify' with type 'void(struct trace_array *)'
  858 | static inline void latency_fsnotify(struct trace_array *tr) { }
      |                    ^~~~~~~~~~~~~~~~

The function is still called from the hwlat and osnoise tracers, so the
copy in the header file is the one that has to stay.

Remove the extra one from trace_snapshot.c

Fixes: bade44fe5462 ("tracing: Move snapshot code out of trace.c and into trace_snapshot.c")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Please fold into the commit that moves the code, if possible
---
 kernel/trace/trace_snapshot.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/trace/trace_snapshot.c b/kernel/trace/trace_snapshot.c
index 8865b2ef2264..a54e9533e79d 100644
--- a/kernel/trace/trace_snapshot.c
+++ b/kernel/trace/trace_snapshot.c
@@ -391,8 +391,6 @@ void latency_fsnotify(struct trace_array *tr)
 	 */
 	irq_work_queue(&tr->fsnotify_irqwork);
 }
-#else
-static inline void latency_fsnotify(struct trace_array *tr) { }
 #endif /* LATENCY_FS_NOTIFY */
 static const struct file_operations tracing_max_lat_fops;
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [PATCH] tracing: Remove duplicate latency_fsnotify() stub
@ 2026-03-31  0:58 Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2026-03-31  0:58 UTC (permalink / raw)
  To: LKML, Linux Trace Kernel; +Cc: Masami Hiramatsu, Mathieu Desnoyers

From: Steven Rostedt <rostedt@goodmis.org>

When the SNAPSHOT is defined but FSNOTIFY is not the latency_fsnotify()
function is turned into a static inline stub. But this stub was defined in
both trace.h and trace_snapshot.c causing a error in build when
CONFIG_SNAPSHOT is defined but FSNOTIFY is not. The stub is not needed in
trace_snapshot.c as it will be defined in trace.h, remove it from the C
file.

Fixes: bade44fe5462 ("tracing: Move snapshot code out of trace.c and into trace_snapshot.c")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603310604.lGE9LDBK-lkp@intel.com/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace.h          | 2 +-
 kernel/trace/trace_snapshot.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index a3ea735a9ef6..a59d6acdf95d 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -845,13 +845,13 @@ void update_max_tr_single(struct trace_array *tr,
 #if defined(CONFIG_TRACER_MAX_TRACE) && defined(CONFIG_FSNOTIFY)
 # define LATENCY_FS_NOTIFY
 #endif
+#endif /* CONFIG_TRACER_SNAPSHOT */
 
 #ifdef LATENCY_FS_NOTIFY
 void latency_fsnotify(struct trace_array *tr);
 #else
 static inline void latency_fsnotify(struct trace_array *tr) { }
 #endif
-#endif /* CONFIG_TRACER_SNAPSHOT */
 
 #ifdef CONFIG_STACKTRACE
 void __trace_stack(struct trace_array *tr, unsigned int trace_ctx, int skip);
diff --git a/kernel/trace/trace_snapshot.c b/kernel/trace/trace_snapshot.c
index 8865b2ef2264..07b43c9863a2 100644
--- a/kernel/trace/trace_snapshot.c
+++ b/kernel/trace/trace_snapshot.c
@@ -391,9 +391,8 @@ void latency_fsnotify(struct trace_array *tr)
 	 */
 	irq_work_queue(&tr->fsnotify_irqwork);
 }
-#else
-static inline void latency_fsnotify(struct trace_array *tr) { }
 #endif /* LATENCY_FS_NOTIFY */
+
 static const struct file_operations tracing_max_lat_fops;
 
 void trace_create_maxlat_file(struct trace_array *tr,
-- 
2.51.0


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

end of thread, other threads:[~2026-03-31 10:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 10:30 [PATCH] tracing: remove duplicate latency_fsnotify() stub Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2026-03-31  0:58 [PATCH] tracing: Remove " Steven Rostedt

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