- 27 May, 2024 40 commits
-
-
7FrogTW authored
When we have multiple calls to `inet_ntoa()`, this function might return the same char* even though the underlying string has been modified. We'll get the same string if we use this function in a row in a single printf function(because char* pointed to the same location). Signed-off-by:
Jacky Yin <jjyyg1123@gmail.com>
-
Daniel Müller authored
Update the blazesym submodule to the most recent snapshot. Signed-off-by:
Daniel Müller <deso@posteo.net>
-
Andrii Nakryiko authored
Add 11, 12, and 13 versions, to make sure examples works on all of them. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
Andrii Nakryiko authored
Add the note about needing at least Clang v11 to successfully compile examples. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
unikzforce authored
In namespaced environments like containers or WSL2 the `minimal` example would not work, because of namespace pid and real PID of userspace process not necessarily matching. Add `minimal_ns` example to show how to handle PID translation in namespaced environments. Signed-off-by:
Hosein Bakhtiari <h.bakhtiary.z@gmail.com>
-
Hosein Bakhtiari authored
Add support for clang-format so the code style would be consistent throughout the whole project for C examples. Signed-off-by:
Hosein Bakhtiari <h.bakhtiary.z@gmail.com>
-
tzssangglass authored
Running example/c/profile on a virtual machine results in libbpf_num_possible_cpus calculating the wrong number of CPUs, causing the program to fail to set up performance monitor on a CPU/Core and throw an error. In contrast, the Rust implementation ignores this error and continues to execute. This fix only applies to the C implementation. Signed-off-by:
ZhengSong Tu <tzssangglass@gmail.com>
-
Abhishek Dubey authored
Signed-off-by:
Abhishek Dubey <adubey@linux.ibm.com>
-
Abhishek Dubey authored
Signed-off-by:
Abhishek Dubey <adubey@linux.ibm.com>
-
syogaraj authored
Add an example to trace `kill` and `tgkill` syscalls using libbpf's `SEC(ksyscall)` program type. Signed-off-by:
syogaraj <yoga30696@gmail.com>
-
Rutvik Patel authored
Rather than relying on the system's llvm-strip tool, which could be missing and failing the build, use "bpftool" to generate bpf object files. Signed-off-by:
Rutvik Patel <heyrutvik@gmail.com>
-
Hengqi Chen authored
Signed-off-by:
Hengqi Chen <hengqi.chen@gmail.com>
-
Hengqi Chen authored
Signed-off-by:
Hengqi Chen <hengqi.chen@gmail.com>
-
Yuriy Kolerov authored
Sometimes it's necessary to replace CLANG_BPF_SYS_INCLUDES by another value when build platform differs from host. For example, we can do something like this in Buildroot package for libbpf-bootstrap: make ... CLANG_BPF_SYS_INCLUDES="$(STAGING_DIR)/usr/include" Otherwise, clang uses host's Linux headers instead of target's. Signed-off-by:
Yuriy Kolerov <ykolerov@synopsys.com>
-
Hengqi Chen authored
On aarch64, C examples accidentally include arm/vmlinux.h and cause runtime error. Reorder the sed commands to avoid the issue. Signed-off-by:
Hengqi Chen <hengqi.chen@gmail.com>
-
Andrii Nakryiko authored
As suggested by Hengqi Chen, fixing CMakeLists.txt for profile example build specification. Suggested-by:
Hengqi Chen <hengqi.chen@gmail.com> Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
runsisi authored
application build requires bpftool or it fails like this: ``` bash: line 1: libbpf-bootstrap/examples/c/build/bpftool/bootstrap/bpftool: No such file or directory ``` add bpftool build to the dependency list of the application build to fix it. Signed-off-by:
runsisi <runsisi@hust.edu.cn>
-
Sohaib Mohamed authored
Add new submodules for downloading the Git repository, including its submodules, to make this step more obvious. Signed-off-by:
Sohaib Mohamed <sohaib.amhmd@gmail.com>
-
Mingzheng Xing authored
Add riscv64 vmlinux.h header. Update Makefile to identify riscv64 architecture. With this patch, executing make minimal in riscv64 according to the steps in README will get correct results. Signed-off-by:
Mingzheng Xing <xingmingzheng@iscas.ac.cn>
-
Daniel Müller authored
We already pull in a snapshot of blazesym for the generation of C headers and the creation of a library. Let's also use that in the Rust examples, instead of reaching out to crates.io, to use the same baseline everywhere. Signed-off-by:
Daniel Müller <deso@posteo.net>
-
Andrii Nakryiko authored
Add badge showing CI status. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
Andrii Nakryiko authored
Update all the submodules to their latest versions. For blazesym specify dont-generate-test-files feature to not rely on having llvm-gsymutil (used by blazesym to generate test files) in CI environment. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
Andrii Nakryiko authored
With libbpf v1.0+ there is no need to set libbpf_set_strict() mode, it's on by default. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
Puranjay Mohan authored
Add the arm vmlinux.h header. Update Makefile to select arm as ARCH when `uname -m` returns armv7l etc. Signed-off-by:
Puranjay Mohan <puranjay12@gmail.com>
-
Andrii Nakryiko authored
Upstream llvm moved to 17, so we need to accommodate 16 as being not the latest version. Also add another build step for validating llvm 17. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
woodpenker authored
When building C codes with cmake in legacy kernel environment, compiler may failed to find `linux/btf.h` like this: ``` src/build/libbpf/bpf/btf.h:10:10: fatal error: linux/btf.h: No such file or directory ^~~~~~~~~~~~~ compilation terminated. ``` This is because of missing `linux/btf.h` in system's header dirpaths. So we need to include the uapi dir under libbpf as Makefile does. By doing make install_uapi_headers together with install, we can let both the kernel and user side compilers find these uapi headers. Signed-off-by:
Wuding Zeyu <woodpenker5@gmail.com>
-
Kui-Feng Lee authored
Doing cross-compilation (issue #140) need a way to specify the target platform. However, the makefile also detects architecture by calling `uname` on the building machine. This patch lets users to config it by defining ARCH. For example, 'make ARCH=arm64' will build against arm64 as the target platform. Signed-off-by:
Kui-Feng Lee <kuifeng@meta.com>
-
Andrii Nakryiko authored
Regenerate vmlinux.h header for both x86-64 and arm64 architectures based on latest 6.1 kernel. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
Andrii Nakryiko authored
At the very least bring in [0] to potentially fix [1]. [0] https://github.com/libbpf/libbpf/commit/9da0dcb62149ab0a6c5711813d77a844ec6f393b [1] https://github.com/libbpf/libbpf-bootstrap/issues/132 Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
technetos authored
Signed-off-by:
technetos <mrgould93@gmail.com>
-
Xin Zhang authored
Follow the Makefile to build bootstrap only for bpftool. Signed-off-by:
Xin Zhang <zhangxin.xa@gmail.com>
-
Xin Zhang authored
Quote of `CLANG_SYSTEM_INCLUDES` should be removed for `add_custom_command`, otherwise all the options in this variable will be treated as a single string and it causes header searching paths not correctly set: ``` [ 56%] [clang] Building BPF object: minimal In file included from /home/debian/projects/libbpf-bootstrap/examples/c/minimal.bpf.c:3: In file included from /usr/include/linux/bpf.h:11: /usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found ^~~~~~~~~~~~~ 1 error generated. make[2]: *** [CMakeFiles/minimal.dir/build.make:78: minimal.bpf.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:288: CMakeFiles/minimal.dir/all] Error 2 make: *** [Makefile:91: all] Error 2 ``` Signed-off-by:
Xin Zhang <zhangxin.xa@gmail.com>
-
Xin Zhang authored
`profile` was added at commit 02b8c630faf65888289012edd381d6b2f1197094, but is missing CMakeLists update and causes CMake build error. Add the same logic as Makefile in CMake: if cargo exists, build submodule blazesym and profile program. Signed-off-by:
Xin Zhang <zhangxin.xa@gmail.com>
-
ruki authored
We split minimal and minimal_legacy to two targets, and avoid duplicate _main conflict ([0]). [0]: https://github.com/libbpf/libbpf-bootstrap/issues/107 Signed-off-by:
Ruki Wang <waruqi@gmail.com>
-
woodpenker authored
-
Hengqi Chen authored
Add a TC example to showcase the libbpf TC APIs. Also serve as an answer to question raised in this discussion ([0]). [0]: https://github.com/libbpf/libbpf-bootstrap/discussions/101 Signed-off-by:
Hengqi Chen <chenhengqi@outlook.com>
-
chantra authored
Simple CI workflow that will build both C and Rust examples.
-
Andrii Nakryiko authored
Update Cargo dependencies to fix various security issues in dependency packages. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-
JackyYin authored
Add a socket filter example to demonstrate how to capture IP v4 packet. Signed-off-by:
Jacky Yin <jjyyg1123@gmail.com>
-
Andrii Nakryiko authored
Update libbpf submodule. Signed-off-by:
Andrii Nakryiko <andrii@kernel.org>
-