diff options
| author | Stanislav Fomichev <[email protected]> | 2021-01-15 08:35:01 -0800 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2021-01-20 14:23:00 -0800 |
| commit | a9ed15dae0755a0368735e0556a462d8519bdb05 (patch) | |
| tree | 9b945424784d01048fb9837d35f81e7e3790b7c7 /tools/perf/scripts/python | |
| parent | 20f2505fb436cfa674cf1f46aaa624f44d3d1d03 (diff) | |
bpf: Split cgroup_bpf_enabled per attach type
When we attach any cgroup hook, the rest (even if unused/unattached) start
to contribute small overhead. In particular, the one we want to avoid is
__cgroup_bpf_run_filter_skb which does two redirections to get to
the cgroup and pushes/pulls skb.
Let's split cgroup_bpf_enabled to be per-attach to make sure
only used attach types trigger.
I've dropped some existing high-level cgroup_bpf_enabled in some
places because BPF_PROG_CGROUP_XXX_RUN macros usually have another
cgroup_bpf_enabled check.
I also had to copy-paste BPF_CGROUP_RUN_SA_PROG_LOCK for
GETPEERNAME/GETSOCKNAME because type for cgroup_bpf_enabled[type]
has to be constant and known at compile time.
Signed-off-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Song Liu <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions