-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Current Behavior
When a Guard detects thread migration on drop, the migrated record is attributed to "<migrated>" instead of the actual function name. This is because the 16-byte Guard optimization (PR #112) removed the function name from the Guard struct to minimize timing overhead.
For async code with multiple migrating functions, all migrated invocations collapse into a single "<migrated>" bucket with no way to distinguish which function each record belongs to.
Expected Behavior
Migrated guards should report the actual function name so that per-function timing data is preserved even when tasks migrate across threads.
Possible Approaches
- Look up the function name from the enter thread's TLS stack using the cookie (stack depth) stored in the Guard
- Embed a function name index (interned string table) and store an index in the Guard instead of the full string
- Use a compact function ID assigned at registration time
The constraint is keeping Guard small (currently 16 bytes) to minimize timing distortion from stack allocation.
Related
- Accurate self-time for migrated async functions #94 tracks the separate problem of self-time overcounting for migrated functions. This issue is specifically about losing the function name identity.
Scope
piano-runtime/src/collector.rs
Reactions are currently unavailable