Skip to content

Commit 8490db0

Browse files
mhiramatrostedt
authored andcommitted
tracing/boot: Add per-instance tracing_on option support
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. Link: https://lkml.kernel.org/r/159972811538.428528.2561315102284268611.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 40d14da commit 8490db0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎kernel/trace/trace_boot.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ trace_boot_set_instance_options(struct trace_array *tr, struct xbc_node *node)
4040
pr_err("Failed to set option: %s\n", buf);
4141
}
4242

43+
p = xbc_node_find_value(node, "tracing_on", NULL);
44+
if (p && *p != '\0') {
45+
if (kstrtoul(p, 10, &v))
46+
pr_err("Failed to set tracing on: %s\n", p);
47+
if (v)
48+
tracer_tracing_on(tr);
49+
else
50+
tracer_tracing_off(tr);
51+
}
52+
4353
p = xbc_node_find_value(node, "trace_clock", NULL);
4454
if (p && *p != '\0') {
4555
if (tracing_set_clock(tr, p) < 0)

0 commit comments

Comments
 (0)