Skip to content

Commit c163409

Browse files
mhiramatrostedt
authored andcommitted
tracing/boot: Add ftrace.instance.*.alloc_snapshot option
Add ftrace.instance.*.alloc_snapshot option. This option has been described in Documentation/trace/boottime-trace.rst but not implemented yet. ftrace.[instance.INSTANCE.]alloc_snapshot Allocate snapshot buffer. The difference from kernel.alloc_snapshot is that the kernel.alloc_snapshot will allocate the buffer only for the main instance, but this can allocate buffer for any new instances. Link: https://lkml.kernel.org/r/160234368948.400560.15313384470765915015.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent bbeb974 commit c163409

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

kernel/trace/trace_boot.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,12 @@ trace_boot_enable_tracer(struct trace_array *tr, struct xbc_node *node)
284284
if (tracing_set_tracer(tr, p) < 0)
285285
pr_err("Failed to set given tracer: %s\n", p);
286286
}
287+
288+
/* Since tracer can free snapshot buffer, allocate snapshot here.*/
289+
if (xbc_node_find_value(node, "alloc_snapshot", NULL)) {
290+
if (tracing_alloc_snapshot_instance(tr) < 0)
291+
pr_err("Failed to allocate snapshot buffer\n");
292+
}
287293
}
288294

289295
static void __init

0 commit comments

Comments
 (0)