0001
0002 #include <test_progs.h>
0003 #include "test_stack_var_off.skel.h"
0004
0005
0006
0007
0008 void test_stack_var_off(void)
0009 {
0010 int duration = 0;
0011 struct test_stack_var_off *skel;
0012
0013 skel = test_stack_var_off__open_and_load();
0014 if (CHECK(!skel, "skel_open", "failed to open skeleton\n"))
0015 return;
0016
0017
0018 skel->bss->test_pid = getpid();
0019
0020 skel->bss->input[0] = 2;
0021 skel->bss->input[1] = 42;
0022
0023 if (!ASSERT_OK(test_stack_var_off__attach(skel), "skel_attach"))
0024 goto cleanup;
0025
0026
0027 usleep(1);
0028
0029 if (CHECK(skel->bss->probe_res != 42, "check_probe_res",
0030 "wrong probe res: %d\n", skel->bss->probe_res))
0031 goto cleanup;
0032
0033 cleanup:
0034 test_stack_var_off__destroy(skel);
0035 }