]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: add test program for loading BPF ELF files
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 8 Feb 2018 11:48:22 +0000 (12:48 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 8 Feb 2018 23:24:38 +0000 (00:24 +0100)
commit8753cabcf9b7dab8718e1635351752fa1a1a3f46
tree84c4458cafdc4048669a3c47c698e2849fbb933f
parent108eec1f8dde7db9daaf8b367db26283ab9f6223
selftests/bpf: add test program for loading BPF ELF files

V2: Moved program into selftests/bpf from tools/libbpf

This program can be used on its own for testing/debugging if a
BPF ELF-object file can be loaded with libbpf (from tools/lib/bpf).

If something is wrong with the ELF object, the program have
a --debug mode that will display the ELF sections and especially
the skipped sections.  This allows for quickly identifying the
problematic ELF section number, which can be corrolated with the
readelf tool.

The program signal error via return codes, and also have
a --quiet mode, which is practical for use in scripts like
selftests/bpf.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_libbpf_open.c [new file with mode: 0644]