Repository navigation
events: signature grammar, strict startup, info panda-events, owner names - #59
Merged
Merged
Conversation
…ames Signature grammar (docs/design/event-signature-grammar.md): - ptr<T>, ptr<str> and ptr<u8[len]> hash their target; a bare ptr hashes as before. - bool is u8 for identity; the full signature keeps bool, so Python gets booleans. - type[N] declares a fixed array and hashes N. No existing UUID changes. events.c parses, canonicalizes (no whitespace, N without leading zeros), lays out and diffs the new types. events.h adds PANDA_EVENT_CTYPE_bool and the PANDA_EVENT_ARRAY, PTR, STR and BUF field-list forms. Startup check: a subscription still PENDING or MISMATCH once the machine is up fails startup by default. PANDA_EVENTS_STRICT=0 (or panda_events_set_strict(false)) makes it a warning. The report is one block, a line per subscription (event, signature, owner, kind, state, reason). PANDA_SUB_OPTIONAL marks a conditional subscription: it is listed but never fails startup. After startup, a subscription that goes PENDING is logged when it does. - On the command line, a machine-init-done notifier added when the library loads runs the check after -plugin and the panda modules are in, and exits 1 on failure. It returns at once unless analysis is provisioned, and does not set the registry up if nothing used it. - Under pandare2, panda_init defers the notifier, runs the check after after_machine_init, and returns 1 instead of exiting; pandare2 raises EventsUnboundError with panda_events_startup_report(). panda_init also re-evaluates admission after qemu_init, since a subscription made before QEMU chose KVM was decided with KVM off. info panda-events: events-hmp.c prints panda_events_describe(false), and engine patch 0101 adds the command to hmp-commands-info.hx under CONFIG_PANDA. panda_events_set_owner_name(owner, name) names an owner that is not a plugin (pandare2's subscriptions), which otherwise shows as ?. NULL or "" forgets it, and so does an unload. tests/static/event-uuid-vectors.tsv holds (namespace, name, signature, hashed part, UUID) rows, including bool/u8 and whitespace pairs that share a UUID. events_registry.py checks them against events.c and Python's uuid5, and rust/panda-bindings/tests/event_uuid_vectors.rs derives them in Rust. events_registry.py also covers the grammar, strictness, the report, the command-line notifier, panda_init's return under strict, optional subscriptions and owner names.
pandare2 subscribes before panda_init. A publish or unsubscribe then queued an RCU free, and QEMU's call_rcu thread takes the BQL to run callbacks, which qemu_init has not initialized yet: the thread aborted (qemu_mutex_lock_impl: mutex->initialized). panda_events_call_rcu keeps such frees until the machine-init-done notifier (panda_events_machine_up), then queues them. The registry's snapshot and subscription frees and the core callback lists' retired entries go through it. Host test: the stub call_rcu asserts the machine is up, as QEMU's thread would; events_registry.py has early cases (publish, instance data and unsubscribe before the machine is up, directly and before panda_init), and brings the machine up first otherwise.
lacraig2
force-pushed
the
events-e1-finish
branch
from
November 13, 2026 16:41
5d7d773 to
96d7d71
Compare
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.
Finishes the event registry from #58: the signature grammar, startup strictness,
info panda-events, owner names, and a fix for RCU frees made before the machine is up.Signature grammar (
docs/design/event-signature-grammar.md)ptr<T>,ptr<str>andptr<u8[len]>hash their target; a bareptrhashes as before.boolisu8for identity; the full signature keepsbool, so Python gets booleans.type[N]declares a fixed array and hashesN.tests/static/event-uuid-vectors.tsvholds the vectors;events_registry.pychecks them againstevents.cand Python'suuid5, andrust/panda-bindings/tests/event_uuid_vectors.rsderives them in Rust.Startup check
PANDA_EVENTS_STRICT=0(orpanda_events_set_strict(false)) makes it a warning. The report is one block, one line per subscription.PANDA_SUB_OPTIONALmarks a conditional subscription: it is listed but never fails startup.panda_initreturns 1 and pandare2 raisesEventsUnboundErrorwith the report.panda_initalso re-evaluates admission afterqemu_init.info panda-events(engine patch 0101): lists every event with its UUID, publisher, signature and namespace, and each subscription with its owner, state, kind, modes and reason. The handler ispanda/src/events-hmp.c; the patch adds the command tohmp-commands-info.hxunderCONFIG_PANDA. Records: ORIGINS, REUSE,features.toml(plugins),vanilla-gates.toml,base.jsonre-recorded.Owner names:
panda_events_set_owner_name(owner, name)names an owner that is not a plugin (pandare2's subscriptions).RCU frees before the machine is up: pandare2 subscribes before
panda_init, and QEMU's call_rcu thread takes the BQL, which isn't initialized yet.panda_events_call_rcukeeps those frees until the machine-init-done notifier.Tests
nix buildof the engine,.#python, the test plugins and every flake check: pass.guest,callbacks,api(now checksinfo panda-events),late,teardown,hookalias,calls: pass.callshit its known intermittent hang once, then passed 3 of 3 reruns.verify-series.sh: 101 patches apply with strict context;check-series.py,vanilla_inventory.pyandtools/docs/gen.py --checkpass.After rebasing onto the renumbered series:
info panda-eventsis patch 0101. Thenix buildof.#python,nix flake check, the smoke test and the guest tests above (api,callbacks,late,teardown,calls,guest,hookaliason x86_64 Debian 13) all pass.verify-series.sh: 101 patches apply with strict context.