1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2020 Facebook */
4 #include <test_progs.h>
6 #include "test_vmlinux.skel.h"
8 #define MY_TV_NSEC 1337
12 struct timespec ts = { .tv_nsec = MY_TV_NSEC };
14 (void)syscall(__NR_nanosleep, &ts, NULL);
17 void test_vmlinux(void)
20 struct test_vmlinux* skel;
21 struct test_vmlinux__bss *bss;
23 skel = test_vmlinux__open_and_load();
24 if (!ASSERT_OK_PTR(skel, "test_vmlinux__open_and_load"))
28 err = test_vmlinux__attach(skel);
29 if (!ASSERT_OK(err, "test_vmlinux__attach"))
32 /* trigger everything */
35 ASSERT_TRUE(bss->tp_called, "tp");
36 ASSERT_TRUE(bss->raw_tp_called, "raw_tp");
37 ASSERT_TRUE(bss->tp_btf_called, "tp_btf");
38 ASSERT_TRUE(bss->kprobe_called, "kprobe");
39 ASSERT_TRUE(bss->fentry_called, "fentry");
42 test_vmlinux__destroy(skel);