linux/kernel/trace
Steven Rostedt (VMware) 2824f50332 tracing: Make the snapshot trigger work with instances
The snapshot trigger currently only affects the main ring buffer, even when
it is used by the instances. This can be confusing as the snapshot trigger
is listed in the instance.

 > # cd /sys/kernel/tracing
 > # mkdir instances/foo
 > # echo snapshot > instances/foo/events/syscalls/sys_enter_fchownat/trigger
 > # echo top buffer > trace_marker
 > # echo foo buffer > instances/foo/trace_marker
 > # touch /tmp/bar
 > # chown rostedt /tmp/bar
 > # cat instances/foo/snapshot
 # tracer: nop
 #
 #
 # * Snapshot is freed *
 #
 # Snapshot commands:
 # echo 0 > snapshot : Clears and frees snapshot buffer
 # echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.
 #                      Takes a snapshot of the main buffer.
 # echo 2 > snapshot : Clears snapshot buffer (but does not allocate or free)
 #                      (Doesn't have to be '2' works with any number that
 #                       is not a '0' or '1')

 > # cat snapshot
 # tracer: nop
 #
 #                              _-----=> irqs-off
 #                             / _----=> need-resched
 #                            | / _---=> hardirq/softirq
 #                            || / _--=> preempt-depth
 #                            ||| /     delay
 #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
 #              | |       |   ||||       |         |
             bash-1189  [000] ....   111.488323: tracing_mark_write: top buffer

Not only did the snapshot occur in the top level buffer, but the instance
snapshot buffer should have been allocated, and it is still free.

Cc: stable@vger.kernel.org
Fixes: 85f2b08268 ("tracing: Add basic event trigger framework")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-05-28 12:49:32 -04:00
..
Kconfig tracing: Add inter-event blurb to HIST_TRIGGERS config option 2018-03-10 16:06:05 -05:00
Makefile Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
blktrace.c blktrace: fix trace mutex deadlock 2017-11-27 12:03:58 -07:00
bpf_trace.c bpf/tracing: fix a deadlock in perf_event_detach_bpf_prog 2018-04-11 01:01:40 +02:00
ftrace.c ftrace: Have set_graph_* files have normal file modes 2018-05-03 11:55:31 -04:00
power-traces.c
ring_buffer.c ring-buffer: Add set/clear_current_oom_origin() during allocations 2018-04-06 08:56:52 -04:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Make the snapshot trigger work with instances 2018-05-28 12:49:32 -04:00
trace.h tracing: Make the snapshot trigger work with instances 2018-05-28 12:49:32 -04:00
trace_benchmark.c trace: Eliminate cond_resched_rcu_qs() in favor of cond_resched() 2017-12-04 10:28:58 -08:00
trace_benchmark.h
trace_branch.c
trace_clock.c tracing: Hide global trace clock from lockdep 2018-04-06 08:56:52 -04:00
trace_entries.h tracing: Fix missing tab for hwlat_detector print format 2018-04-25 10:28:46 -04:00
trace_event_perf.c perf/core: Fix perf_uprobe_init() 2018-04-10 07:33:10 +02:00
trace_events.c tracing: Make sure the parsed string always terminates with '\0' 2018-01-23 15:57:28 -05:00
trace_events_filter.c tracing: Fix regex_match_front() to not over compare the test string 2018-05-11 10:56:42 -04:00
trace_events_filter_test.h
trace_events_hist.c tracing: Add field modifier parsing hist error for hist triggers 2018-04-26 21:39:58 -04:00
trace_events_trigger.c tracing: Make the snapshot trigger work with instances 2018-05-28 12:49:32 -04:00
trace_export.c
trace_functions.c tracing: Update stack trace skipping for ORC unwinder 2018-01-23 15:57:00 -05:00
trace_functions_graph.c
trace_hwlat.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c trace_kprobe: Remove warning message "Could not insert probe at..." 2018-04-17 07:54:57 +02:00
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_printk.c treewide: Align function definition open/close braces 2018-03-26 11:13:09 +02:00
trace_probe.c tracing: probeevent: Fix to support minus offset from symbol 2018-03-23 12:02:37 -04:00
trace_probe.h Merge branch 'perf/urgent' into perf/core 2018-03-29 16:03:48 +02:00
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
trace_selftest_dynamic.c ftrace: Mark function tracer test functions noinline/noclone 2018-01-23 15:57:29 -05:00
trace_seq.c
trace_stack.c tracing: Fix the file mode of stack tracer 2018-05-03 11:58:05 -04:00
trace_stat.c
trace_stat.h
trace_syscalls.c Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
trace_uprobe.c tracing: Fix bad use of igrab in trace_uprobe.c 2018-04-26 14:49:55 -04:00
tracing_map.c tracing: Add per-element variable support to tracing_map 2018-03-10 16:05:53 -05:00
tracing_map.h tracing: Add per-element variable support to tracing_map 2018-03-10 16:05:53 -05:00