{"id":13511447,"url":"https://github.com/feiskyer/ebpf-apps","last_synced_at":"2025-05-16T05:04:15.961Z","repository":{"id":37715618,"uuid":"423448764","full_name":"feiskyer/ebpf-apps","owner":"feiskyer","description":"极客时间专栏《eBPF 核心技术与实战》案例","archived":false,"fork":false,"pushed_at":"2025-04-27T09:07:47.000Z","size":10252,"stargazers_count":348,"open_issues_count":0,"forks_count":106,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-16T05:04:09.626Z","etag":null,"topics":["bcc","ebpf","libbpf"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feiskyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-01T12:00:09.000Z","updated_at":"2025-05-09T05:02:38.000Z","dependencies_parsed_at":"2022-08-08T21:30:20.658Z","dependency_job_id":"0a295208-b985-4028-9d66-4515b4170799","html_url":"https://github.com/feiskyer/ebpf-apps","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":"0.21212121212121215","last_synced_commit":"79ce995b0c7b9df751411a243e655ee132cb73bd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feiskyer%2Febpf-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feiskyer%2Febpf-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feiskyer%2Febpf-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feiskyer%2Febpf-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feiskyer","download_url":"https://codeload.github.com/feiskyer/ebpf-apps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bcc","ebpf","libbpf"],"created_at":"2024-08-01T03:00:50.278Z","updated_at":"2025-05-16T05:04:15.933Z","avatar_url":"https://github.com/feiskyer.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# ebpf-apps\n\neBPF sample apps based on [BCC](https://github.com/iovisor/bcc), [libbpf](https://github.com/libbpf/libbpf) and various language bindings.\n\n## Contents\n\n* [bcc-apps](bcc-apps): eBPF samples with BCC.\n  * [bcc-apps/c](bcc-apps/c): BCC samples with C binding.\n  * [bcc-apps/cpp](bcc-apps/cpp): BCC samples with C++ binding.\n  * [bcc-apps/python](bcc-apps/python): BCC samples with Python binding.\n* [bpf-apps](bpf-apps): eBPF samples with libbpf and CO-RE.\n* [bpftrace](bpftrace): eBPF samples with bpftrace.\n* [go](go): eBPF samples with Go bindings.\n* [kernel](kernel): eBPF samples built with kernel source.\n* [rust](rust): eBPF samples with Rust bindings.\n* [tools](tools): Tools for eBPF (e.g. bpftool and faddr2line).\n* [chatgpt](chatgpt): generating eBPF programs with ChatGPT.\n\n## Pre-requisites\n\n### BCC\n\n[BCC](https://github.com/iovisor/bcc) and its development libraries should be installed.\n\n#### Install from packages\n\nPlease follow [INSTALL.md](https://github.com/iovisor/bcc/blob/master/INSTALL.md) to see the detailed guides. For example, on Ubuntu or RHEL:\n\n```sh\n# Ubuntu\nsudo apt-get install bpfcc-tools libbpfcc-dev linux-headers-$(uname -r)\n\n# RHEL\nsudo yum install bcc-tools bcc-devel\n```\n\n#### Install from source\n\nPlease follow [INSTALL.md](https://github.com/iovisor/bcc/blob/master/INSTALL.md#source) to see the detailed guides. For example, on Ubuntu 20.04+:\n\n```sh\nsudo apt install -y bison build-essential cmake flex git libedit-dev llvm-dev libclang-dev python zlib1g-dev libelf-dev libfl-dev python3-distutils\n\ngit clone https://github.com/iovisor/bcc.git\nmkdir bcc/build; cd bcc/build\ncmake ..\nmake\nsudo make install\ncmake -DPYTHON_CMD=python3 .. # build python3 binding\npushd src/python/\nmake\nsudo make install\npopd\n```\n\n### libbpf with CO-RE\n\nTo use BTF and CO-RE, `CONFIG_DEBUG_INFO_BTF=y` and `CONFIG_DEBUG_INFO_BTF_MODULES=y` need to be enabled. If you don't want to rebuild the kernel, the following distos have enabled those options by default:\n\n* Ubuntu 20.10+\n* Fedora 31+\n* RHEL 8.2+\n* Debian 11+\n\nAnd to build bpf applications, the following development tools should also be installed:\n\n```sh\n# Ubuntu\nsudo apt-get install -y make clang llvm libelf-dev linux-tools-$(uname -r)\n\n# RHEL\nsudo yum install -y make clang llvm elfutils-libelf-devel bpftool\n```\n\n## Useful Links\n\n* [极客时间专栏《eBPF 核心技术与实战》](https://time.geekbang.org/column/intro/100104501)\n* [eBPF.io](https://ebpf.io/)\n* [Linux kernel BPF samples](https://elixir.bootlin.com/linux/v5.13/source/samples/bpf)\n* [BPF and XDP Reference Guide](https://docs.cilium.io/en/latest/bpf/)\n* [XDP Hands-On Tutorial](https://github.com/xdp-project/xdp-tutorial)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeiskyer%2Febpf-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeiskyer%2Febpf-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeiskyer%2Febpf-apps/lists"}