tsastat v0.1.0
v0.1.0 is a major scheduler-observability and measurement-accuracy release. It adds three complementary Linux data sources and an adaptive hybrid mode while keeping uncertainty, counter semantics, and thread identity explicit.
The release changes 59 files with 6,935 additions and 414 deletions (7,349 changed text lines), plus regenerated embedded CO-RE BPF objects. The primary implementation is PR #11.
P0 — Improved proc accuracy
- separates the sampling cadence from fixed report windows and splits observations at exact window boundaries
- identifies every thread by
(tid, starttime)so recycled TIDs never merge different thread lifetimes - timestamps individual reads near their midpoint and records complete proc scan bounds
- reports actual maximum sample gaps, scan duration, detected-transition uncertainty, initialization races, and unattributed/unknown time
- tracks new and disappearing threads without silently converting incomplete coverage into known state time
P1 — schedstat scheduler counters
- accumulates per-thread cumulative on-CPU nanoseconds, runqueue-wait nanoseconds, and timeslices
- preserves exact kernel counter deltas between successful reads
- allocates counter pairs that cross a report boundary proportionally by wall time while preserving their total across windows
- detects counter resets and exposes scheduler coverage and sample-gap quality metadata
- brackets every
schedstatread with twostatidentity reads, retrying TID reuse instead of mixing counters from different threads
P2 — event-driven eBPF timeline
- embeds CO-RE programs for
sched_switch,sched_wakeup, andsched_wakeup_new - builds an event-timed per-thread timeline for on-CPU, runnable, sleeping, and uninterruptible/D-state time
- reports timeslices, wakeup count, total/average/maximum wakeup latency, and incomplete wakeups
- splits scheduler segments at exact report boundaries and flushes the BPF ring buffer before emission
- exposes lost events, late events, initialization races, incomplete wakeups, and clock-calibration uncertainty
- monitors the original target through pidfd and stops on process exit, preventing a recycled numeric PID from becoming the new target
P3 — taskstats delay attribution
- collects per-TID cumulative delay counters through Generic Netlink
- attributes CPU, block I/O, swap-in, direct reclaim, page-cache thrashing, memory compaction, write-protect-copy, and IRQ/softirq delays
- decodes counters by taskstats version and payload length, with per-field availability instead of false zeroes
- rejects the incompatible version 15 layout and detects per-counter resets
- preserves exact counter deltas between reads and reports proportional window allocation and maximum sample gaps
- rechecks proc identity after every Netlink reply so a response cannot attach to a reused TID
P4 — adaptive auto / hybrid backend
- makes
autothe default backend and combines every usable source - prefers eBPF scheduler events + taskstats delay counters + proc identity/state metadata
- falls back to taskstats + proc, then proc-only when privileged kernel sources are unavailable
- reports active and unavailable sources in every result
- converts kernel
start_boottimeidentity to/procstart ticks, including time-namespace offsets, so taskstats data can safely merge with threads created after eBPF startup - never falls back to a newly reused PID after the original target is confirmed gone
Output and diagnostics
- expands table and JSON Lines output with scheduler, delay, source-selection, and quality fields
- adds sorting/filtering for scheduler and individual delay metrics
- extends
tsastat doctorwith proc, schedstat, eBPF, taskstats, kernel-version, and delay-accounting diagnostics - embeds architecture-specific BPF objects; runtime systems do not need Clang, bpftool, or kernel headers
Validation
- race-enabled tests on Go 1.22.x and Go stable
go vetand formatting checks- Linux AMD64 and ARM64 release builds
- GoReleaser snapshot validation on the PR and merged
main - release artifact checksums and GitHub build-provenance attestations
Build workflow maintenance
- updated
actions/setup-goto 7.0.0 - updated
actions/checkoutto 7.0.1 - updated
actions/attestto 4.2.2
Full comparison: v0.0.2...v0.1.0