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:
type
is an exact match, e.g.SEC("socket")
type+
means it can be either exactSEC("type")
or well-formedSEC("type/extras")
with a ‘/
’ separator betweentype
andextras
.
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
fentry
attach format isfentry[.s]/<function>
.- 2(1,2)
The
kprobe
attach format iskprobe/<function>[+<offset>]
. Valid characters forfunction
area-zA-Z0-9_.
andoffset
must be a valid non-negative integer.- 3(1,2)
The
ksyscall
attach format isksyscall/<syscall>
.- 4(1,2,3,4)
The
uprobe
attach format isuprobe[.s]/<path>:<function>[+<offset>]
.- 5
The
usdt
attach format isusdt/<path>:<provider>:<name>
.- 6(1,2)
The
kprobe.multi
attach format iskprobe.multi/<pattern>
wherepattern
supports*
and?
wildcards. Valid characters for pattern area-zA-Z0-9_.*?
.- 7(1,2)
The
lsm
attachment format islsm[.s]/<hook>
.- 8(1,2)
The
raw_tp
attach format israw_tracepoint[.w]/<tracepoint>
.- 9(1,2)
The
tracepoint
attach format istracepoint/<category>/<name>
.- 10(1,2)
The
iter
attach format isiter[.s]/<struct-name>
.