switch-linux/kernel/trace
Yonghong Song e87c6bc385 bpf: permit multiple bpf attachments for a single perf event
This patch enables multiple bpf attachments for a
kprobe/uprobe/tracepoint single trace event.
Each trace_event keeps a list of attached perf events.
When an event happens, all attached bpf programs will
be executed based on the order of attachment.

A global bpf_event_mutex lock is introduced to protect
prog_array attaching and detaching. An alternative will
be introduce a mutex lock in every trace_event_call
structure, but it takes a lot of extra memory.
So a global bpf_event_mutex lock is a good compromise.

The bpf prog detachment involves allocation of memory.
If the allocation fails, a dummy do-nothing program
will replace to-be-detached program in-place.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-25 10:47:47 +09:00
..
blktrace.c blktrace: Fix potential deadlock between delete & sysfs ops 2017-09-25 08:56:05 -06:00
bpf_trace.c bpf: permit multiple bpf attachments for a single perf event 2017-10-25 10:47:47 +09:00
ftrace.c ftrace: Fix kmemleak in unregister_ftrace_graph 2017-10-03 10:27:32 -04:00
Kconfig
Makefile
power-traces.c
ring_buffer.c
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Fix trace_pipe behavior for instance traces 2017-09-19 18:33:42 -04:00
trace.h tracing: Ignore mmiotrace from kernel commandline 2017-09-19 12:36:01 -04:00
trace_benchmark.c
trace_benchmark.h
trace_branch.c
trace_clock.c
trace_entries.h
trace_event_perf.c
trace_events.c
trace_events_filter.c mm: treewide: remove GFP_TEMPORARY allocation flag 2017-09-13 18:53:16 -07:00
trace_events_filter_test.h
trace_events_hist.c
trace_events_trigger.c
trace_export.c
trace_functions.c
trace_functions_graph.c treewide: make "nr_cpu_ids" unsigned 2017-09-08 18:26:48 -07:00
trace_hwlat.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c bpf: permit multiple bpf attachments for a single perf event 2017-10-25 10:47:47 +09:00
trace_mmiotrace.c tracing: Ignore mmiotrace from kernel commandline 2017-09-19 12:36:01 -04:00
trace_nop.c
trace_output.c sched/tracing: Use common task-state helpers 2017-09-29 11:02:45 +02:00
trace_output.h
trace_printk.c
trace_probe.c
trace_probe.h
trace_sched_switch.c
trace_sched_wakeup.c sched/tracing: Use common task-state helpers 2017-09-29 11:02:45 +02:00
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c tracing: Remove RCU work arounds from stack tracer 2017-09-23 16:50:20 -04:00
trace_stat.c
trace_stat.h
trace_syscalls.c bpf: permit multiple bpf attachments for a single perf event 2017-10-25 10:47:47 +09:00
trace_uprobe.c bpf: permit multiple bpf attachments for a single perf event 2017-10-25 10:47:47 +09:00
tracing_map.c
tracing_map.h