From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: [bpf-next PATCH 0/5] tools/libbpf improvements and selftests Date: Sat, 27 Jan 2018 18:26:57 +0100 Message-ID: <151707400217.12604.5522514180508858186.stgit@firesoul> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: acme@redhat.com, joe@ovn.org, jakub.kicinski@netronome.com, eric@regit.org, Jesper Dangaard Brouer To: netdev@vger.kernel.org, Daniel Borkmann , Alexei Starovoitov , wangnan0@huawei.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33444 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752685AbeA0R1B (ORCPT ); Sat, 27 Jan 2018 12:27:01 -0500 Sender: netdev-owner@vger.kernel.org List-ID: While playing with using libbpf for the Suricata project, we had issues LLVM >= 4.0.1 generating ELF files that could not be loaded with libbpf (tools/lib/bpf/). During the troubleshooting phase, I wrote a test program and improved the debugging output in libbpf. I turned this into a selftests program, and it also serves as a code example for libbpf in itself. I discovered that there are at least three ELF load issues with libbpf. I left them as TODO comments in (tools/testing/selftests/bpf) test_libbpf.sh. I've only fixed the load issue with eh_frames. We can work on the other issues later. --- Jesper Dangaard Brouer (5): bpf: Sync kernel ABI header with tooling header for bpf_common.h tools/libbpf: improve the pr_debug statements to contain section numbers tools/libbpf: add test program for loading BPF ELF files selftests/bpf: add selftest that use test_libbpf_open tools/libbpf: handle issues with bpf ELF objects containing .eh_frames tools/testing/selftests/bpf/Makefile | 9 +++++- tools/testing/selftests/bpf/test_libbpf.sh | 45 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100755 tools/testing/selftests/bpf/test_libbpf.sh