mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-11 04:52:58 +00:00
hv: hv_main: adjust vm exit trace position
When we use script to analyze the latency between vm_exit and vm_entry, it does not include the duration of vm_exit handler. The patch moves the vm_exit trace before vmexit_handler. v2: move vm_exit trace right after run_vcpu. Tracked-On: #2341 Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com> Reviewed-by: Yan, Like <like.yan@intel.com>
This commit is contained in:
parent
dc6d1d5fa7
commit
7c56243225
@ -58,16 +58,17 @@ void vcpu_thread(struct sched_object *obj)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE_2L(TRACE_VM_ENTER, 0UL, 0UL);
|
|
||||||
|
|
||||||
profiling_vmenter_handler(vcpu);
|
profiling_vmenter_handler(vcpu);
|
||||||
|
|
||||||
|
TRACE_2L(TRACE_VM_ENTER, 0UL, 0UL);
|
||||||
ret = run_vcpu(vcpu);
|
ret = run_vcpu(vcpu);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
pr_fatal("vcpu resume failed");
|
pr_fatal("vcpu resume failed");
|
||||||
pause_vcpu(vcpu, VCPU_ZOMBIE);
|
pause_vcpu(vcpu, VCPU_ZOMBIE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
basic_exit_reason = vcpu->arch.exit_reason & 0xFFFFU;
|
||||||
|
TRACE_2L(TRACE_VM_EXIT, basic_exit_reason, vcpu_get_rip(vcpu));
|
||||||
|
|
||||||
vcpu->arch.nrexits++;
|
vcpu->arch.nrexits++;
|
||||||
|
|
||||||
@ -76,7 +77,6 @@ void vcpu_thread(struct sched_object *obj)
|
|||||||
CPU_IRQ_ENABLE();
|
CPU_IRQ_ENABLE();
|
||||||
/* Dispatch handler */
|
/* Dispatch handler */
|
||||||
ret = vmexit_handler(vcpu);
|
ret = vmexit_handler(vcpu);
|
||||||
basic_exit_reason = vcpu->arch.exit_reason & 0xFFFFU;
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pr_fatal("dispatch VM exit handler failed for reason"
|
pr_fatal("dispatch VM exit handler failed for reason"
|
||||||
" %d, ret = %d!", basic_exit_reason, ret);
|
" %d, ret = %d!", basic_exit_reason, ret);
|
||||||
@ -84,8 +84,6 @@ void vcpu_thread(struct sched_object *obj)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE_2L(TRACE_VM_EXIT, basic_exit_reason, vcpu_get_rip(vcpu));
|
|
||||||
|
|
||||||
profiling_post_vmexit_handler(vcpu);
|
profiling_post_vmexit_handler(vcpu);
|
||||||
} while (1);
|
} while (1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user