Files
kernel_xiaomi_raphael/include/linux
Yonghong Song 5179a6a673 UPSTREAM: 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>
(cherry picked from commit e87c6bc3852b981e71c757be20771546ce9f76f3)
Signed-off-by: Connor O'Brien <connoro@google.com>
Bug: 121213201
Bug: 138317270
Test: build & boot cuttlefish; attach 2 progs to 1 tracepoint
Change-Id: I25ce1ed6c9512d0a6f2db7547e109958fe1619b6
2019-12-11 20:04:37 -08:00
..
2018-08-03 08:56:38 +02:00
2019-12-05 15:48:19 +01:00
2018-05-25 17:23:22 +02:00
2018-10-04 16:14:47 -07:00
2019-04-20 09:15:10 +02:00
2018-04-24 09:36:39 +02:00
2018-02-22 15:42:23 +01:00
2019-08-09 18:07:12 +02:00
2019-08-09 18:07:12 +02:00
2017-08-30 14:40:40 +02:00
2019-03-13 14:18:51 -07:00
2018-09-26 08:42:37 +02:00
2017-08-24 13:23:03 -07:00
2018-02-22 15:42:23 +01:00
2019-11-24 08:22:48 +01:00
2017-08-07 17:22:14 +02:00
2019-12-05 15:38:28 +01:00
2018-06-21 04:02:49 +09:00
2018-02-22 15:42:24 +01:00
2018-01-04 13:50:35 +01:00
2017-08-28 20:51:22 +02:00
2017-09-07 11:53:11 +02:00
2019-11-14 14:38:28 +08:00
2019-11-14 14:38:28 +08:00
2019-06-09 09:27:43 +02:00
2018-01-29 19:39:59 -08:00
2018-02-22 15:42:23 +01:00
2017-07-25 18:05:25 +02:00
2017-09-25 08:56:05 -06:00
2019-11-14 14:38:28 +08:00
2017-08-06 20:55:29 -07:00
2019-08-12 13:29:46 -04:00
2018-02-22 19:18:40 +00:00
2018-10-04 16:14:47 -07:00
2019-03-23 00:52:29 +00:00
2019-06-11 12:21:48 +02:00
2019-12-05 15:48:19 +01:00
2017-08-16 16:28:47 -07:00
2019-11-10 11:25:37 +01:00
2019-04-17 08:37:44 +02:00
2018-04-26 11:37:46 +02:00
2019-12-05 15:48:19 +01:00
2019-08-12 13:29:46 -04:00
2018-11-13 11:15:11 -08:00
2019-06-17 19:52:43 +02:00
2017-07-24 17:50:37 +02:00
2018-09-10 09:21:07 +02:00
2017-08-31 18:50:14 +02:00
2017-08-15 09:02:07 -07:00
2017-08-15 09:02:08 -07:00