From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: "Masami Hiramatsu" <mhiramat@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Oleg Nesterov" <oleg@redhat.com>,
"Zheng Yejian" <zhengyejian1@huawei.com>,
"Kees Cook" <keescook@chromium.org>,
"Ajay Kaher" <akaher@vmware.com>,
"Jinjie Ruan" <ruanjinjie@huawei.com>,
"Clément Léger" <cleger@rivosinc.com>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>,
"Arnd Bergmann" <arnd@arndb.de>
Subject: [for-linus][PATCH 3/4] tracing: hide unused ftrace_event_id_fops
Date: Fri, 12 Apr 2024 09:31:55 -0400 [thread overview]
Message-ID: <20240412133214.151885304@goodmis.org> (raw)
In-Reply-To: 20240412133152.723632549@goodmis.org
From: Arnd Bergmann <arnd@arndb.de>
When CONFIG_PERF_EVENTS, a 'make W=1' build produces a warning about the
unused ftrace_event_id_fops variable:
kernel/trace/trace_events.c:2155:37: error: 'ftrace_event_id_fops' defined but not used [-Werror=unused-const-variable=]
2155 | static const struct file_operations ftrace_event_id_fops = {
Hide this in the same #ifdef as the reference to it.
Link: https://lore.kernel.org/linux-trace-kernel/20240403080702.3509288-7-arnd@kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Zheng Yejian <zhengyejian1@huawei.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ajay Kaher <akaher@vmware.com>
Cc: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: Clément Léger <cleger@rivosinc.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
Fixes: 620a30e97feb ("tracing: Don't pass file_operations array to event_create_dir()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
kernel/trace/trace_events.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 7c364b87352e..52f75c36bbca 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1670,6 +1670,7 @@ static int trace_format_open(struct inode *inode, struct file *file)
return 0;
}
+#ifdef CONFIG_PERF_EVENTS
static ssize_t
event_id_read(struct file *filp, char __user *ubuf, size_t cnt, loff_t *ppos)
{
@@ -1684,6 +1685,7 @@ event_id_read(struct file *filp, char __user *ubuf, size_t cnt, loff_t *ppos)
return simple_read_from_buffer(ubuf, cnt, ppos, buf, len);
}
+#endif
static ssize_t
event_filter_read(struct file *filp, char __user *ubuf, size_t cnt,
@@ -2152,10 +2154,12 @@ static const struct file_operations ftrace_event_format_fops = {
.release = seq_release,
};
+#ifdef CONFIG_PERF_EVENTS
static const struct file_operations ftrace_event_id_fops = {
.read = event_id_read,
.llseek = default_llseek,
};
+#endif
static const struct file_operations ftrace_event_filter_fops = {
.open = tracing_open_file_tr,
--
2.43.0
next prev parent reply other threads:[~2024-04-12 13:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 13:31 [for-linus][PATCH 0/4] tracing: Fixes for v6.9 Steven Rostedt
2024-04-12 13:31 ` [for-linus][PATCH 1/4] eventfs: Fix kernel-doc comments to functions Steven Rostedt
2024-04-12 13:31 ` [for-linus][PATCH 2/4] tracing: Fix FTRACE_RECORD_RECURSION_SIZE Kconfig entry Steven Rostedt
2024-04-12 13:31 ` Steven Rostedt [this message]
2024-04-12 13:31 ` [for-linus][PATCH 4/4] ring-buffer: Only update pages_touched when a new page is touched 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=20240412133214.151885304@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akaher@vmware.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=cleger@rivosinc.com \
--cc=dan.carpenter@linaro.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=oleg@redhat.com \
--cc=ruanjinjie@huawei.com \
--cc=tz.stoyanov@gmail.com \
--cc=zhengyejian1@huawei.com \
/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