ajor / bpftrace

High-level tracing language for Linux eBPF - development moved to https://github.com/iovisor/bpftrace
https://github.com/iovisor/bpftrace
Apache License 2.0
250 stars 15 forks source link

USDT events #29

Open brendangregg opened 6 years ago

brendangregg commented 6 years ago

User statically-defined tracing events (user-level tracepoints). They are in some libraries, databases, and runtimes.

Something like this should be possible:

bpftrace -e 'usdt:pthread:pthread_create { printf("created thread\n"); }'

bcc has an example implementation of this: eg, from the trace tool:

trace 'u:pthread:pthread_create (arg4 != 0)'
        Trace the USDT probe pthread_create when its 4th argument is non-zero