diff mbox

[01/10] bpf samples: bpf: Fix tracex5_kern.c compiling error

Message ID 1450329794-161948-2-git-send-email-wangnan0@huawei.com
State New
Headers show

Commit Message

Wang Nan Dec. 17, 2015, 5:23 a.m. UTC
LLVM report compiling error:

 /kpathsamples/bpf/tracex5_kern.c:33:15: error: use of undeclared identifier '__NR_getuid'; did you
       mean '__NR_vgetcpu'?
         if (sd.nr >= __NR_getuid && sd.nr <= __NR_getsid) {
                      ^~~~~~~~~~~
                      __NR_vgetcpu
 /kpath/arch/x86/include/uapi/asm/vsyscall.h:7:2: note: '__NR_vgetcpu' declared here
         __NR_vgetcpu,

This patch fix it by adding asm/unistd.h to it.

Signed-off-by: Wang Nan <wangnan0@huawei.com>

Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: David S. Miller <davem@davemloft.net>
---
 samples/bpf/tracex5_kern.c | 1 +
 1 file changed, 1 insertion(+)

-- 
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

diff --git a/samples/bpf/tracex5_kern.c b/samples/bpf/tracex5_kern.c
index b3f4295..2964efd 100644
--- a/samples/bpf/tracex5_kern.c
+++ b/samples/bpf/tracex5_kern.c
@@ -8,6 +8,7 @@ 
 #include <linux/version.h>
 #include <uapi/linux/bpf.h>
 #include <uapi/linux/seccomp.h>
+#include <asm/unistd.h>
 #include "bpf_helpers.h"
 
 #define PROG(F) SEC("kprobe/"__stringify(F)) int bpf_func_##F