bpflinter

Crates.iobpflinter
lib.rsbpflinter
version0.1.3
created_at2025-07-01 20:42:11.598842+00
updated_at2025-09-24 18:51:13.791091+00
descriptionA command-line based linter for BPF C code.
homepage
repositoryhttps://github.com/d-e-s-o/bpflint
max_upload_size
id1733843
size52,717
Daniel Müller (d-e-s-o)

documentation

README

bpflinter

bpflinter is a command line based linter for BPF C code. It is powered by the bpflint library.

Installation

The program is self-contained with only the binary necessary. The easiest way to install it is by downloading a pre-built, statically linked binary attached to the latest cli-* release.

For subsequent approaches, please be advised that a Rust toolchain is necessary.

If you want to build and install the most recent release from crates.io, use

$ cargo install bpflinter

Alternatively, you can build the program from the source contained in this repository, use

$ cargo build --package bpflinter

Usage

To lint a *.bpf.c file, just provide it's path as argument. E.g.,

$ bpflinter ../examples/task_longrun.bpf.c
warning: [probe-read] bpf_probe_read() is deprecated and replaced by bpf_probe_user() and bpf_probe_kernel(); refer to bpf-helpers(7)
  --> ../examples/task_longrun.bpf.c:43:24
   |
43 |                         bpf_probe_read(event.comm, TASK_COMM_LEN, prev->comm);
   |                         ^^^^^^^^^^^^^^
   |
warning: [probe-read] bpf_probe_read() is deprecated and replaced by bpf_probe_user() and bpf_probe_kernel(); refer to bpf-helpers(7)
  --> ../examples/task_longrun.bpf.c:44:24
   |
44 |                         bpf_probe_read(event.bt, sizeof(t->bt), t->bt);
   |                         ^^^^^^^^^^^^^^
   |

For additional information, please refer to USAGE.md or the program's help text (bpflinter --help).

Commit count: 111

cargo fmt