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.
@@ -58,16 +58,17 @@ void vcpu_thread(struct sched_object *obj)
continue;
}
- TRACE_2L(TRACE_VM_ENTER, 0UL, 0UL);
-
profiling_vmenter_handler(vcpu);
+ TRACE_2L(TRACE_VM_ENTER, 0UL, 0UL);
ret = run_vcpu(vcpu);
if (ret != 0) {
pr_fatal("vcpu resume failed");
pause_vcpu(vcpu, VCPU_ZOMBIE);
continue;
}
+ basic_exit_reason = vcpu->arch.exit_reason & 0xFFFFU;
+ TRACE_2L(TRACE_VM_EXIT, basic_exit_reason, vcpu_get_rip(vcpu));
vcpu->arch.nrexits++;
@@ -76,7 +77,6 @@ void vcpu_thread(struct sched_object *obj)
CPU_IRQ_ENABLE();
/* Dispatch handler */
ret = vmexit_handler(vcpu);
- basic_exit_reason = vcpu->arch.exit_reason & 0xFFFFU;
if (ret < 0) {
pr_fatal("dispatch VM exit handler failed for reason"
" %d, ret = %d!", basic_exit_reason, ret);
@@ -84,8 +84,6 @@ void vcpu_thread(struct sched_object *obj)
continue;
}
- TRACE_2L(TRACE_VM_EXIT, basic_exit_reason, vcpu_get_rip(vcpu));
-
profiling_post_vmexit_handler(vcpu);
} while (1);
}
