Linux Perf
llvm-src-kbuild.c
Go to the documentation of this file.
1 #include <tests/llvm.h>
3 "/*\n"
4 " * bpf-script-test-kbuild.c\n"
5 " * Test include from kernel header\n"
6 " */\n"
7 "#ifndef LINUX_VERSION_CODE\n"
8 "# error Need LINUX_VERSION_CODE\n"
9 "# error Example: for 4.2 kernel, put 'clang-opt=\"-DLINUX_VERSION_CODE=0x40200\" into llvm section of ~/.perfconfig'\n"
10 "#endif\n"
11 "#define SEC(NAME) __attribute__((section(NAME), used))\n"
12 "\n"
13 "#include <uapi/linux/fs.h>\n"
14 "#include <uapi/asm/ptrace.h>\n"
15 "\n"
16 "SEC(\"func=vfs_llseek\")\n"
17 "int bpf_func__vfs_llseek(void *ctx)\n"
18 "{\n"
19 " return 0;\n"
20 "}\n"
21 "\n"
22 "char _license[] SEC(\"license\") = \"GPL\";\n"
23 "int _version SEC(\"version\") = LINUX_VERSION_CODE;\n"
24 ;
const char test_llvm__bpf_test_kbuild_prog[]