From: Changbin Du <changbin.du@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, Changbin Du <changbin.du@gmail.com>
Subject: [PATCH] tracing: do not create option file latency-format
Date: Sun, 17 May 2020 00:10:17 +0800 [thread overview]
Message-ID: <20200516161017.155791-1-changbin.du@gmail.com> (raw)
The flag LATENCY_FMT actually is usually set by latency tracers internally.
So I think we should not export it to userspace. This patch removes the
option file 'latency-format' but keep the flag defined as usual.
Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
kernel/trace/trace.c | 4 ++++
kernel/trace/trace.h | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 29615f15a820..0d190e0021d5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4733,6 +4733,8 @@ static int tracing_trace_options_show(struct seq_file *m, void *v)
trace_opts = tr->current_trace->flags->opts;
for (i = 0; trace_options[i]; i++) {
+ if (strlen(trace_options[i]) == 0)
+ continue;
if (tr->trace_flags & (1 << i))
seq_printf(m, "%s\n", trace_options[i]);
else
@@ -8359,6 +8361,8 @@ static void create_trace_options_dir(struct trace_array *tr)
return;
for (i = 0; trace_options[i]; i++) {
+ if (strlen(trace_options[i]) == 0)
+ continue;
if (top_level ||
!((1 << i) & TOP_LEVEL_TRACE_FLAGS))
create_trace_option_core_file(tr, trace_options[i], i);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 4eb1d004d5f2..6d9f0bba09c3 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1264,6 +1264,8 @@ extern void trace_parser_put(struct trace_parser *parser);
extern int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
size_t cnt, loff_t *ppos);
+#define TRACE_OPTION_HIDE_NAME ""
+
/*
* Only create function graph options if function graph is configured.
*/
@@ -1321,7 +1323,7 @@ extern int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
C(SYM_USEROBJ, "sym-userobj"), \
C(PRINTK_MSGONLY, "printk-msg-only"), \
C(CONTEXT_INFO, "context-info"), /* Print pid/cpu/time */ \
- C(LATENCY_FMT, "latency-format"), \
+ C(LATENCY_FMT, TRACE_OPTION_HIDE_NAME),\
C(RECORD_CMD, "record-cmd"), \
C(RECORD_TGID, "record-tgid"), \
C(OVERWRITE, "overwrite"), \
--
2.25.1
next reply other threads:[~2020-05-16 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-16 16:10 Changbin Du [this message]
2020-05-16 17:15 ` Steven Rostedt
2020-05-17 9:34 ` Changbin Du
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=20200516161017.155791-1-changbin.du@gmail.com \
--to=changbin.du@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.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
all inboxes | Powered by JetHome®