summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorAndrey Grodzovsky <andrey.grodzovsky@crowdstrike.com>2026-03-02 15:08:35 -0500
committerAndrii Nakryiko <andrii@kernel.org>2026-03-05 15:14:24 -0800
commit6afc431db1b4c21fec96cf6bea29489f4dce17c5 (patch)
treec45ff52c3f18e0dc15c26555dd39c26726816b49 /tools/perf/scripts/python
parent748f9c6811b973a518436136fb86e6284a8854c1 (diff)
libbpf: Optimize kprobe.session attachment for exact function names
Detect exact function names (no wildcards) in bpf_program__attach_kprobe_multi_opts() and bypass kallsyms parsing, passing the symbol directly to the kernel via syms[] array. This benefits all callers, not just kprobe.session. When the pattern contains no '*' or '?' characters, set syms to point directly at the pattern string and cnt to 1, skipping the expensive /proc/kallsyms or available_filter_functions parsing (~150ms per function). Error code normalization: the fast path returns ESRCH from kernel's ftrace_lookup_symbols(), while the slow path returns ENOENT from userspace kallsyms parsing. Convert ESRCH to ENOENT in the bpf_link_create error path to maintain API consistency - both paths now return identical error codes for "symbol not found". Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20260302200837.317907-2-andrey.grodzovsky@crowdstrike.com
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions