From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>, Jonathan Corbet <corbet@lwn.net>
Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, Randy Dunlap <rdunlap@infradead.org>,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH v2 2/6] tracing/boot: Add per-instance tracing_on option support
Date: Tue, 1 Sep 2020 16:56:51 +0900 [thread overview]
Message-ID: <159894701104.1478826.1237212368863627614.stgit@devnote2> (raw)
In-Reply-To: <159894698993.1478826.2813843560314595660.stgit@devnote2>
Add per-instance tracing_on option, which will be useful with
traceon/traceoff event trigger actions. For example, if we
disable tracing_on by default and set traceon and traceoff on
a pair of events, we can trace functions between the pair of
events.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
kernel/trace/trace_boot.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
index fa0fc08c6ef8..d52d441a17e8 100644
--- a/kernel/trace/trace_boot.c
+++ b/kernel/trace/trace_boot.c
@@ -40,6 +40,16 @@ trace_boot_set_instance_options(struct trace_array *tr, struct xbc_node *node)
pr_err("Failed to set option: %s\n", buf);
}
+ p = xbc_node_find_value(node, "tracing_on", NULL);
+ if (p && *p != '\0') {
+ if (kstrtoul(p, 10, &v))
+ pr_err("Failed to set tracing on: %s\n", p);
+ if (v)
+ tracer_tracing_on(tr);
+ else
+ tracer_tracing_off(tr);
+ }
+
p = xbc_node_find_value(node, "trace_clock", NULL);
if (p && *p != '\0') {
if (tracing_set_clock(tr, p) < 0)
next prev parent reply other threads:[~2020-09-01 7:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 7:56 [PATCH v2 0/6] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
2020-09-01 7:56 ` [PATCH v2 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
2020-09-01 7:56 ` Masami Hiramatsu [this message]
2020-09-01 7:57 ` [PATCH v2 3/6] Documentation: tracing: Add tracing_on option to boot-time tracer Masami Hiramatsu
2020-09-01 7:57 ` [PATCH v2 4/6] tracing/kprobes: Support perf-style return probe Masami Hiramatsu
2020-09-10 0:49 ` Masami Hiramatsu
2020-09-01 7:57 ` [PATCH v2 5/6] Documentation: tracing: Add %return suffix description Masami Hiramatsu
2020-09-01 7:57 ` [PATCH v2 6/6] Documentation: tracing: boot: Add an example of tracing function-calls Masami Hiramatsu
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=159894701104.1478826.1237212368863627614.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rdunlap@infradead.org \
--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;
as well as URLs for NNTP newsgroup(s).