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)
19 int duration = 0, err;
20 struct test_vmlinux* skel;
21 struct test_vmlinux__bss *bss;
23 skel = test_vmlinux__open_and_load();
24 if (CHECK(!skel, "skel_open", "failed to open skeleton\n"))
28 err = test_vmlinux__attach(skel);
29 if (CHECK(err, "skel_attach", "skeleton attach failed: %d\n", err))
32 /* trigger everything */
35 CHECK(!bss->tp_called, "tp", "not called\n");
36 CHECK(!bss->raw_tp_called, "raw_tp", "not called\n");
37 CHECK(!bss->tp_btf_called, "tp_btf", "not called\n");
38 CHECK(!bss->kprobe_called, "kprobe", "not called\n");
39 CHECK(!bss->fentry_called, "fentry", "not called\n");
42 test_vmlinux__destroy(skel);