bpf-tracing 0.0.1

An eBPF tracing facility that integrates neatly into Rust's tracing
Documentation

bpf-tracing

This is a tracing facility for eBPF that integrates neatly into the tracing crate.

Usage

Include the bpf_tracing.h header.

#include "bpf_tracing.h"

SEC("sockops")
int monitor_sockets(struct bpf_sock_ops *ops) {
    if (ops->op == BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB || ops->op == BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB) {
        bpf_start_info_span("sockops");

        bpf_info("Established socket %d", skey.local.port);

        bpf_end_span("sockops");
    }

    return SK_PASS;
}

Consult monitor.bpf.c for a more complete example.