BT(5) | File Formats Manual | BT(5) |
BT
— Bug Tracing
language
/
filter / {
action }
The BT
language, also known as BPFtrace
syntax, describes how to format and display information gathered from
specified probe events.
Events are generated by the dynamic tracer dt(4) when an enabled probe is triggered. They are periodically collected by btrace(8), which formats them using the corresponding action. If a recorded event doesn't match the optional filter, it will be silently ignored.
A valid BT
source file contains at least
one probe clause associated with an
action statement.
The list of available probes may vary from system to system and can be queried with btrace(8).
The special probes BEGIN
and
END
may be used to manipulate states before the
first event is recorded and after the last. They cannot be combined with any
filter.
Define under which condition an event should be recorded when its related probe is executed. An empty filter means record all events.
Variable names available in filters:
An action is a sequence of statements that are evaluated for each event recorded by the associated probe.
Variable names with special meaning:
Functions:
clear
(@map)delete
(@map[key])exit
()hist
(value)lhist
(value,
min, max,
step)max
()min
()print
(@map)print
(@map,
n)printf
(fmt,
...)str
($N,
[index])sum
()time
(timefmt)zero
(@map)BPFtrace reference guide, https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md.
The dialect of the BT
language described
in this manual and supported by btrace(8)
is compatible with BPFtrace. The syntax is similar to
awk(1) and dtrace.
March 31, 2022 | OpenBSD-current |