bpfinst-spec
Generic API for different eBPF-based instrumenter engines
Specification for my eBPF-based instrumenters

This repository contains the specification for different implementations of eBPF-based instrumentation engines.

Status: alpha, compatibility can be broken at any time.

Implementations

Design goals

Unlike DynamoRIO, this is not a generic instruction list rewriter API. While the native API looks quite similar to DR sometimes, the main purpose here is to implement simple per-instruction instrumentations as simple as possible. An instrumenter is just a set of not-too-complex (generally, with static forward branches only) functions in C that perform what you want for some basic operations from the original program (arithmetic, logic, branching, ...) and some native library with slow path callbacks.

Tags

Some implementations support abstract propagation of 64-bit-wide tags. The format of tag is completely user-controlled with the exception for 0 being default value when no tag is available. The implementation for storing tags in the address space of program is user-controlled, too:

How to use this repository

This repository is expected to be added to the engine implementation repository as a submodule named bpfinst-spec. On the same hierarchy level a directory named bpfinst-bin should be located with the following scripts:

API docs

An API documentation generated by Doxygen is available.