Skip to content

Charts without the first sample's jump, a wait graph that saturated, or unexplained lines (spin-stack/machine#534) - #10

Merged
aledbf merged 6 commits into
mainfrom
fork-534
Nov 22, 2026
Merged

aledbf merged 6 commits into
mainfrom
fork-534

Conversation

@aledbf

@aledbf aledbf commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Why

Boot charts a reader can trust without guessing, so the delays to a cold boot's first SSH login in spin-stack/machine can be explained with evidence. This fixes, in the fork, the upstream issues that matter to how that machine runs the sampler (triaged in spin-stack/machine#534), and two faults found in the lab's chart from #9 (lab run 45060814905).

What changes for a reader

Verification

Lab run 45064083873 (bench, spin's shape, v20261122.05, 3 boots) drew this branch's 1f00a0f. In each of the 3 charts the write graph is empty, and pgpgout reads 124 KB in every sample. The first samples before /proc carry the first counters (for example 21409 KB read, 81.8 ms CPU from 86.6 to 101.9 ms). There is no wait graph, CPU pressure sits under CPU utilization, the header's two lines are drawn at 12px, and the process graph's title carries its legend.

CI passes on gcc and clang under ASan and UBSan. Locally, make check in ubuntu:24.04 passed all 8. One earlier local run, made while two other test builds shared the laptop, failed io, json and short-lived on samples the sampler dropped under load. Its rerun at load average 14 passed, and those tests use none of the changed code. Each new assertion was watched failing first, on main's code for before-proc, the wait graph, the legend and the header, and on a deliberate mutation for the three holding tests.

🤖 Generated with Claude Code

aledbf and others added 6 commits November 22, 2026 16:47
As PID 1 the sampler starts before /proc is mounted, and its samples
until then held zeros. The first sample that read /proc then differed
from zero by everything the kernel had counted since it started. In the
lab's chart (spin-stack/machine#534, run 45060814905) that one interval
read 21 MB, wrote 124 KB and ran 79 ms of CPU, so the CPU and pressure
graphs began with a full bar, and the IO graphs' 250 ms smoothing turned
the jump into a ramp: the write graph had the read graph's shape in a
boot whose only write was the 124 KB before the chart began.

The samples before /proc now carry the first counters it gives, so
counting starts there and the JSON's differences start at zero too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "CPU[overall] wait" graph drew the sum of every task's run delay from
/proc/schedstat (systemd#13). Two tasks waiting at once
count twice, so on the guest's one vCPU it sat at its ceiling from 100 ms
to the end of the lab's chart (spin-stack/machine#534), and read like a
boot bound by IO. The fork already draws /proc/pressure/cpu, the share of
each interval in which some task waited for a CPU, which had the same
outline with its texture kept. With the wait graphs gone, CPU pressure sits
right under CPU utilization. Each process's bar and the tables still say
who waited and for how long, and the JSON keeps the summed counter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… are

Nothing on the chart said that a dashed line joins a process to its
parent (systemd#39), or what a bar's blue, yellow and
orange are. The graph's title now says both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream named processes from the first line of /proc/PID/sched, and
lost a name's first characters to it, "(systemctl)" as "(ystemctl)"
(systemd#44), and every name on a kernel without the
file, whose tables then listed "[0]" (systemd#34). The
fork names a process by its comm, and by its exe for a comm of digits
(spin-stack/machine#528), and reads no sched file. The identity test now
holds both: a "(systemctl)" keeps its first character, which a mutation
that dropped it showed the test catching, and with no sched file under
--proc no process is nameless and no table lists "[0]".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream's chart left out systemd-backlight@backlight:intel_backlight.service
(systemd#40), a unit that runs for a moment and whose
name holds "@" and ":". The fork draws every process that ran while the
chart did (spin-stack/machine#525) and reads the unit from the cgroup v2
path whole. The short-lived test now holds it: an instance that ran
0.4 ms is drawn and labelled with its unit, and a mutation that cut the
path at ":" showed the test catching it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since font sizes carry their unit (spin-stack/machine#528) the two lines
that say what the samples were and what they cost are drawn at the 8px
of the time axis' labels, and were hard to read (spin-stack/machine#534).
They are now drawn like the header's other lines, 12px and 15px apart,
which leaves 30px before the tables' titles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit 3125dea into main Nov 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant