| 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()END
probe, if any, is executed and the contents of all non-empty maps are
printed.hist(value)lhist(value,
min, max,
step)print(@map)print(@map,
n)printf(fmt,
...)str($N,
[index])time(timefmt)zero(@map)The following functions only work on a specific map entry.
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.
| October 22, 2023 | openbsd |