Learning eBPF
TODO: Ubuntu22.04
code: zsh
ubuntu@ip-172-31-21-126:~$ uname -a
Linux ip-172-31-21-126 5.15.0-1055-aws #60~20.04.1-Ubuntu SMP Thu Feb 22 15:49:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux ubuntu@ip-172-31-21-126:~$ sudo apt-get update
ubuntu@ip-172-31-21-126:~$ sudo apt-get install bpfcc-tools linux-headers-$(uname -r)
code: zsh
ubuntu@ip-172-31-21-126:~$ sudo python3 hello.py
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from ./include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:5:
In file included from include/linux/compiler_types.h:80:
include/linux/compiler-clang.h:41:9: warning: '__HAVE_BUILTIN_BSWAP32__' macro redefined -Wmacro-redefined ^
<command line>:4:9: note: previous definition is here
^
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from ./include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:5:
In file included from include/linux/compiler_types.h:80:
include/linux/compiler-clang.h:42:9: warning: '__HAVE_BUILTIN_BSWAP64__' macro redefined -Wmacro-redefined ^
<command line>:5:9: note: previous definition is here
^
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from ./include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:5:
In file included from include/linux/compiler_types.h:80:
include/linux/compiler-clang.h:43:9: warning: '__HAVE_BUILTIN_BSWAP16__' macro redefined -Wmacro-redefined ^
<command line>:3:9: note: previous definition is here
^
3 warnings generated.
b' amazon-ssm-agen-2458 000 d...1 207.271176: bpf_trace_printk: Hello World!' b' sshd-2459 000 d...1 261.941445: bpf_trace_printk: Hello World!' b' amazon-ssm-agen-2461 000 d...1 268.277471: bpf_trace_printk: Hello World!' code: zsh
ubuntu@ip-172-31-21-126:~/learning-ebpf/chapter3$ sudo apt install make
ubuntu@ip-172-31-21-126:~/learning-ebpf/chapter3$ sudo apt install clang
ubuntu@ip-172-31-21-126:~/learning-ebpf/chapter3$ sudo apt install libbpf-dev
ubuntu@ip-172-31-21-126:~/learning-ebpf/chapter3$ sudo apt install llvm
ubuntu@ip-172-31-21-126:~/learning-ebpf/chapter3$ sudo apt install linux-tools-common
ubuntu@ip-172-31-21-126:~/learning-ebpf/chapter3$ sudo apt install linux-tools-5.15.0-1055-aws