1 // SPDX-License-Identifier: GPL-2.0
2 #include <asm/unistd.h>
9 # elif defined(__x86_64__)
11 # elif defined(__aarch64__)
13 # elif defined(__sparc__)
15 # elif defined(__s390__)
17 # elif defined(__mips__) && defined(_ABIO32)
18 # define __NR_bpf 4355
19 # elif defined(__mips__) && defined(_ABIN32)
20 # define __NR_bpf 6319
21 # elif defined(__mips__) && defined(_ABI64)
22 # define __NR_bpf 5315
24 # error __NR_bpf not defined. libbpf does not support your arch.
32 /* Check fields in attr */
33 attr.prog_type = BPF_PROG_TYPE_KPROBE;
40 attr.kern_version = 0;
44 * Test existence of __NR_bpf and BPF_PROG_LOAD.
45 * This call should fail if we run the testcase.
47 return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));