I was trying to compile Linux kernel ebpf example (map_perf_test_kern.c) and getting compilation errors. Appreciate any pointers to get around this error.

root@rm-desktop:~/libbpf/src# uname -a
Linux rm-desktop 5.15.0-1011-raspi #13-Ubuntu SMP PREEMPT Thu Jun 2 11:44:34 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux



clang -nostdinc -isystem `clang -print-file-name=include` 
                -D__KERNEL__ -D__ASM_SYSREG_H 
                -Wno-unused-value -Wno-pointer-sign 
                -Wno-compare-distinct-pointer-types 
                -Wno-gnu-variable-sized-type-not-at-end 
                -Wno-address-of-packed-member -Wno-tautological-compare 
                -Wno-unknown-warning-option 
                -I/usr/lib/usr/include/ 
                -I/root/linux-headers-`uname -r`/include/linux/atomic 
                -I/usr/src/linux-headers-`uname -r`/include 
               -I/usr/src/linux-headers-`uname -r`/arch/arm64/include 
               -I/usr/src/linux-headers-`uname -r`/arch/arm64/include/asm 
               -I/usr/src/linux-headers-`uname -r`/arch/arm64/include/uapi 
               -I/usr/src/linux-headers-`uname -r`/arch/arm64/include/generated/asm 
               -I/usr/src/linux-headers-`uname -r`/arch/arm64/include/generated/uapi 
               -I/usr/src/linux-headers-`uname -r`/include/generated/uapi 
               -I/usr/src/linux-headers-`uname -r`/include/uapi 
                -O2 -emit-llvm -c map_perf_test_kern.c -o -| llc -march=bpf -filetype=obj -o map_perf_test_kern.o
 


 root@rm-desktop:~/libbpf/src# clang -nostdinc -isystem `clang -print-file-name=include`                 -D__KERNEL__ -D__ASM_SYSREG_H                 -Wno-unused-value -Wno-pointer-sign                 -Wno-compare-distinct-pointer-types                 -Wno-gnu-variable-sized-type-not-at-end                 -Wno-address-of-packed-member -Wno-tautological-compare                 -Wno-unknown-warning-option                                     -I ./                 -I /usr/lib/usr/include/                 -I/usr/src/linux-headers-`uname -r`/include/linux/atomic                 -I/usr/src/linux-headers-`uname -r`/include             -I/usr/src/linux-headers-`uname -r`/arch/arm64/include                  -I/usr/src/linux-headers-`uname -r`/arch/arm64/include/uapi                  -I/usr/src/linux-headers-`uname -r`/arch/arm64/include/generated/uapi           -I/usr/src/linux-headers-`uname -r`/include/generated/uapi              -I/usr/src/linux-headers-`uname -r`/include/uapi                 -O2 -emit-llvm -c map_perf_test_kern.c -o -| llc -march=bpf -filetype=obj -o map_perf_test_kern.o
In file included from map_perf_test_kern.c:7:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/linux/skbuff.h:13:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/linux/kernel.h:12:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/linux/bitops.h:33:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/asm/bitops.h:32:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/asm-generic/bitops/lock.h:5:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/linux/atomic.h:80:
/usr/src/linux-headers-5.15.0-1011-raspi/include/linux/atomic/atomic-arch-fallback.h:1273:34: error: unknown type name 'atomic64_t'; did you mean 'atomic_t'?
arch_atomic64_read_acquire(const atomic64_t *v)
                                 ^~~~~~~~~~
                                 atomic_t
/usr/src/linux-headers-5.15.0-1011-raspi/include/linux/types.h:168:3: note: 'atomic_t' declared here
} atomic_t;
  ^
In file included from map_perf_test_kern.c:7:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/linux/skbuff.h:13:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/linux/kernel.h:12:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/linux/bitops.h:33:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/asm/bitops.h:32:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/asm-generic/bitops/lock.h:5:
In file included from /usr/src/linux-headers-5.15.0-1011-raspi/include/linux/atomic.h:80:
/usr/src/linux-headers-5.15.0-1011-raspi/include/linux/atomic/atomic-arch-fallback.h:1277:20: error: use of undeclared identifier 'atomic64_t'
        if (__native_word(atomic64_t)) {
                          ^
/usr/src/linux-headers-5.15.0-1011-raspi/include/linux/atomic/atomic-arch-fallback.h:1277:20: error: use of undeclared identifier 'atomic64_t'
/usr/src/linux-headers-5.15.0-1011-raspi/include/linux/atomic/atomic-arch-fallback.h:1277:20: error: use of undeclared identifier 'atomic64_t'
/usr/src/linux-headers-5.15.0-1011-raspi/include/linux/atomic/atomic-arch-fallback.h:1277:20: error: use of undeclared identifier 'atomic64_t'
/usr/src/linux-headers-5.15.0-1011-raspi/include/linux/atomic/atomic-arch-fallback.h:1280:9: warning: implicit declaration of function 'arch_atomic64_read' is invalid in C99 [-Wimplicit-function-declaration]
                ret = arch_atomic64_read(v);

user19444582 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.