-
Notifications
You must be signed in to change notification settings - Fork 1k
executor: log host alloc/dealloc #9363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iulianbarbu
wants to merge
17
commits into
paritytech:master
Choose a base branch
from
iulianbarbu:ib-add-runtime-calls-tracking
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
executor: log host alloc/dealloc #9363
iulianbarbu
wants to merge
17
commits into
paritytech:master
from
iulianbarbu:ib-add-runtime-calls-tracking
Conversation
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
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
iulianbarbu
commented
Jul 29, 2025
substrate/client/executor/common/src/runtime_blob/runtime_blob.rs
Outdated
Show resolved
Hide resolved
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
iulianbarbu
commented
Jul 31, 2025
Signed-off-by: Iulian Barbu <[email protected]>
/cmd prdoc |
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
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.
Description
Testing allocation patterns in the context of #8992 required adding some debug logs to trace the calls into host allocator
allocate
ordeallocate
functions, while also tracking which runtime did the call (as code hash), which instance of the runtime, and acall_id
to determine an approximate order of the allocator calls (since the logs associated to allocator calls could pottentially show up out of order in the node logs).Integration
Node developers can track host allocator calls and map them to certain runtimes' instances.
Review Notes
InstanceCounter/ReleaseInstanceHandle
(this is relevant in the context ofinject_input_data
allocation, and when following the code path, it is also the first contact of theWasmtimeRuntime
with the runtime code hash) andHostState
(for the rest of the allocations).InstanceCounter
) and call_id (incremented with each call intoallocate_memory/deallocate_memory
, useful when executing allocations/deallocations which can have out of order logs - e.g. node log can show two allocations for same size resulting in same data pointer, followed at some later point by two deallocations for same data pointer - when simulating the allocations/deallocations we'll match the deallocations to the allocations ordered bycall_id
)wasm_override
andwasm_substitutes
way of computing the runtime code hash - e.g. previously we used the default rust hasher, but I've noticed that throughout the code and in the storage we use mostly blake2_256, so it was important to use the same hashing function to be able to track what runtime calls we do after using wasm overrides or substitutes.u64
s forinstance_id
andallocator_call_id
stored onInstanceCounter
areAtomicU64
because we can have multiple tasks calling into the host allocator (corresponding to multiple live parallel instances), or calling into theInstanceCounter
(for parallel instantiations of same runtime).