Skip to content

CO-RE candidate matching fix and tracing test

Andrii Nakryiko bpf netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4selftests/bpf: ensure consistent test failure outputtools/testing/selftests/bpf/test_progs.c tools/testing/selftests/bpf/test_progs.h+9 -90 replies
2/4libbpf: ignore incompatible types with matching name during CO-RE relocationtools/lib/bpf/libbpf.c+4 -00 replies
3/4libbpf: provide CO-RE variants of PT_REGS macrostools/lib/bpf/bpf_tracing.h+103 -00 replies
4/4selftests/bpf: add vmlinux.h selftest exercising tracing of syscallstools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/prog_tests/vmlinux.c tools/testing/selftests/bpf/progs/test_vmlinux.c+147 -12 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/4] CO-RE candidate matching fix and tracing test

This patch set fixes bug in CO-RE relocation candidate finding logic, which currently allows matching against forward declarations, functions, and other named types, even though it makes no sense to even attempt. As part of verifying the fix, add test using vmlinux.h with preserve_access_index attribute and utilizing struct pt_regs heavily to trace nanosleep syscall using 5 different types of tracing BPF programs.

This test also demonstrated problems using struct pt_regs in syscall tracepoints and required a new set of macro, which were added in patch #3 into bpf_tracing.h.

Patch #1 fixes annoying issue with selftest failure messages being out of sync.

Andrii Nakryiko (4):
selftests/bpf: ensure consistent test failure output
libbpf: ignore incompatible types with matching name during CO-RE
relocation
libbpf: provide CO-RE variants of PT_REGS macros selftests/bpf: add vmlinux.h selftest exercising tracing of syscalls

 tools/lib/bpf/bpf_tracing.h                   | 103 ++++++++++++++++++
 tools/lib/bpf/libbpf.c                        |   4 +
 tools/testing/selftests/bpf/Makefile          |   7 +-
 .../selftests/bpf/prog_tests/vmlinux.c        |  43 ++++++++
 .../selftests/bpf/progs/test_vmlinux.c        |  98 +++++++++++++++++
 tools/testing/selftests/bpf/test_progs.c      |  10 +-
 tools/testing/selftests/bpf/test_progs.h      |   8 +-
 7 files changed, 263 insertions(+), 10 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/vmlinux.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_vmlinux.c
Signature · 1 line
2.17.1