Re: [PATCH bpf-next v5 3/3] selftests/bpf: Add stacktrace map lookup_and_delete_elem test case

From: Tao Chen

Date: Thu Sep 25 2025 - 09:13:24 EST


在 2025/9/25 20:09, Daniel Borkmann 写道:
On 9/23/25 6:58 PM, Tao Chen wrote:
Add tests for stacktrace map lookup and delete:
1. use bpf_map_lookup_and_delete_elem to lookup and delete the target
    stack_id,
2. lookup the deleted stack_id again to double check.

Signed-off-by: Tao Chen <chen.dylane@xxxxxxxxx>
---
  .../testing/selftests/bpf/prog_tests/stacktrace_map.c | 11 ++++++++++-
  tools/testing/selftests/bpf/progs/stacktrace_map.c    |  2 ++
  2 files changed, 12 insertions(+), 1 deletion(-)
BPF CI fails with:

Notice: Success: 644/5645, Skipped: 82, Failed: 1
Error: #402 stacktrace_map_raw_tp
  Error: #402 stacktrace_map_raw_tp
  libbpf: elf: failed to open ./test_stacktrace_map.bpf.o: -ENOENT
  test_stacktrace_map_raw_tp:FAIL:prog_load raw tp err -2 errno 2
Test Results:
             bpftool: PASS
          test_progs: FAIL (returned 1)
Error: Process completed with exit code 1.

https://github.com/kernel-patches/bpf/actions/runs/17993777572

Hi Daniel,

It seems that stacktrace_map_raw_tp will use test_stacktrace_map.bpf.c,
which is renamed to stacktrace_map.c in my patch, i will fix it, thanks.

tools/testing/selftests/bpf/prog_tests/stacktrace_map_raw_tp.c:8: const char *file = "./test_stacktrace_map.bpf.o";

--
Best Regards
Tao Chen