Repository navigation
Read the chip's IrqMask-suppressed count from native radio stats - #745
Merged
Merged
Conversation
A chip that applies the firmware's IrqMask counts the events it had to raise and was not allowed to. A native node can append that count to its radio stats record as bytes 43-46; the bridge reads it when the record is at least 47 bytes long. node.stats answers it as irq_suppressed, and the Python client's NodeStat carries it. A record shorter than 47 bytes comes from a chip that does not count, and irq_suppressed is then absent (None in the Python client) rather than zero.
Collaborator
|
keeping an eye |
Collaborator
|
apologies for pipeline breaking... I'll fix this tomorrow at some point, its just missing tih feel free to add it if you wish to this PR or I can do it in a seperate one tomorrow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes, and why
firmware.RadioStatsgainsIRQSuppressedandSuppressedReported, read from bytes 43-46 of a radio stats record (kindRadioStats) that is at least 47 bytes long. A shorter record leavesSuppressedReportedfalse.node.statsanswersirq_suppressedfor each node: the count, ornullwhere the node's chip did not report one.NodeStatgainsirq_suppressed: int | None.The count is the number of IRQ events the chip raised that the firmware's
IrqMaskkept out of the status register. virtual-sx1262 keeps it from MeshBench/virtual-sx1262#2 onward (irq_suppressedinvsx_counters). The native bridge sends it in MeshBench/meshcore-native#26. Until a node sends a 47-byte record, the field isnull.Without it, a node whose firmware did not enable an interrupt and a node whose chip never raised that interrupt report the same
irq_reads,busy_readsandbusy_ms.Manual: MeshBench/docs#40 (regenerated Python and control references).
Verification
gofmt -l .: empty.go vetoninternal/firmware,internal/app/session,internal/app/state: clean.go testoninternal/firmware,internal/app/state,internal/app/session,internal(layers and layout map): pass. The fullgo test ./...was not run.golangci-lintv2.12.2 on the same packages: no findings in changed lines. The pre-existing findings inbuild.go,native.go,prefs.goandbridge.go(net.Listen) are unchanged.tools/verbdoc/verbdoc.py --check: current.internal/firmware/radiostats_test.go(a 47-byte record sets the count andSuppressedReported; a 43-byte record does not). Python:test_a_suppressed_count_is_none_unless_the_chip_kept_one, and an assertion intest_node_stats_carry_the_rowsthat a stopped node answersNone.ruff checkandruff format --checkare clean.pytest tests/against a binary built from this branch: 51 passed, 3 failed (test_pytest_plugin.py:test_the_meshbench_fixture_is_discovered,test_the_scenario_is_cleared_between_tests,test_a_failure_carries_the_provenance). The same three fail with this change stashed; they need the client installed as a package, and it was run from source.8fb9623, in headless runs onfife-strict(three nodes) andscotland-strict. The parsed counts reached the experiment export through the follow-up PR (Record each node's radio counters in every experiment cell #746): 1.16 nodes (IrqMask0x0272) reported 24 and 1.17 nodes (0x0276) 12 on the three-node link.Checklist
CLAUDE.mdin this commit. (No new package.)auditTargets; a new state is reachable by flag. (No panel.)docs/shortcomings.mdstill tells the truth after this change.security-audit/.