diff options
| author | Arnaud Lecomte <contact@arnaud-lcm.com> | 2025-10-25 19:28:58 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2025-10-28 09:20:27 -0700 |
| commit | e17d62fedd10ae56e2426858bd0757da544dbc73 (patch) | |
| tree | cdf579b98fedaeace319874e2cd13d12b4838d63 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
| parent | 88427328e35dfd8532cd78e9cc9e2b7c97be34c3 (diff) | |
bpf: Refactor stack map trace depth calculation into helper function
Extract the duplicated maximum allowed depth computation for stack
traces stored in BPF stacks from bpf_get_stackid() and __bpf_get_stack()
into a dedicated stack_map_calculate_max_depth() helper function.
This unifies the logic for:
- The max depth computation
- Enforcing the sysctl_perf_event_max_stack limit
No functional changes for existing code paths.
Signed-off-by: Arnaud Lecomte <contact@arnaud-lcm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/bpf/20251025192858.31424-1-contact@arnaud-lcm.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions
