ecc usage
``sh ecc [OPTIONS] <SOURCEPATH [EXPORTEVENTHEADER] ``
ecc [OPTIONS] <SOURCE_PATH> [EXPORT_EVENT_HEADER]Compiles and generates a bpf object from the provided SOURCE_PATH path for the specified eBPF program.
example
package.json only
ecc foo.bpf.cSource file and a header file
ecc foo.bpf.c bar.hGenerate custom btfhub-archive and package into tar
ecc -b client.bpf.c event.hThis command will compile client.bpf.c and event.h into client.bpf.o, and package them as json, export a tar containing a custom btf file.
output in OUTPUT_PATH:
package.json
client.tar #include custom btf filesbtfhub Support
BTF is the things that make eBPF portable.
btfhub provide BTF information for Linux distributions released kernels
that don't have embedded BTF information.
By using btfhub to package ebpf programs as tar file, ecc makes it possible to run ebpf programs on older kernels that do not have btf support.
A list of existing distributions and their current status on eBPF and BTF support.
Arguments and options
Arguments
-
SOURCE_PATH: path of the bpf.c file to compile -
EXPORT_EVENT_HEADER: path of the bpf.h header for defining event struct
Options
- -o, --output-path
OUTPUT_PATH: path of output bpf object - -w, --workspace-path
WORKSPACE_PATH: specify custom workspace path - -a, --additional-cflags
ADDITIONAL_CFLAGS: additional cflags for clang- example
-a="-fstack-protector", this avoids runtime errors on some distributions that have clang stack protection enabled by default.
- example
- -c, --clang-bin
CLANG_BIN: path of clang binary (default: clang) - -l, --llvm-strip-bin
LLVM_STRIP_BIN: path of llvm-strip binary (default: llvm-strip) - -s, --subskeleton: do not pack bpf object in config file
- -v, --verbose: print the command execution
- -y, --yaml: output config skel file in yaml
- --header-only: generate a bpf object for struct definition in header file only
- --wasm-header: generate wasm include header
- -b, --btfgen: fetch custom btfhub archive file and package into tar
- If
BTFHUB_ARCHIVEdoes not exist, it will clone btfhub toBTFHUB_ARCHIVE. - This option will take a lot of time, if you don't want to package or generate all custom btf files,
you can keep only the required btf files in
BTFHUB_ARCHIVE. - Don't worry, even the tar containing all the btfhub archives is only
5-10MBin size.
- If
- --btfhub-archive
BTFHUB_ARCHIVE: directory to save btfhub archive file (default:$HOME/.eunomia/btfhub-archive) - -h, --help: prints help documentation.
- -V, --version: prints version information.
继续阅读
返回索引
eunomia-bpf:简化并增强eBPF,支持CO-RE[^1]和WebAssembly[^2]
  ![DeepSource](https://deepsource.io/gh/eunomia-bpf/eunomia-bpf/?ref=reposi
上一篇 / 上一页
eunomia-cc
- A toolchain to simplify writing eBPF programs - Build eBPF programs with Wasm
下一篇 / 下一页
ecli dockerfile usage
bpf 运行时需要有Linux内核相关支持,docker 中的内核共享的宿主机的内核,因此使用docker运行bpf程序时需要使用以下命令为容器赋予权限和相关内核支持。
- 最后更新
- 2025年2月12日
- 首次发布
- 2023年8月10日
- 贡献者
- weekendfish, 云微, oluceps
这个页面有帮助吗?