remarkable-linux/kernel/trace
Oleg Nesterov 2816c551c7 tracing: trace_remove_event_call() should fail if call/file is in use
Change trace_remove_event_call(call) to return the error if this
call is active. This is what the callers assume but can't verify
outside of the tracing locks. Both trace_kprobe.c/trace_uprobe.c
need the additional changes, unregister_trace_probe() should abort
if trace_remove_event_call() fails.

The caller is going to free this call/file so we must ensure that
nobody can use them after trace_remove_event_call() succeeds.
debugfs should be fine after the previous changes and event_remove()
does TRACE_REG_UNREGISTER, but still there are 2 reasons why we need
the additional checks:

- There could be a perf_event(s) attached to this tp_event, so the
  patch checks ->perf_refcount.

- TRACE_REG_UNREGISTER can be suppressed by FTRACE_EVENT_FL_SOFT_MODE,
  so we simply check FTRACE_EVENT_FL_ENABLED protected by event_mutex.

Link: http://lkml.kernel.org/r/20130729175033.GB26284@redhat.com

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-07-31 13:12:48 -04:00
..
blktrace.c Merge branch 'for-3.10/drivers' of git://git.kernel.dk/linux-block 2013-05-08 11:51:05 -07:00
ftrace.c ftrace: Check module functions being traced on reload 2013-07-30 20:52:51 -04:00
Kconfig ring-buffer: Select IRQ_WORK 2013-05-03 19:24:17 -04:00
Makefile
power-traces.c
ring_buffer.c tracing: Typo fix on ring buffer comments 2013-07-18 21:31:26 -04:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus() 2013-07-26 08:57:32 -04:00
trace.h tracing: Kill trace_cpu struct/members 2013-07-24 11:22:53 -04:00
trace_branch.c
trace_clock.c tracing: Add "uptime" trace clock that uses jiffies 2013-03-15 00:36:09 -04:00
trace_entries.h tracing: Add trace_puts() for even faster trace_printk() tracing 2013-03-15 00:35:55 -04:00
trace_event_perf.c tracing/perf: Move the PERF_MAX_TRACE_SIZE check into perf_trace_buf_prepare() 2013-07-18 21:31:28 -04:00
trace_events.c tracing: trace_remove_event_call() should fail if call/file is in use 2013-07-31 13:12:48 -04:00
trace_events_filter.c tracing: Change event_filter_read/write to verify i_private != NULL 2013-07-29 22:56:59 -04:00
trace_events_filter_test.h
trace_export.c
trace_functions.c tracing: Add ref_data to function and fgraph tracer structs 2013-07-18 21:31:31 -04:00
trace_functions_graph.c tracing: Add ref_data to function and fgraph tracer structs 2013-07-18 21:31:31 -04:00
trace_irqsoff.c tracing: Use flag buffer_disabled for irqsoff tracer 2013-07-01 20:34:28 -04:00
trace_kdb.c
trace_kprobe.c tracing/kprobe: Wait for disabling all running kprobe handlers 2013-07-18 21:31:29 -04:00
trace_mmiotrace.c tracing: Use trace_seq_puts()/trace_seq_putc() where possible 2013-07-18 21:30:36 -04:00
trace_nop.c
trace_output.c tracing: Use trace_seq_puts()/trace_seq_putc() where possible 2013-07-18 21:30:36 -04:00
trace_output.h tracing: Rename trace_event_mutex to trace_event_sem 2013-03-15 13:22:10 -04:00
trace_printk.c
trace_probe.c
trace_probe.h
trace_sched_switch.c
trace_sched_wakeup.c tracing: Add function-trace option to disable function tracing of latency tracers 2013-03-15 00:36:08 -04:00
trace_selftest.c ftrace: Do not run selftest if command line parameter is set 2013-07-01 20:57:15 -04:00
trace_selftest_dynamic.c
trace_stack.c Tracing updates for Linux 3.10 2013-04-29 13:55:38 -07:00
trace_stat.c tracing: Check return value of tracing_init_dentry() 2013-04-12 23:02:32 -04:00
trace_stat.h
trace_syscalls.c tracing/perf: Move the PERF_MAX_TRACE_SIZE check into perf_trace_buf_prepare() 2013-07-18 21:31:28 -04:00
trace_uprobe.c tracing/perf: Move the PERF_MAX_TRACE_SIZE check into perf_trace_buf_prepare() 2013-07-18 21:31:28 -04:00