Your company here — click to reach over 10,000 unique daily visitors

udev-hid-bpf - Man Page

loader tool for HID eBPF programs


udev-hid-bpf [--help|--version] <command> [args]


udev-hid-bpf is a loader and general utility tool for HID eBPF programs. Typically it is invoked by udev to load and unload HID eBPF programs that match a given device but it provides commands to ease development of new eBPF programs and install specific eBPF programs that are not installed by default.



Print help and exit


Enable verbose output for the given command


Print version and exit


add [--bpfdir /path/to/directory] device [/path/to/program.bpf.o]

Invoked by udev when a device is added. This command loads all matching HID eBPF programs for this device or if a program is given just that one program.  The list of matching eBPF programs is stored in the udev hwdb.

The set of directories to search for eBPF programs is built-in but can be adjusted with the --bpfdir option.

The device must be specified as a syspath.

remove device

Invoked by udev when a device is remove. This command removes all HID eBPF programs for this device.

The device must be specified as a syspath.

list-bpf-programs [--bpfdir /path/to/directory]

List available HID eBPF programs in the (built-in) default lookup directories or the given directory.


List available HID devices.

inspect path/to/program.bpf.o

Inspect the given eBPF program.

install [options] path/to/program.bpf.o

Install the given eBPF program into /etc/udev-hid-bpf with a corresponding udev rule in /etc/udev/rules.d. This command should be used for testing a single eBPF program or where a full install of udev-hid-bpf is not suitable.

The following options are available for the --install command:


Do everything except actually creating directories and installing target files


Also install the udev-hid-bpf executable in $prefix/bin. If the executable already exists at that path this option does nothing.


Overwrite existing files with the same name

--prefix /usr/local

Install into the given prefix. Defaults to the built-in prefix.

See Also

udev-hid-bpf's online documentation https://libevdev.pages.freedesktop.org/udev-hid-bpf/


udev-hid-bpf 1.0.1-20240515 udev-hid-bpf Manual