Skip to content

Conversation

@dblnz
Copy link
Contributor

@dblnz dblnz commented Nov 27, 2025

The trace-dump utility tool expects only a pointer when a free operation is reported.
The place where the mem_trace file is read can be checked at trace_dump/main.rs#L593 where you can see that for frame_id==3 there is no amount read.

When mem_trace feature is enabled for both host and guest, this works as follows:

  • the guest makes a VMExit for each Alloc/Free.
  • It passes ptr, len to the host for the alloc/free which represent: the allocated/freed pointer, the length of the allocated memory
  • The host then unwinds the stack (using the shared memory) to re-construct the call tree for the specific allocation.
  • It writes to a <uuid>.trace file the following info: time, trace_id, ptr, amount, stack. Trace ID represents the type of allocation.
  • The tool expects only ptr, stack for the Free variant, hence the fix here.
  • The trace_dump tool takes the debug symbols file as a parameter to know how to translate the pointers of the stack frames.
  • It the lists all the operations listed in the <uuid>.trace file

- The trace-dump utility tool expects only a pointer when a free
operation is reported.

Signed-off-by: Doru Blânzeanu <[email protected]>
@dblnz dblnz requested a review from danbugs as a code owner November 27, 2025 09:55
@dblnz dblnz added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Nov 27, 2025
@dblnz dblnz merged commit 187a870 into hyperlight-dev:main Nov 27, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants