{"id":13838587,"url":"https://github.com/trailofbits/ebpfpub","last_synced_at":"2025-04-15T00:31:53.988Z","repository":{"id":39674312,"uuid":"227596514","full_name":"trailofbits/ebpfpub","owner":"trailofbits","description":"ebpfpub is a generic function tracing library for Linux that supports tracepoints, kprobes and uprobes.","archived":false,"fork":false,"pushed_at":"2023-04-12T15:07:39.000Z","size":272,"stargazers_count":117,"open_issues_count":0,"forks_count":8,"subscribers_count":34,"default_branch":"main","last_synced_at":"2025-03-28T12:51:14.614Z","etag":null,"topics":["bpf","ebpf","llvm","monitoring","security","tracepoints","tracing"],"latest_commit_sha":null,"homepage":"https://www.trailofbits.com/services/security-engineering","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/trailofbits.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}},"created_at":"2019-12-12T12:00:38.000Z","updated_at":"2025-03-22T00:37:36.000Z","dependencies_parsed_at":"2022-08-28T06:43:43.455Z","dependency_job_id":null,"html_url":"https://github.com/trailofbits/ebpfpub","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailofbits%2Febpfpub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailofbits%2Febpfpub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailofbits%2Febpfpub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailofbits%2Febpfpub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trailofbits","download_url":"https://codeload.github.com/trailofbits/ebpfpub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248984386,"owners_count":21193737,"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","ebpf","llvm","monitoring","security","tracepoints","tracing"],"created_at":"2024-08-04T16:00:22.489Z","updated_at":"2025-04-15T00:31:53.417Z","avatar_url":"https://github.com/trailofbits.png","language":"C++","funding_links":[],"categories":["Tools and resources for Linux eBPF"],"sub_categories":[],"readme":"# ebpfpub\n\nebpfpub is a generic function tracing library for Linux that supports tracepoints, kprobes and uprobes.\n\n| | |\n|-|-|\n| CI Status | ![](https://github.com/trailofbits/ebpfpub/workflows/Build/badge.svg) |\n\n## Building\n\n### Prerequisites\n\n* A recent libc++ or stdc++ library, supporting C++17\n* CMake \u003e= 3.16.2. A pre-built binary can be downloaded from the [CMake's download page](https://cmake.org/download/).\n* Linux kernel \u003e= 4.18 (Ubuntu 18.10, CentOS 8, Red Hat Enterprise Linux 8).\n  * Test for the support: ``grep BPF /boot/config-`uname -r` `` and check the output for `CONFIG_BPF=y` and `CONFIG_BPF_SYSCALL=y`\n* The package `libz-dev`, needed during linking.\n* Optional, but highly recommended: download and install the osquery-toolchain (see below).\n  * **This should work fine on any recent Linux distribution. The binaries generated with this toolchain are portable and can be deployed on any distro \u003e= CentOS 6/Ubuntu 16.04**\n* If _not_ using the osquery-toolchain (if building with the system toolchain):\n  * **Clang and the C++ library must both support C++17**. Recent distributions should be compatible (tested on Arch Linux, Ubuntu 19.10 and above).\n  * A recent Clang/LLVM installation (8.0 or better), compiled with BPF support.\n    * Test for the support: `llc --version | grep bpf` and check that BPF is listed as a registered target.\n    * Please note that LLVM itself must be compiled with libc++ when enabling the `EBPF_COMMON_ENABLE_LIBCPP` option, since ebfpub will directly link against the LLVM libraries.\n  * The packages `llvm-devel` (for `LLVMConfig.cmake` files), `llvm-static` (for additional LLVM libraries), and `ncurses-devel` (for `libtinfo`)\n\n#### Installing the osquery-toolchain\n\nAs root:\n```shell\ncd /tmp\nwget https://github.com/osquery/osquery-toolchain/releases/download/1.1.0/osquery-toolchain-1.1.0-x86_64.tar.xz \ntar -xf /tmp/ebpfpub/build/osquery-toolchain-1.1.0-x86_64.tar.xz -C /opt\n```\n\n### Dependencies (retrieved with git)\n\n* [ebpf-common](https://github.com/trailofbits/ebpf-common)\n\n### Steps to Build\n\n1. Obtain the source code: `git clone --recursive https://github.com/trailofbits/ebpfpub`\n2. If you cloned the repo without the `--recursive` flag, run `git submodule update --init --recursive`\n3. Enter the source folder: `cd ebpfpub`\n4. If you intend to build the project using the osquery-toolchain: `export TOOLCHAIN_PATH=\"/opt/osquery-toolchain\"`, then add `-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake` to step 6\n5. Configure the project: `cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DEBPFPUB_ENABLE_INSTALL=true -DEBPFPUB_ENABLE_EXAMPLES=true -DEBPF_COMMON_ENABLE_TESTS=true`\n6. Build the project: `cmake --build build -j $(($(nproc) + 1))`\n7. Run the tests: `cmake --build build --target run-ebpf-common-tests`\n\n## Building the package\n\n### Prerequisites for packaging\n\n* DEB: **dpkg** command\n* RPM: **rpm** command\n* TGZ: **tar** command\n\n### Steps to package\n\nMake sure that the `-DEBPFPUB_ENABLE_INSTALL:BOOL=true` parameter has been passed at configure time, then run the following commands inside the build folder:\n\n```shell\nmkdir install\nexport DESTDIR=`realpath install`\n\ncd build\ncmake --build . --target install\n```\n\nConfigure the packaging project:\n\n```shell\nmkdir package\ncd package\n\ncmake -DEBPFPUB_INSTALL_PATH:PATH=\"${DESTDIR}\" /path/to/source_folder/package_generator\ncmake --build . --target package\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailofbits%2Febpfpub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrailofbits%2Febpfpub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailofbits%2Febpfpub/lists"}