fresnel-fourier iter7 Phase 7 fix-forward: data links connect pads not entities directly

Empirical Phase 7 verification revealed the algorithm bug: data links
in MEDIA_IOC_G_TOPOLOGY connect PAD IDs, not entity IDs directly.
My iter7 Phase 6 commit compared link source_id/sink_id against
the proc entity_id, never matched → io_entity_ids stayed empty →
interface lookup never fired → returns -1 → falls back to legacy
hardcoded path.

Topology dump on fresnel /dev/media0 (rkvdec) confirmed:
- Entity 3 (rkvdec-proc) has function=0x4008 (DECODER) ✓
- Data link src=16777218 sink=16777220 — these are PAD ids
  (0x01000002, 0x01000004), NOT entity 3.
- Interface link src=50331660 (interface) sink=1 (entity) — for
  interface links source/sink ARE entity IDs.

Fix: resolve pads → entities via the topo.pads[] array.
1. Collect pads belonging to proc entity (via pads[].entity_id).
2. For each data link touching those pads, the OTHER pad's
   entity_id is an IO neighbor.
3. Find interface link to those IO entities (unchanged from prev).

Also allocate topo.pads[] in the 2-call ioctl pattern.

Signed-off-by: claude-noether <claude-noether@reauktion.de>
This commit is contained in:
claude-noether
2026-05-13 11:00:20 +00:00
parent c106d95869
commit 6df2159dd3
2 changed files with 57 additions and 22 deletions
+11 -9
View File
@@ -171,17 +171,19 @@ run_consumer() {
sleep 1
# Parse pidstat by header: locate the %CPU column index from the
# column-name row, then apply it to data rows. Robust across
# sysstat 12.x point releases (where column positions shift).
# column-name row (where any field equals "%CPU"), then apply it
# to data rows. Robust across sysstat 12.x point releases.
# pidstat default output has no '#' header marker — the header is
# the first row containing "%CPU" as a field.
awk '
# Header row: find which field is %CPU.
$1 == "#" {
for (i = 1; i <= NF; i++) if ($i == "%CPU") col = i
next
# Header row: any line where some field equals "%CPU".
!col {
for (i = 1; i <= NF; i++) if ($i == "%CPU") { col = i; next }
}
# Data row: skip the average summary at end + blank lines.
col && NF >= col && $1 ~ /^[0-9]/ {
if ($col ~ /^[0-9]+(\.[0-9]+)?$/) print $col
# Data row: lines whose value at $col is numeric. Skip the
# trailing "Average" summary by requiring $col to parse cleanly.
col && NF >= col && $col ~ /^[0-9]+(\.[0-9]+)?$/ {
print $col
}
' "$logdir/pidstat.log" >"$logdir/cpu_pct.log" || true