nx_blkprofile.nx
buildroot/runtime/nx_blkprofile.nx
about
nx_blkprofile.nx -- THE BURST PROFILER for the D-state admission witness. Rung DG1, /compare/degradation.
WHY THIS EXISTS, IN THE CONF'S OWN WORDS. knowledge/build_admit.conf carries blocked_samples and
blocked_gap_ms -- THE SMOOTHED WITNESS -- and leaves them DELIBERATELY UNARMED behind a written work
order: "sample procs_blocked at a fixed interval for a few minutes and find the shortest span over
which the median stops tracking the bursts ... Then write the sample count, the gap, and the run that
produced them on this line." That derivation had never been run, so a capability the conf itself
measured at roughly 42 percent of build refusals sat inert. THIS ORGAN IS THAT DERIVATION.
IT REFUSES TO RECOMMEND A SPAN IT DID NOT MEASURE. Every row below is produced by replaying a REAL
recorded series through the REAL median, so a recommendation here is a measurement, never a taste.
IT COMPOSES THE SHIPPING RULERS AND RE-IMPLEMENTS NEITHER. ioa_measure reads /proc/stat exactly as
nx_build_admit does, and ioa_median IS the median nx_build_admit applies once armed. The verdicts in
the span table are therefore the verdicts THE ARMED GATE WOULD HAVE PRODUCED on this series -- not an
approximation, and not a second ruler that can drift from the first.
THE LATENCY COLUMN IS NOT DECORATION. The conf refuses arming until that cost is measured, because the
span is paid by EVERY caller of the admission check -- the clock dispatcher's pre-dispatch call
included. A span that fixes admission and stalls the dispatcher has moved the defect, not removed it.
TWO TIMESCALES, TWO VERBS. `live` samples fine enough to resolve a 2-12 s burst. `jrnl` re-reads the
procchurn journal the estate ALREADY writes, for the long-run base rate at zero added load -- a second
reader of an old log, never a second collector.
NO CLOCK IS READ. sys_time_ms is ABSENT-PROVEN in this runtime (buildroot/runtime, corpus_complete=1),
so the window is reported as NOMINAL and derived from the sample count and interval. The added-latency
column needs no clock either: a sampler that sleeps a span pays that span BY CONSTRUCTION.
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_ioadmit_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 33 | const BP_STDOUT: i64 = 1 |
| 34 | const BP_STDERR: i64 = 2 |
| 35 | const BP_OUTCAP: i64 = 262144 |
| 36 | const BP_MAX_SAMPLES: i64 = 8192 |
| 37 | const BP_SAMPLE_BYTES: i64 = 65536 |
| 38 | const BP_HIST_MAX: i64 = 512 |
| 39 | const BP_HIST_BYTES: i64 = 4096 |
| 40 | const BP_KBUF_BYTES: i64 = 256 |
| 41 | const BP_MEAS_BYTES: i64 = 64 |
| 42 | const BP_SIMOUT_BYTES: i64 = 64 |
| 43 | const BP_BOX_BYTES: i64 = 64 |
| 44 | const BP_UNREADABLE: i64 = 0 - 1 |
| 45 | const BP_EXIT_USAGE: i64 = 2 |
| 46 | const BP_EXIT_UNMEASURED: i64 = 3 |
| 47 | const BP_DEF_DUR_S: i64 = 180 |
| 48 | const BP_DEF_INTERVAL_MS: i64 = 200 |
| 49 | const BP_DEF_K: i64 = 5 |
| 50 | const BP_NSPANS: i64 = 8 |
| 51 | const BP_CONV_TOL_PERMIL: i64 = 10 |
| 52 | const BP_MS_PER_S: i64 = 1000 |
| 53 | const BP_PERMIL: i64 = 1000 |
| 54 | const BP_CH_MINUS: i64 = 45 |
| 55 | const BP_CH_0: i64 = 48 |
| 56 | const BP_CH_9: i64 = 57 |
| 57 | const BP_CH_LIVE: i64 = 108 |
| 58 | const BP_CH_JRNL: i64 = 106 |
| 63 | const BP_JRNL: *u8 = "knowledge/status/procchurn.jrnl" |
| 64 | const BP_JRNL_UP: *u8 = "../knowledge/status/procchurn.jrnl" |
| 67 | const BP_BLOCKED_KEY: *u8 = "blocked=" |
functions
| 69 | func bp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 70 | func bp_werr(s: *u8) -> i64 { sys_write(BP_STDERR, s, bp_slen(s)); return 0 } |
| 72 | func bp_puts(b: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 79 | func bp_puti(b: *u8, off: i64, v: i64) -> i64 called by 1: main |
| 98 | func bp_atoi(s: *u8) -> i64 |
| 117 | func bp_span_at(i: i64) -> i64 called by 1: main |
| 132 | func bp_pct(hist: *i64, n: i64, permil: i64) -> i64 called by 1: main |
| 150 | func bp_sim(s: *i64, n: i64, interval_ms: i64, k: i64, span_ms: i64, bar: i64, kbuf: *i64, out: *i64) -> i64 |
| 178 | func main(argc: i64, argv: *i64) -> i64 |