Skip to content

Commit 4af8605

Browse files
committed
render: label the component method; drop it from the leak rows
A component's method names a technique category, and five of that vocabulary's six words -- parsed, inferred, heuristic, timing, brute -- are also rungs of the confidence ladder, which grades an individual record's trust instead. Printed bare, the token is read as the second thing. The verbose block header carried it that way over components that produced nothing, where it states a verdict on values none were emitted, and over kernfs_ns_hash, whose header read "parsed" three lines above a record graded heuristic. The header now labels it. The label's width is taken from the string itself, so the rule's column accounting cannot drift from it. The leak rows drop it. A technique category is a property of the component that produced a record, not of the record: every contributor states its own in its block header, and the group's consensus line states the one behind the pick, now labelled there too. Listed per record it repeated that in a comma list of component names, as a lowercase token indistinguishable in form from the names beside it -- and identically on 106 of the 107 rows a live run produces. kasld_method_set_str loses its last caller and goes with them. json is unchanged: it publishes method and methods per record structurally, where the key names the field. The documented samples follow the rows.
1 parent a84fee5 commit 4af8605

4 files changed

Lines changed: 70 additions & 74 deletions

File tree

docs/usage.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -305,75 +305,75 @@ Components: 94 total, 24 succeeded, 26 unavailable, 44 no result
305305
========================================
306306
307307
Kernel text (virtual) / kernel_text [2]:
308-
0xffffffff8fe00000 kernel_text:_stext [base] (proc_kallsyms, parsed)
309-
0xffffffff900a9fc9 kernel_text [interior] (perf_event_open, parsed)
310-
==> 0xffffffff8fe00000 (parsed, 1 source, 1 conflict)
308+
0xffffffff8fe00000 kernel_text:_stext [base] (proc_kallsyms)
309+
0xffffffff900a9fc9 kernel_text [interior] (perf_event_open)
310+
==> 0xffffffff8fe00000 (method: parsed, 1 source, 1 conflict)
311311
range: 0xffffffff8fe00000 - 0xffffffff900a9fc9 (2.7 MiB)
312312
313313
Kernel text (virtual) / kernel_image [3]:
314-
0xffffffff8fe00000 kernel_image:_text [base] (proc_kallsyms, parsed)
315-
0xffffffff8fe00000 kernel_image [base] (prefetch, timing)
316-
0xffffffff90000000 kernel_image [base] (perf_event_open, parsed)
317-
==> 0xffffffff8fe00000 (parsed, 2 sources, 1 conflict)
314+
0xffffffff8fe00000 kernel_image:_text [base] (proc_kallsyms)
315+
0xffffffff8fe00000 kernel_image [base] (prefetch)
316+
0xffffffff90000000 kernel_image [base] (perf_event_open)
317+
==> 0xffffffff8fe00000 (method: parsed, 2 sources, 1 conflict)
318318
range: 0xffffffff8fe00000 - 0xffffffff90000000 (2.0 MiB)
319319
320320
----------------------------------------
321321
Kernel text (physical) / kernel_image [1]:
322-
0x0000000034600000 kernel_image:kernel_code [base] (proc_iomem_kernel, parsed)
323-
==> 0x0000000034600000 (parsed, 1 source)
322+
0x0000000034600000 kernel_image:kernel_code [base] (proc_iomem_kernel)
323+
==> 0x0000000034600000 (method: parsed, 1 source)
324324
325325
----------------------------------------
326326
Kernel data (physical) / kernel_data [1]:
327-
0x0000000036000000 kernel_data:kernel_data [base] (proc_iomem_kernel, parsed)
328-
==> 0x0000000036000000 (parsed, 1 source)
327+
0x0000000036000000 kernel_data:kernel_data [base] (proc_iomem_kernel)
328+
==> 0x0000000036000000 (method: parsed, 1 source)
329329
330330
----------------------------------------
331331
Kernel BSS (physical) / kernel_bss [1]:
332-
0x0000000036b34000 kernel_bss:kernel_bss [base] (proc_iomem_kernel, parsed)
333-
==> 0x0000000036b34000 (parsed, 1 source)
332+
0x0000000036b34000 kernel_bss:kernel_bss [base] (proc_iomem_kernel)
333+
==> 0x0000000036b34000 (method: parsed, 1 source)
334334
335335
----------------------------------------
336336
Physical DRAM / ram [6]:
337-
0x0000000000000000 ram (boot_params_e820, parsed)
338-
0x0000000000000000 ram (firmware_memmap, parsed)
339-
0x0000000000001000 ram [interior] (dmesg_free_area_init_node, proc_zoneinfo, parsed)
340-
0x0000000000100000 ram [base] (boot_params_e820, dmesg_e820_memory_map, dmesg_free_area_init_node, dmesg_last_pfn, proc_zoneinfo, sysfs_firmware_memmap, parsed)
341-
0x0000000000100000 ram (firmware_memmap, parsed)
342-
0x0000000000100000 ram (boot_params_e820, parsed)
343-
==> 0x0000000000100000 (parsed, 3 sources, 3 conflicts)
337+
0x0000000000000000 ram (boot_params_e820)
338+
0x0000000000000000 ram (firmware_memmap)
339+
0x0000000000001000 ram [interior] (dmesg_free_area_init_node, proc_zoneinfo)
340+
0x0000000000100000 ram [base] (boot_params_e820, dmesg_e820_memory_map, dmesg_free_area_init_node, dmesg_last_pfn, proc_zoneinfo, sysfs_firmware_memmap)
341+
0x0000000000100000 ram (firmware_memmap)
342+
0x0000000000100000 ram (boot_params_e820)
343+
==> 0x0000000000100000 (method: parsed, 3 sources, 3 conflicts)
344344
range: 0x0000000000000000 - 0x0000000000100000 (1.0 MiB)
345345
346346
----------------------------------------
347347
Physical DRAM / initrd [1]:
348-
0x000000003efc2000 initrd [base] (boot_params_e820, dmesg_ramdisk, parsed)
349-
==> 0x000000003efc2000 (parsed, 1 source)
348+
0x000000003efc2000 initrd [base] (boot_params_e820, dmesg_ramdisk)
349+
==> 0x000000003efc2000 (method: parsed, 1 source)
350350
351351
----------------------------------------
352352
Physical DRAM / cmdline [1]:
353-
0x0000000000020000 cmdline [base] (cmdline_region, parsed)
354-
==> 0x0000000000020000 (parsed, 1 source)
353+
0x0000000000020000 cmdline [base] (cmdline_region)
354+
==> 0x0000000000020000 (method: parsed, 1 source)
355355
356356
----------------------------------------
357357
Physical DRAM / numa_node [1]:
358-
0x000000003ffdefff numa_node [interior] (dmesg_node_data, parsed)
359-
==> 0x000000003ffdefff (parsed, 1 source)
358+
0x000000003ffdefff numa_node [interior] (dmesg_node_data)
359+
==> 0x000000003ffdefff (method: parsed, 1 source)
360360
361361
----------------------------------------
362362
Physical DRAM / vmcoreinfo [1]:
363-
0x00000000011ee000 vmcoreinfo [interior] (sysfs_vmcoreinfo, parsed)
364-
==> 0x00000000011ee000 (parsed, 1 source)
363+
0x00000000011ee000 vmcoreinfo [interior] (sysfs_vmcoreinfo)
364+
==> 0x00000000011ee000 (method: parsed, 1 source)
365365
366366
----------------------------------------
367367
Physical MMIO / pci_mmio [8]:
368-
0x00000000000c0000 pci_mmio:0000:00:01.0 [base] (sysfs_pci_resource, parsed)
369-
0x00000000fd000000 pci_mmio:0000:00:01.0 [base] (sysfs_pci_resource, parsed)
370-
0x00000000feb40000 pci_mmio:0000:00:02.0 [base] (sysfs_pci_resource, parsed)
371-
0x00000000feb80000 pci_mmio:0000:00:02.0 [base] (sysfs_pci_resource, parsed)
372-
0x00000000feba0000 pci_mmio:0000:00:02.0 [base] (sysfs_pci_resource, parsed)
373-
0x00000000febd0000 pci_mmio:0000:00:02.0 [base] (sysfs_pci_resource, parsed)
374-
0x00000000febd4000 pci_mmio:0000:00:01.0 [base] (sysfs_pci_resource, parsed)
375-
0x00000000febd5000 pci_mmio:0000:00:1f.2 [base] (sysfs_pci_resource, parsed)
376-
==> 0x00000000000c0000 (parsed, 1 source, 7 conflicts)
368+
0x00000000000c0000 pci_mmio:0000:00:01.0 [base] (sysfs_pci_resource)
369+
0x00000000fd000000 pci_mmio:0000:00:01.0 [base] (sysfs_pci_resource)
370+
0x00000000feb40000 pci_mmio:0000:00:02.0 [base] (sysfs_pci_resource)
371+
0x00000000feb80000 pci_mmio:0000:00:02.0 [base] (sysfs_pci_resource)
372+
0x00000000feba0000 pci_mmio:0000:00:02.0 [base] (sysfs_pci_resource)
373+
0x00000000febd0000 pci_mmio:0000:00:02.0 [base] (sysfs_pci_resource)
374+
0x00000000febd4000 pci_mmio:0000:00:01.0 [base] (sysfs_pci_resource)
375+
0x00000000febd5000 pci_mmio:0000:00:1f.2 [base] (sysfs_pci_resource)
376+
==> 0x00000000000c0000 (method: parsed, 1 source, 7 conflicts)
377377
range: 0x00000000000c0000 - 0x00000000febd5000 (4.0 GiB)
378378
379379
----------------------------------------

src/include/kasld/internal.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -314,26 +314,6 @@ static inline const char *kasld_method_set_strongest(uint16_t set) {
314314
return "unknown";
315315
}
316316

317-
/* Format a method set strongest-first as "parsed+timing" into buf ("unknown" if
318-
* empty). Surfaces method diversity where a single line has room (verbose). */
319-
static inline void kasld_method_set_str(uint16_t set, char *buf, size_t sz) {
320-
if (sz == 0)
321-
return;
322-
buf[0] = '\0';
323-
size_t o = 0;
324-
for (int m = KM_COUNT - 1; m >= 0; m--) {
325-
if (!(set & (1u << m)))
326-
continue;
327-
int w = snprintf(buf + o, sz - o, "%s%s", o ? "+" : "",
328-
kasld_method_name((enum kasld_method)m));
329-
if (w < 0 || (size_t)w >= sz - o)
330-
break;
331-
o += (size_t)w;
332-
}
333-
if (o == 0)
334-
snprintf(buf, sz, "unknown");
335-
}
336-
337317
/* Provenance: which components contributed a record.
338318
*
339319
* A component's identity is its slot in the discovery table, assigned once

src/orchestrator.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,9 +1814,20 @@ static void print_component_banner(const char *name, const char *method) {
18141814
printf("\n%s%s%s %s%s%s", c(C_DIM), bar2, c(C_RESET), c(C_BOLD), name,
18151815
c(C_RESET));
18161816
if (method && *method) {
1817-
printf(" %s%s%s %s%s%s", c(C_DIM), dot, c(C_RESET), c(C_DIM), method,
1818-
c(C_RESET));
1819-
cols += 3 + (int)strlen(method); /* " . " + method */
1817+
/* Labelled, because the value alone does not say which vocabulary it comes
1818+
* from. It names a technique category, and five of that vocabulary's six
1819+
* words -- parsed, inferred, heuristic, timing, brute -- are also rungs of
1820+
* the confidence ladder, which grades an individual record's trust instead.
1821+
* A bare word heading a block that produced nothing therefore reads as a
1822+
* verdict on values the component never emitted, and a component whose
1823+
* technique parses a file can carry records grading lower than the word
1824+
* above them. The label is what keeps the two apart. */
1825+
static const char label[] = "method: ";
1826+
printf(" %s%s%s %s%s%s%s", c(C_DIM), dot, c(C_RESET), c(C_DIM), label,
1827+
method, c(C_RESET));
1828+
/* " . " + label + value; the label's width is taken from the string itself
1829+
* so the two cannot drift apart. */
1830+
cols += 3 + (int)(sizeof(label) - 1) + (int)strlen(method);
18201831
}
18211832
putchar(' ');
18221833
cols += 1;

src/render/text.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,17 @@ static void print_group(enum kasld_addr_type type, const char *section,
129129
for (int k = 0; k < n_indices; k++) {
130130
struct result *r = &results[indices[k]];
131131

132-
/* Compact form shows region (and ":name" when known); verbose adds
133-
* origin and method in parentheses. region+name tells the reader
134-
* what the address is; origin tells them which component found it. */
132+
/* Compact form shows region (and ":name" when known); verbose adds the
133+
* contributing components in parentheses. region+name tells the reader what
134+
* the address is; the components tell them who found it.
135+
*
136+
* The parenthetical carries component names and nothing else. A technique
137+
* category is a property of a component, not of a record: every contributor
138+
* states its own in its block header, and the group's consensus line states
139+
* the one behind the pick. Listed here it would repeat that per record, in
140+
* a vocabulary sharing five of six words with the confidence ladder, as a
141+
* bare lowercase token indistinguishable in form from the component names
142+
* beside it. */
135143
char rn[64 + NAME_LEN + 2];
136144
if (r->name[0])
137145
snprintf(rn, sizeof(rn), "%s:%s", kasld_region_wire(r->region), r->name);
@@ -142,29 +150,25 @@ static void print_group(enum kasld_addr_type type, const char *section,
142150

143151
if (!in_bounds(r)) {
144152
if (verbose) {
145-
char mbuf[64];
146-
kasld_method_set_str(r->method_set, mbuf, sizeof mbuf);
147153
printf(" %s0x%016lx%s %s%s %s(", c(C_RED), a, c(C_RESET), rn,
148154
pos_note(r), c(C_DIM));
149155
for (int j = origin_set_next(&r->origins, 0), oi = 0; j >= 0;
150156
j = origin_set_next(&r->origins, j + 1), oi++)
151157
printf("%s%s", oi ? ", " : "", kasld_origin_name(j));
152-
printf(", %s, stale)%s\n", mbuf, c(C_RESET));
158+
printf(", stale)%s\n", c(C_RESET));
153159
} else
154160
printf(" %s0x%016lx%s %s%s %s(stale)%s\n", c(C_RED), a, c(C_RESET),
155161
rn, pos_note(r), c(C_DIM), c(C_RESET));
156162
continue;
157163
}
158164

159165
if (verbose) {
160-
char mbuf[64];
161-
kasld_method_set_str(r->method_set, mbuf, sizeof mbuf);
162166
printf(" %s0x%016lx%s %s%s %s(", c(C_GREEN), a, c(C_RESET), rn,
163167
pos_note(r), c(C_DIM));
164168
for (int j = origin_set_next(&r->origins, 0), oi = 0; j >= 0;
165169
j = origin_set_next(&r->origins, j + 1), oi++)
166170
printf("%s%s", oi ? ", " : "", kasld_origin_name(j));
167-
printf(", %s)%s\n", mbuf, c(C_RESET));
171+
printf(")%s\n", c(C_RESET));
168172
} else
169173
printf(" %s0x%016lx%s %s%s\n", c(C_GREEN), a, c(C_RESET), rn,
170174
pos_note(r));
@@ -186,7 +190,7 @@ static void print_group(enum kasld_addr_type type, const char *section,
186190
section_consensus_info(type, section, region_filter, &bm, &ns, &nc, &io);
187191
/* A lone interior sample is a point inside the region, not its base — say
188192
* so, rather than presenting it as the resolved address. */
189-
printf(" %s==>%s 0x%016lx %s(%s, %s%d source%s)%s\n", c(C_CYAN),
193+
printf(" %s==>%s 0x%016lx %s(method: %s, %s%d source%s)%s\n", c(C_CYAN),
190194
c(C_RESET), addrs[0], c(C_DIM), bm, io ? "interior sample; " : "",
191195
ns, ns == 1 ? "" : "s", c(C_RESET));
192196
} else if (n_addrs > 1) {
@@ -201,8 +205,8 @@ static void print_group(enum kasld_addr_type type, const char *section,
201205
* no single base to pick, and the samples corroborate rather than
202206
* conflict, so the count is "N samples from M sources", never conflicts.
203207
*/
204-
printf(" %s==>%s spans 0x%016lx - 0x%016lx %s(%s; %d samples, %d "
205-
"source%s; %s)%s\n",
208+
printf(" %s==>%s spans 0x%016lx - 0x%016lx %s(method: %s; %d "
209+
"samples, %d source%s; %s)%s\n",
206210
c(C_CYAN), c(C_RESET), addrs[0], addrs[n_addrs - 1], c(C_DIM), bm,
207211
n_addrs, ns, ns == 1 ? "" : "s",
208212
human_size(span, hbuf, sizeof(hbuf)), c(C_RESET));
@@ -212,11 +216,12 @@ static void print_group(enum kasld_addr_type type, const char *section,
212216
* coverings and for corroborating interior/top records), so it is printed
213217
* only when a real disagreement exists. */
214218
if (nc > 0)
215-
printf(" %s==>%s 0x%016lx %s(%s, %d source%s, %d conflict%s)%s\n",
219+
printf(" %s==>%s 0x%016lx %s(method: %s, %d source%s, %d "
220+
"conflict%s)%s\n",
216221
c(C_CYAN), c(C_RESET), consensus, c(C_DIM), bm, ns,
217222
ns == 1 ? "" : "s", nc, nc == 1 ? "" : "s", c(C_RESET));
218223
else
219-
printf(" %s==>%s 0x%016lx %s(%s, %d source%s)%s\n", c(C_CYAN),
224+
printf(" %s==>%s 0x%016lx %s(method: %s, %d source%s)%s\n", c(C_CYAN),
220225
c(C_RESET), consensus, c(C_DIM), bm, ns, ns == 1 ? "" : "s",
221226
c(C_RESET));
222227
printf(" %s %s range: 0x%016lx - 0x%016lx (%s)\n", c(C_CYAN),

0 commit comments

Comments
 (0)