]> Git Repo - J-linux.git/blob - tools/testing/selftests/bpf/prog_tests/timer_crash.c
Merge tag 'vfs-6.13-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[J-linux.git] / tools / testing / selftests / bpf / prog_tests / timer_crash.c
1 // SPDX-License-Identifier: GPL-2.0
2 #include <test_progs.h>
3 #include "timer_crash.skel.h"
4
5 enum {
6         MODE_ARRAY,
7         MODE_HASH,
8 };
9
10 static void test_timer_crash_mode(int mode)
11 {
12         struct timer_crash *skel;
13
14         skel = timer_crash__open_and_load();
15         if (!ASSERT_OK_PTR(skel, "timer_crash__open_and_load"))
16                 return;
17         skel->bss->pid = getpid();
18         skel->bss->crash_map = mode;
19         if (!ASSERT_OK(timer_crash__attach(skel), "timer_crash__attach"))
20                 goto end;
21         usleep(1);
22 end:
23         timer_crash__destroy(skel);
24 }
25
26 void test_timer_crash(void)
27 {
28         if (test__start_subtest("array"))
29                 test_timer_crash_mode(MODE_ARRAY);
30         if (test__start_subtest("hash"))
31                 test_timer_crash_mode(MODE_HASH);
32 }
This page took 0.029194 seconds and 4 git commands to generate.