Skip to content

Flush already closed frames at plugin exit even at the cost of having no post-state for the final frame#47

Open
moste00 wants to merge 1 commit into
BinaryAnalysisPlatform:trace-10.0from
moste00:fix/flush_at_exit
Open

Flush already closed frames at plugin exit even at the cost of having no post-state for the final frame#47
moste00 wants to merge 1 commit into
BinaryAnalysisPlatform:trace-10.0from
moste00:fix/flush_at_exit

Conversation

@moste00

@moste00 moste00 commented Jul 19, 2026

Copy link
Copy Markdown

** Problem **

QEMU plugin API provides no direct way to run a callback at the retiring of every instruction. This is necessary for us because we record post-state for each instruction.

The way the plugin deals with it is by treating the pre-execution boundary of an instruction as the post-excecution boundary of the previous instruction.

But this becomes a problem at the very end of execution, since the final instruction has no next instruction, so we have to capture its post-state at plugin exit, but this is impossible because there is no VCPU in the plugin exit callback.

** Previous State **

This was previously "solved" by just flushing a threshold (64) of frames periodically and accepting that the final batch of less-than-threshold frames will not be flushed.

** Solution **

The piqi format allows a frame with no-post state, so instead of sacrificing the entire residual array of frames at plugin exit, we can just sacrifice only the final frame and close it with no post-state, but flush the rest of the frames that were already closed.

@moste00
moste00 force-pushed the fix/flush_at_exit branch from ca44203 to 7458dba Compare July 19, 2026 18:46
@Rot127

Rot127 commented Jul 20, 2026

Copy link
Copy Markdown

with no post-state

Have you tried if this goes well with rz-tracetest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants