You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make sure guest spans are setup as late as possible to avoid human error #1076
with #924 merging, guest span is setup before calling run_vcpu. In the future, if any spans are created in run_vcpu method, then the spans will be malformed. We should change the api to make sure this cannot happen
After #924, the span is setup in a different functions compared to where we enter the guest (note that run_vcpu does not immediately enter the guest, depending on which hv driver we use):
This means that if a developer in the future changes code so that it emits an event in between these two places (because they forgot you're not supposed to), for example at the top of run_vcpu, the event emitted on the host side will be inside the guest span (incorrect!). The fix should be to move these two places right next to each other so that it's impossible for us (developers) to forget about this in the future. Probably by passing in the tracing context to run_vcpu, and then calling setup_guest_trace right before run_vcpu
Activity
ludfjig commentedon Jan 7, 2026
Before #924, the guest span was set up immediately before entering the guest
hyperlight/src/hyperlight_host/src/hypervisor/kvm.rs
Lines 602 to 604 in 817a7b0
After #924, the span is setup in a different functions compared to where we enter the guest (note that run_vcpu does not immediately enter the guest, depending on which hv driver we use):
hyperlight/src/hyperlight_host/src/hypervisor/hyperlight_vm.rs
Lines 385 to 390 in 70a2c15
and in mshv (also see kvm and whp)
hyperlight/src/hyperlight_host/src/hypervisor/virtual_machine/mshv.rs
Lines 106 to 115 in 70a2c15
This means that if a developer in the future changes code so that it emits an event in between these two places (because they forgot you're not supposed to), for example at the top of run_vcpu, the event emitted on the host side will be inside the guest span (incorrect!). The fix should be to move these two places right next to each other so that it's impossible for us (developers) to forget about this in the future. Probably by passing in the tracing context to run_vcpu, and then calling
setup_guest_traceright beforerun_vcpuCloses hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…
Closes hyperlight-dev#1076: Code refactor to set trace context in run…