{"id":13480385,"url":"https://github.com/libbpf/bpftool","last_synced_at":"2025-05-15T07:07:11.701Z","repository":{"id":37966041,"uuid":"448429441","full_name":"libbpf/bpftool","owner":"libbpf","description":"Automated upstream mirror for bpftool stand-alone build.","archived":false,"fork":false,"pushed_at":"2025-04-03T09:51:21.000Z","size":1096,"stargazers_count":493,"open_issues_count":34,"forks_count":91,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-14T13:06:49.101Z","etag":null,"topics":["bpf","bpftool","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libbpf.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":"2022-01-16T01:17:33.000Z","updated_at":"2025-04-11T06:54:42.000Z","dependencies_parsed_at":"2023-11-14T07:24:37.570Z","dependency_job_id":"e002b5b0-9e68-4758-976b-211554510f21","html_url":"https://github.com/libbpf/bpftool","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libbpf%2Fbpftool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libbpf%2Fbpftool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libbpf%2Fbpftool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libbpf%2Fbpftool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libbpf","download_url":"https://codeload.github.com/libbpf/bpftool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292042,"owners_count":22046426,"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":["bpf","bpftool","ebpf","libbpf"],"created_at":"2024-07-31T17:00:38.344Z","updated_at":"2025-05-15T07:07:06.690Z","avatar_url":"https://github.com/libbpf.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\u003ca href=\".github/assets/\"\u003e\n  \u003cdiv\u003e\n    \u003cimg src=\".github/assets/bpftool_horizontal_color.svg\"\n         alt=\"bpftool logo: Hannah the Honeyguide\"\n         width=500px; /\u003e\n  \u003c/div\u003e\n\u003c/a\u003e\n\n[![License BSD 2-Clause][bsd-badge]](LICENSE.BSD-2-Clause)\n[![License GPL 2.0][gpl-badge]](LICENSE.GPL-2.0)\n[![Build status][build-badge]][build]\n\n[bsd-badge]: https://img.shields.io/badge/License-BSD_2--Clause-blue.svg\n[gpl-badge]: https://img.shields.io/badge/License-GPL_2.0-blue.svg\n[build-badge]: https://github.com/libbpf/bpftool/actions/workflows/build.yaml/badge.svg\n[build]: https://github.com/libbpf/bpftool/actions/workflows/build.yaml\n\nThis is the official home for bpftool. _Please use this Github repository for\nbuilding and packaging bpftool and when using it in your projects through Git\nsubmodule._\n\nThe _authoritative source code_ of bpftool is developed as part of the\n[bpf-next Linux source tree][bpf-next] under [the `tools/bpf/bpftool`\nsubdirectory][tools-bpf-bpftool] and is periodically synced to\n\u003chttps://github.com/libbpf/bpftool\u003e on Github. As such, all changes for bpftool\n**should be sent to the [BPF mailing list][bpf-ml]**, **please don't open PRs\nhere** unless you are changing some Github-specific components.\n\n[bpf-next]: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git\n[tools-bpf-bpftool]: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool\n[bpf-ml]: http://vger.kernel.org/vger-lists.html#bpf\n\nQuestions on bpftool and BPF general usage\n------------------------------------------\n\nCheck out [the manual pages](docs) for documentation about bpftool. A number of\nexample invocations are also displayed in [this blog\npost](https://qmonnet.github.io/whirl-offload/2021/09/23/bpftool-features-thread/).\n\nAll general BPF questions, including kernel functionality, bpftool features and\nusage, should be sent to bpf@vger.kernel.org mailing list. You can subscribe to\nit [here][bpf-ml] and search its archives [here][lore].\n\nThe mailing list is monitored by many more people than this repo and they will\nhappily try to help you with whatever issue you encounter. This repository's\nPRs and issues should be opened only for dealing with issues related to\ncomponents specific to the bpftool mirror repository (such as the\nsynchronization script or the CI workflows). The project maintainers also use\nGitHub issues as a generic tracker for bpftool, but issues should first be\nreported on the mailing list nonetheless.\n\n[lore]: https://lore.kernel.org/bpf/\n\nDependencies\n------------\n\nRequired:\n\n- libelf\n- zlib\n\nOptional:\n\n- libbfd (for dumping JIT-compiled program instructions)\n- libcap (for better feature probing)\n- kernel BTF information (for profiling programs or showing PIDs of processes\n  referencing BPF objects)\n- clang/LLVM (idem)\n\nBuild\n-----\n\n### Initialize libbpf submodule\n\nThis repository uses libbpf as a submodule. You can initialize it when cloning\nbpftool:\n\n```console\n$ git clone --recurse-submodules https://github.com/libbpf/bpftool.git\n```\n\nAlternatively, if you have already cloned the repository, you can initialize\nthe submodule by running the following command from within the repository:\n\n```console\n$ git submodule update --init\n```\n\n### Build bpftool\n\nTo build bpftool:\n\n```console\n$ cd src\n$ make\n```\n\nTo build and install bpftool on the system:\n\n```console\n$ cd src\n# make install\n```\n\nBuilding bpftool in a separate directory is supported via the `OUTPUT` variable:\n\n```console\n$ mkdir /tmp/bpftool\n$ cd src\n$ OUTPUT=/tmp/bpftool make\n```\n\nMost of the output is suppressed by default, but detailed building logs can be\ndisplayed by passing `V=1`:\n\n```console\n$ cd src\n$ make V=1\n```\n\nAdditional compilation flags can be passed to the command line if required. For\nexample, we can create a static build with the following commands:\n\n```console\n$ cd src\n$ EXTRA_CFLAGS=--static make\n```\n\nNote that to use the LLVM disassembler with static builds, we need a static\nversion of the LLVM library installed on the system:\n\n1.  Download a precompiled LLVM release or build it locally.\n\n    - Download the appropriate\n      [release of LLVM](https://releases.llvm.org/download.html) for your\n      platform, for example on x86_64 with LLVM 15.0.0:\n\n      ```console\n      $ curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.0/clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4.tar.xz\n      $ tar xvf clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4.tar.xz\n      $ mv clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4 llvm_build\n      ```\n\n    - Alternatively, clone and build the LLVM libraries locally.\n\n      ```console\n      $ git clone https://github.com/llvm/llvm-project.git\n      $ mkdir llvm_build\n      $ cmake -S llvm-project/llvm -B llvm_build -DCMAKE_BUILD_TYPE=Release\n      $ make -j -C llvm_build llvm-config llvm-libraries\n      ```\n\n2.  Build bpftool with `EXTRA_CFLAGS` set to `--static`, and by passing the\n    path to the relevant `llvm-config`.\n\n    ```console\n    $ cd bpftool\n    $ LLVM_CONFIG=../../llvm_build/bin/llvm-config EXTRA_CFLAGS=--static make -j -C src\n    ```\n\n### Build bpftool's man pages\n\nThe man pages for bpftool can be built with:\n\n```console\n$ cd docs\n$ make\n```\n\nThey can be installed on the system with:\n\n```console\n$ cd docs\n# make install\n```\n\nbpf-next to GitHub sync\n-----------------------\n\nThis repository mirrors [bpf-next Linux source tree's\n`tools/bpf/bpftool`][tools-bpf-bpftool] directory, plus its few dependencies\nfrom under `kernel/bpf/`, and its supporting header files. Some of these header\nfiles, `include/linux/*.h` on the current repository, are reduced versions of\ntheir counterpart files at [bpf-next][bpf-next]'s `tools/include/linux/*.h` to\nmake compilation successful.\n\nSynchronization between the two repositories happens every few weeks or so.\nGiven that bpftool remains aligned on libbpf's version, its repository tends to\nfollow libbpf's. When the libbpf repo syncs up with bpf-next, bpftool's repo\nusually follows within the next few days.\n\nThe synchronization process is semi-automated: the script in\n`scripts/sync-kernel.sh` cherry-picks, adjusts and commits all changes from\n`bpf-next` to a local version of the bpftool repository. However, maintainers\nrun this script manually and then create a pull request to merge the resulting\ncommits.\n\nTake a look at [the script](scripts/sync-kernel.sh) for the technical details of the process. See also the documentation in [the accompanying README.md](scripts#sync-kernelsh)\n\nLicense\n-------\n\nThis work is dual-licensed under the GNU GPL v2.0 (only) license and the BSD\n2-clause license. You can select either of them if you reuse this work.\n\n`SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibbpf%2Fbpftool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibbpf%2Fbpftool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibbpf%2Fbpftool/lists"}