Program Types and ELF Sections
The table below lists the program types, their attach types where relevant and the ELF section names supported by libbpf for them. The ELF section names follow these rules:
-
typeis an exact match, e.g.SEC("socket") -
type+means it can be either exactSEC("type")or well-formedSEC("type/extras")with a '/' separator betweentypeandextras.
When extras are specified, they provide details of how to auto-attach the BPF program. The format of extras depends on the program type, e.g. SEC("tracepoint/<category>/<name>") for tracepoints or SEC("usdt/<path>:<provider>:<name>") for USDT probes. The extras are described in more detail in the footnotes.
|
Program Type |
Attach Type |
ELF Section Name |
Sleepable |
|---|---|---|---|
|
|
|
|
|
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
|
|
|
|
|
||
|
|
|
||
|
|
|||
|
|
|
||
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
Yes |
||
|
|
|||
|
|
Yes |
||
|
|
|||
|
|
Yes |
||
|
|
|
||
|
|
|||
|
|
|
||
|
|
|
||
|
|
Yes |
||
|
|
|||
|
|
Yes |
||
|
|
|
||
|
|
Yes |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
Yes |
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|||
|
|
|
||
|
|
|||
|
|
|
||
|
|
|
||
|
|
|||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
|
|
|
|
|
||
|
|
Yes |
||
|
|
|
Yes |
|
|
|
|
||
|
|
|||
|
|
|
|
|
|
|
Yes |
||
|
|
|
||
|
|
Yes |
||
|
|
|
||
|
|
Yes |
||
|
|
|
||
|
|
Yes |
||
|
|
|
||
|
|
|
|
|
|
|
|||
|
|
|
||
|
|
|||
|
|
|
||
|
|
Footnotes
[1] The fentry attach format is fentry[.s]/<function>.
[2] The kprobe attach format is kprobe/<function>[+<offset>]. Valid characters for function are a-zA-Z0-9_. and offset must be a valid non-negative integer.
[3] The ksyscall attach format is ksyscall/<syscall>.
[4] The uprobe attach format is uprobe[.s]/<path>:<function>[+<offset>].
[5] The uprobe.multi attach format is uprobe.multi[.s]/<path>:<function-pattern> where function-pattern supports * and ? wildcards.
[6] The usdt attach format is usdt/<path>:<provider>:<name>.
[7] The kprobe.multi attach format is kprobe.multi/<pattern> where pattern supports * and ? wildcards. Valid characters for pattern are a-zA-Z0-9_.*?.
[8] The lsm attachment format is lsm[.s]/<hook>.
[9] The raw_tp attach format is raw_tracepoint[.w]/<tracepoint>.
[10] The tc, classifier and action attach types are deprecated, use tcx/* instead.
[11] The struct_ops attach format supports struct_ops[.s]/<name> convention, but name is ignored and it is recommended to just use plain SEC("struct_ops[.s]"). The attachments are defined in a struct initializer that is tagged with SEC(".struct_ops[.link]").
[12] The tracepoint attach format is tracepoint/<category>/<name>.
[13] The iter attach format is iter[.s]/<struct-name>.