From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 1/7] tracing: Only create tracer options files if directory exists
Date: Wed, 04 Feb 2015 09:34:21 -0500 [thread overview]
Message-ID: <20150204143755.061366121@goodmis.org> (raw)
In-Reply-To: 20150204143420.290584004@goodmis.org
[-- Attachment #1: 0001-tracing-Only-create-tracer-options-files-if-director.patch --]
[-- Type: text/plain, Size: 1072 bytes --]
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
Do not bother creating tracer options if no tracing directory
exists. If a tracer is enabled via the command line, and is
started before the tracing directory is created, then it wont have
its tracer specific options created.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 38c613ede10d..d4627f15407a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4172,8 +4172,11 @@ static int tracing_set_tracer(struct trace_array *tr, const char *buf)
free_snapshot(tr);
}
#endif
- /* Currently, only the top instance has options */
- if (tr->flags & TRACE_ARRAY_FL_GLOBAL) {
+ /*
+ * Only enable if the directory has been created already.
+ * Currently, only the top instance has options
+ */
+ if (tr->dir && tr->flags & TRACE_ARRAY_FL_GLOBAL) {
destroy_trace_option_files(topts);
topts = create_trace_option_files(tr, t);
}
--
2.1.4
next prev parent reply other threads:[~2015-02-04 14:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 14:34 [for-next][PATCH 0/7] tracing: Add new filesystem tracefs Steven Rostedt
2015-02-04 14:34 ` Steven Rostedt [this message]
2015-02-04 14:34 ` [for-next][PATCH 2/7] tracing: Create cmdline tracer options on tracing fs init Steven Rostedt
2015-02-04 14:34 ` [for-next][PATCH 3/7] tracefs: Add new tracefs file system Steven Rostedt
2015-02-09 5:56 ` Namhyung Kim
2015-02-09 15:04 ` Steven Rostedt
2015-02-04 14:34 ` [for-next][PATCH 4/7] tracing: Convert the tracing facility over to use tracefs Steven Rostedt
2015-02-04 14:34 ` [for-next][PATCH 5/7] tracing: Automatically mount tracefs on debugfs/tracing Steven Rostedt
2015-02-09 6:00 ` Namhyung Kim
2015-02-09 15:06 ` Steven Rostedt
2015-02-04 14:34 ` [for-next][PATCH 6/7] tracefs: Add directory /sys/kernel/tracing Steven Rostedt
2015-02-04 14:34 ` [for-next][PATCH 7/7] tracing: Have mkdir and rmdir be part of tracefs Steven Rostedt
2015-02-09 6:07 ` Namhyung Kim
2015-02-09 15:07 ` 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=20150204143755.061366121@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).