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 |
||
|
|
||
|
|
|
|
|
|||
|
|
||
|
|||
|
|
||
|
Footnotes
- 1(1,2,3,4,5,6,7,8)
The
fentryattach format isfentry[.s]/<function>.- 2(1,2)
The
kprobeattach format iskprobe/<function>[+<offset>]. Valid characters forfunctionarea-zA-Z0-9_.andoffsetmust be a valid non-negative integer.- 3(1,2)
The
ksyscallattach format isksyscall/<syscall>.- 4(1,2,3,4)
The
uprobeattach format isuprobe[.s]/<path>:<function>[+<offset>].- 5
The
usdtattach format isusdt/<path>:<provider>:<name>.- 6(1,2)
The
kprobe.multiattach format iskprobe.multi/<pattern>wherepatternsupports*and?wildcards. Valid characters for pattern area-zA-Z0-9_.*?.- 7(1,2)
The
lsmattachment format islsm[.s]/<hook>.- 8(1,2)
The
raw_tpattach format israw_tracepoint[.w]/<tracepoint>.- 9(1,2)
The
tracepointattach format istracepoint/<category>/<name>.- 10(1,2)
The
iterattach format isiter[.s]/<struct-name>.