bcc: Tracepoint support in libbpf and BPF
authorSasha Goldshtein <goldshtn@gmail.com>
Thu, 30 Jun 2016 13:26:28 +0000 (06:26 -0700)
committerSasha Goldshtein <goldshtn@gmail.com>
Thu, 30 Jun 2016 13:37:11 +0000 (06:37 -0700)
commit1198c3c6d9dc46a76c3920d07a77f4f76203c1c2
treebeff710b7b06edb4cbab6eaf5ed8671048bef150
parentde34c25bb6556251e35089d9af3cd6fc5d664b90
bcc: Tracepoint support in libbpf and BPF

Introduce tracepoint support in libbpf via new `bpf_attach_tracepoint`
API, which takes the tracepoint category and name (e.g. "sched",
"sched_switch"). Attach the tracing program to the tracepoint's id
and proceed as usual.

Add `attach_tracepoint` API to Python BPF module, which takes the
tracepoint description as a single string (e.g. "sched:sched_switch").
Load the BPF program with bpf_prog_type set to TRACEPOINT and then
call `bpf_attach_tracepoint` to attach it.
src/cc/libbpf.c
src/libbpf.h
src/python/bcc/__init__.py