Commit e948916
committed
tracing: Fix ftrace_boot_snapshot command line logic
The kernel command line ftrace_boot_snapshot by itself is supposed to
trigger a snapshot at the end of boot up of the main top level trace
buffer. A ftrace_boot_snapshot=foo will do the same for an instance called
foo that was created by trace_instance=foo,...
The logic was broken where if ftrace_boot_snapshot was by itself, it would
trigger a snapshot for all instances that had tracing enabled, regardless
if it asked for a snapshot or not.
When a snapshot is requested for a buffer, the buffer's
tr->allocated_snapshot is set to true. Use that to know if a trace buffer
wants a snapshot at boot up or not.
Since the top level buffer is part of the ftrace_trace_arrays list,
there's no reason to treat it differently than the other buffers. Just
iterate the list if ftrace_boot_snapshot was specified.
Link: https://lkml.kernel.org/r/[email protected]
Cc: [email protected]
Cc: Masami Hiramatsu <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Ross Zwisler <[email protected]>
Fixes: 9c1c251 ("tracing: Allow boot instances to have snapshot buffers")
Signed-off-by: Steven Rostedt (Google) <[email protected]>1 parent 9d52727 commit e948916
1 file changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10393 | 10393 | | |
10394 | 10394 | | |
10395 | 10395 | | |
| 10396 | + | |
10396 | 10397 | | |
10397 | 10398 | | |
10398 | | - | |
10399 | | - | |
10400 | | - | |
10401 | | - | |
| 10399 | + | |
| 10400 | + | |
10402 | 10401 | | |
10403 | 10402 | | |
10404 | | - | |
| 10403 | + | |
10405 | 10404 | | |
10406 | | - | |
| 10405 | + | |
10407 | 10406 | | |
| 10407 | + | |
10408 | 10408 | | |
| 10409 | + | |
10409 | 10410 | | |
10410 | 10411 | | |
10411 | 10412 | | |
| |||
0 commit comments