Compilation Error Chapter5
naftalyava opened this issue · comments
I have libbpf and bpftool installed, and generally have no issues compiling some other code.
But I am unable to compile code for chapter 5.
~/dev/eBPF/learning-ebpf/chapter5$ make
clang \
-target bpf \
-D __TARGET_ARCH_x86 \
-Wall \
-O2 -g -o hello-buffer-config.bpf.o -c hello-buffer-config.bpf.c
hello-buffer-config.bpf.c:27:31: error: expected identifier
int BPF_KPROBE_SYSCALL(hello, const char *pathname)
^
hello-buffer-config.bpf.c:36:59: error: use of undeclared identifier 'pathname'
bpf_probe_read_user_str(&data.path, sizeof(data.path), pathname);
^
hello-buffer-config.bpf.c:45:26: error: use of undeclared identifier 'ctx'
bpf_perf_event_output(ctx, &output, BPF_F_CURRENT_CPU, &data, sizeof(data));
^
3 errors generated.
make: *** [Makefile:15: hello-buffer-config.bpf.o] Error 1