]> Git Repo - linux.git/commitdiff
tracing/boot: Add per-instance tracing_on option support
authorMasami Hiramatsu <[email protected]>
Thu, 10 Sep 2020 08:55:15 +0000 (17:55 +0900)
committerSteven Rostedt (VMware) <[email protected]>
Tue, 22 Sep 2020 01:06:03 +0000 (21:06 -0400)
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 <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
kernel/trace/trace_boot.c

index fa0fc08c6ef8a1012f125c4eedf09f4dbbf84a6a..d52d441a17e80ee0b1a20019e4780099ad766f91 100644 (file)
@@ -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)
This page took 0.056259 seconds and 4 git commands to generate.