Appendix C: Tools and packages
What this appendix is for: Which tool is in which package, which version ran in the lab, and what does it cost to use it on a production system? The versions come from perf1 and last1 (Ubuntu 24.04, kernel 6.8.0-151-generic) on 2026-11-30. The costs were measured in the lab (Day 13 and 14) or follow from how the tool works.
Installing
Day 0 installs everything the course needs. To install something individually:
# on perf1
sudo apt-get install -y sysstatReplace sysstat with the package from the table. For
perf it is two packages, and the second must match the
running kernel exactly:
# on perf1
uname -rExpected:
6.8.0-151-generic
# on perf1
sudo apt-get install -y linux-tools-common linux-tools-6.8.0-151-genericAfter every kernel update you need the linux-tools
package of the new version.
The packages
| Package | Version in the lab | Tools | Day |
|---|---|---|---|
procps |
(base system) | uptime, vmstat, free,
top, ps |
2 |
sysstat |
12.6.1-2 | mpstat, pidstat, iostat,
sar, sadc |
2, 3 |
linux-tools-common +
linux-tools-6.8.0-151-generic |
6.8.0-151.151 | perf |
5, 13 |
bpfcc-tools |
0.29.1+ds-1ubuntu7 | *-bpfcc: runqlat, biolatency,
syscount, opensnoop, execsnoop,
offcputime, memleak … |
4–14 |
bpftrace |
0.20.2-1ubuntu4.3 | bpftrace |
9, 14 |
bpftool (from linux-tools-common) |
7.4.0 | bpftool |
14 |
trace-cmd |
3.2-1ubuntu2 | trace-cmd (ftrace) |
13 |
strace |
6.8-0ubuntu2 | strace |
3, 13 |
fio |
3.36-1ubuntu0.1 | fio |
9, 10, 15 |
stress-ng |
0.17.06-1build1 | stress-ng |
1–4, 10, 14–16 |
iperf3 |
3.16-1build2 (both VMs) | iperf3 |
0–2, 11 |
wrk |
4.1.0-4build2 (both VMs) | wrk |
12, 15, 16 |
nginx |
1.24.0-2ubuntu7.21 | web server as the object under test | 12, 13 |
conntrack |
1:1.4.8-1ubuntu1 | conntrack |
12 |
ethtool |
1:6.7-1build1 | ethtool |
0, 12 |
tcpdump |
4.99.4-3ubuntu4.24.04.1 | tcpdump |
2 |
libc6-dbg |
2.39-0ubuntu8.12 | debug symbols of libc for perf |
5 |
iproute2 |
(base system) | ip, ss, tc,
nstat |
11, 12 |
| FlameGraph (Git) | commit 41fee1f from 2024-10-21 |
stackcollapse-perf.pl, flamegraph.pl |
5 |
What a tool costs
The deeper a tool looks, the more it can change the measured system.
The numbers in the middle column come from Day 13 and 14:
dd bs=1 count=100000 to /dev/null (200,000
system calls), 0.24–0.28 s without a tool.
| Tool | measured, or how it works | in production |
|---|---|---|
vmstat, mpstat, iostat,
sar, pidstat |
read counters from /proc and /sys, once
per interval |
harmless |
/proc/pressure/*, cgroup files |
counters the kernel keeps anyway | harmless |
perf stat |
0.32 s – counts in the kernel | harmless |
perf record -F 99 |
samples, 99 per second and CPU | usually harmless; the file grows |
bpftrace with
count()/hist() |
0.30–0.38 s, exact count | harmless, needs root; startup 1–2 s |
bpftrace with printf per event |
events get lost (Lost … events), not performance |
careful, limit the output |
bcc tools (*-bpfcc) |
like bpftrace, but about 12 s startup (compiling with clang) | harmless, plan for the startup |
perf trace -s |
2.40 s – about ten times slower, loses individual events | short and targeted |
trace-cmd / ftrace function_graph |
every kernel function is recorded | short, with a filter on function and depth |
strace -c |
49 s – about 200 times slower (stops at every system call) | only exceptionally and very briefly |
fio, stress-ng, wrk,
iperf3 |
generate load themselves | never unplanned on production systems |
tc netem |
changes network traffic | only in the lab or in a maintenance window – and undo it (Day 16) |
Privileges
| needs root | works as a normal user |
|---|---|
all perf commands (Ubuntu:
kernel.perf_event_paranoid = 4) |
vmstat, mpstat, iostat,
sar, pidstat, free,
uptime |
bpftrace, all *-bpfcc,
bpftool (Ubuntu:
kernel.unprivileged_bpf_disabled = 2) |
ps, top, ss,
ip |
trace-cmd, strace on processes you did not
start |
strace on your own programs |
dmesg (Ubuntu:
kernel.dmesg_restrict = 1) |
reading cgroup and PSI files |
tc, sysctl -w, systemd-run
for services |
systemd-cgls, systemd-cgtop,
systemctl show |
The limits depend on the security settings. Check them:
# on perf1
sysctl kernel.perf_event_paranoid kernel.unprivileged_bpf_disabled kernel.dmesg_restrictExpected (Ubuntu 24.04):
kernel.perf_event_paranoid = 4
kernel.unprivileged_bpf_disabled = 2
kernel.dmesg_restrict = 1
Without root, dmesg then reports:
dmesg: read kernel buffer failed: Operation not permitted