diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-04-03 17:26:40 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-04-04 13:08:01 -0700 |
commit | 314a53623cd4e62e1b88126e5ed2bc87073d90ee (patch) | |
tree | 05376a14c790f914df2197a0431c3608ac025e66 /tools/bpf/bpftool/prog.c | |
parent | 5e6a3c1ee693da1793739bb378b224bcf33d7f14 (diff) |
bpf: inline bpf_get_branch_snapshot() helper
Inline bpf_get_branch_snapshot() helper using architecture-agnostic
inline BPF code which calls directly into underlying callback of
perf_snapshot_branch_stack static call. This callback is set early
during kernel initialization and is never updated or reset, so it's ok
to fetch actual implementation using static_call_query() and call
directly into it.
This change eliminates a full function call and saves one LBR entry
in PERF_SAMPLE_BRANCH_ANY LBR mode.
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20240404002640.1774210-3-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions