Skip to content

svg: draw every process that ran while the chart did - #3

Merged
aledbf merged 1 commit into
cgroup-v2-namesfrom
keep-short-lived
Nov 22, 2026
Merged

aledbf merged 1 commit into
cgroup-v2-namesfrom
keep-short-lived

Conversation

@aledbf

@aledbf aledbf commented Nov 22, 2026

Copy link
Copy Markdown
Member

Why

spin-stack/machine draws its boot with this fork to see how systemd starts inside a ~300-400 ms VM boot on one vCPU, and to catch regressions release to release. The chart of that boot said "62 filtered": generators, executors, (sd-close) and the like were dropped, and they are a large part of what systemd does before the first login.

What

  • The filter dropped a process seen in only one sample, and one that used less than 1 ms of CPU. It now drops a process only when it used no CPU time while the chart ran. For a process already running at the first sample that saw processes, that means none after that sample. Idle kernel threads are still left out.
  • A process seen in a single sample had a bar of zero width, since its first and last points were the same sample. A process that started while the chart ran is now drawn over the interval before the sample that first saw it, in which it started, with the CPU time it used there.
  • The man pages say what the filter keeps.

A process that starts and exits between two samples is still not seen. Sampling cannot see it. At 200 Hz that is a process shorter than 5 ms that no sample caught.

Checked

tests/short-lived runs the sampler at 50 Hz over a fixture /proc where a generator appears for ~30 ms with 0.3 ms of CPU, and where a kernel thread is idle for the whole chart. The test asserts the generator's bar is drawn and the idle thread's is not. With the old 1 ms rule the test fails ("the chart dropped a process that ran for 0.3 ms"). make check passes under ASan/UBSan with gcc in an Ubuntu 24.04 container. CI covers clang.

Stacked on #2.

🤖 Generated with Claude Code

The filter dropped a process seen in one sample and one that used less
than 1 ms of CPU. In a boot of a few hundred milliseconds that is most
of systemd's work: generators, executors, (sd-close) and the like. On
spin-stack/machine's boot it dropped 62 processes.

A process is now dropped only when it used no CPU time while the chart
ran: for one already running at the first sample that saw processes,
none past that sample. A process seen in a single sample is drawn over
the interval before it, in which it started, with the CPU time it used
there; before, its bar had no width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit ff81c6e into cgroup-v2-names Nov 22, 2026
2 of 4 checks passed
@aledbf aledbf mentioned this pull request Nov 22, 2026
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