summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/fentry_test.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-12-17 21:25:50 -0800
committerAlexei Starovoitov <ast@kernel.org>2019-12-17 22:16:35 -0800
commit5dc7a8b2114479fd945956ece9875f747a996a8e (patch)
tree1fcb389abfbd012fe1156511a48152f20248b35f /tools/testing/selftests/bpf/prog_tests/fentry_test.c
parent4a3d6c6a6e4d652808729e7a2a8c3774a5a5c814 (diff)
downloadlinux-5dc7a8b2114479fd945956ece9875f747a996a8e.tar.gz
linux-5dc7a8b2114479fd945956ece9875f747a996a8e.tar.bz2
linux-5dc7a8b2114479fd945956ece9875f747a996a8e.zip
bpftool, selftests/bpf: Embed object file inside skeleton
Embed contents of BPF object file used for BPF skeleton generation inside skeleton itself. This allows to keep BPF object file and its skeleton in sync at all times, and simpifies skeleton instantiation. Also switch existing selftests to not require BPF_EMBED_OBJ anymore. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20191218052552.2915188-2-andriin@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/fentry_test.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/fentry_test.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/fentry_test.c b/tools/testing/selftests/bpf/prog_tests/fentry_test.c
index 46a4afdf507a..e1a379f5f7d2 100644
--- a/tools/testing/selftests/bpf/prog_tests/fentry_test.c
+++ b/tools/testing/selftests/bpf/prog_tests/fentry_test.c
@@ -4,9 +4,6 @@
#include "test_pkt_access.skel.h"
#include "fentry_test.skel.h"
-BPF_EMBED_OBJ_DECLARE(pkt_access);
-BPF_EMBED_OBJ_DECLARE(fentry);
-
void test_fentry_test(void)
{
struct test_pkt_access *pkt_skel = NULL;
@@ -15,10 +12,10 @@ void test_fentry_test(void)
__u32 duration, retval;
__u64 *result;
- pkt_skel = test_pkt_access__open_and_load(&pkt_access_embed);
+ pkt_skel = test_pkt_access__open_and_load();
if (CHECK(!pkt_skel, "pkt_skel_load", "pkt_access skeleton failed\n"))
return;
- fentry_skel = fentry_test__open_and_load(&fentry_embed);
+ fentry_skel = fentry_test__open_and_load();
if (CHECK(!fentry_skel, "fentry_skel_load", "fentry skeleton failed\n"))
goto cleanup;