diff options
| author | Yonghong Song <[email protected]> | 2017-10-24 06:53:08 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2017-10-25 01:47:47 +0000 |
| commit | e87c6bc3852b981e71c757be20771546ce9f76f3 (patch) | |
| tree | bad3be630137d8e873f4ad5a1ea77b4aa1853184 /samples/bpf/syscall_tp_user.c | |
| parent | bpf: use the same condition in perf event set/free bpf handler (diff) | |
| download | kernel-e87c6bc3852b981e71c757be20771546ce9f76f3.tar.gz kernel-e87c6bc3852b981e71c757be20771546ce9f76f3.zip | |
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 <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'samples/bpf/syscall_tp_user.c')
0 files changed, 0 insertions, 0 deletions
