From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: always provide a prototype for tracing_alloc_snapshot()
Date: Tue, 31 Mar 2026 18:20:36 +0900 [thread overview]
Message-ID: <20260331182036.e62143d5a9a59776d8cf7ae2@kernel.org> (raw)
In-Reply-To: <20260331082001.31345-1-bartosz.golaszewski@oss.qualcomm.com>
On Tue, 31 Mar 2026 10:20:01 +0200
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> wrote:
> The tracing_alloc_snapshot() symbol is always exported even with
> !CONFIG_TRACER_SNAPSHOT so the prototype too must be always visible or
> we'll see the following warning:
>
> kernel/trace/trace.c:820:5: warning: no previous prototype for ‘tracing_alloc_snapshot’ [-Wmissing-prototypes]
> 820 | int tracing_alloc_snapshot(void)
> | ^~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: bade44fe5462 ("tracing: Move snapshot code out of trace.c and into trace_snapshot.c")
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Good catch!
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks!
> ---
> kernel/trace/trace.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index 6abd9e16ef21..e8612b8b0a34 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -2275,6 +2275,8 @@ static inline void __init trace_event_init(void) { }
> static inline void trace_event_update_all(struct trace_eval_map **map, int len) { }
> #endif
>
> +int tracing_alloc_snapshot(void);
> +
> #ifdef CONFIG_TRACER_SNAPSHOT
> extern const struct file_operations snapshot_fops;
> extern const struct file_operations snapshot_raw_fops;
> @@ -2282,7 +2284,6 @@ extern const struct file_operations snapshot_raw_fops;
> /* Used when creating instances */
> int trace_allocate_snapshot(struct trace_array *tr, int size);
>
> -int tracing_alloc_snapshot(void);
> void tracing_snapshot_cond(struct trace_array *tr, void *cond_data);
> int tracing_snapshot_cond_enable(struct trace_array *tr, void *cond_data, cond_update_fn_t update);
> int tracing_snapshot_cond_disable(struct trace_array *tr);
> --
> 2.47.3
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2026-03-31 9:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 8:20 [PATCH] tracing: always provide a prototype for tracing_alloc_snapshot() Bartosz Golaszewski
2026-03-31 9:20 ` Masami Hiramatsu [this message]
2026-03-31 16:13 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260331182036.e62143d5a9a59776d8cf7ae2@kernel.org \
--to=mhiramat@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox