diff mbox series

[1/3] KVM: X86: Trace vcpu_id for vmexit

Message ID 20190729053243.9224-2-peterx@redhat.com (mailing list archive)
State New, archived
Headers show
Series KVM: X86: Some tracepoint enhancements | expand

Commit Message

Peter Xu July 29, 2019, 5:32 a.m. UTC
It helps to pair vmenters and vmexis with multi-core systems.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 arch/x86/kvm/trace.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Sean Christopherson July 29, 2019, 4:28 p.m. UTC | #1
On Mon, Jul 29, 2019 at 01:32:41PM +0800, Peter Xu wrote:
> It helps to pair vmenters and vmexis with multi-core systems.

Typo "vmexis".  The wording is also a bit funky.  How about:

Tracing the ID helps to pair vmenters and vmexits for guests with
multiple vCPUs.

> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  arch/x86/kvm/trace.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
> index 4d47a2631d1f..26423d2e45df 100644
> --- a/arch/x86/kvm/trace.h
> +++ b/arch/x86/kvm/trace.h
> @@ -232,17 +232,20 @@ TRACE_EVENT(kvm_exit,
>  		__field(	u32,	        isa             )
>  		__field(	u64,	        info1           )
>  		__field(	u64,	        info2           )
> +		__field(	int,	        vcpu_id         )
>  	),
>  
>  	TP_fast_assign(
>  		__entry->exit_reason	= exit_reason;
>  		__entry->guest_rip	= kvm_rip_read(vcpu);
>  		__entry->isa            = isa;
> +		__entry->vcpu_id        = vcpu->vcpu_id;
>  		kvm_x86_ops->get_exit_info(vcpu, &__entry->info1,
>  					   &__entry->info2);
>  	),
>  
> -	TP_printk("reason %s rip 0x%lx info %llx %llx",
> +	TP_printk("vcpu %d reason %s rip 0x%lx info %llx %llx",
> +		  __entry->vcpu_id,
>  		 (__entry->isa == KVM_ISA_VMX) ?
>  		 __print_symbolic(__entry->exit_reason, VMX_EXIT_REASONS) :
>  		 __print_symbolic(__entry->exit_reason, SVM_EXIT_REASONS),
> -- 
> 2.21.0
>
Peter Xu July 30, 2019, 1:49 a.m. UTC | #2
On Mon, Jul 29, 2019 at 09:28:15AM -0700, Sean Christopherson wrote:
> On Mon, Jul 29, 2019 at 01:32:41PM +0800, Peter Xu wrote:
> > It helps to pair vmenters and vmexis with multi-core systems.
> 
> Typo "vmexis".  The wording is also a bit funky.  How about:
> 
> Tracing the ID helps to pair vmenters and vmexits for guests with
> multiple vCPUs.

Sure thing.  Thanks,
Krish Sadhukhan July 31, 2019, 9:49 p.m. UTC | #3
On 07/28/2019 10:32 PM, Peter Xu wrote:
> It helps to pair vmenters and vmexis with multi-core systems.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>   arch/x86/kvm/trace.h | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
> index 4d47a2631d1f..26423d2e45df 100644
> --- a/arch/x86/kvm/trace.h
> +++ b/arch/x86/kvm/trace.h
> @@ -232,17 +232,20 @@ TRACE_EVENT(kvm_exit,
>   		__field(	u32,	        isa             )
>   		__field(	u64,	        info1           )
>   		__field(	u64,	        info2           )
> +		__field(	int,	        vcpu_id         )
>   	),
>   
>   	TP_fast_assign(
>   		__entry->exit_reason	= exit_reason;
>   		__entry->guest_rip	= kvm_rip_read(vcpu);
>   		__entry->isa            = isa;
> +		__entry->vcpu_id        = vcpu->vcpu_id;
>   		kvm_x86_ops->get_exit_info(vcpu, &__entry->info1,
>   					   &__entry->info2);
>   	),
>   
> -	TP_printk("reason %s rip 0x%lx info %llx %llx",
> +	TP_printk("vcpu %d reason %s rip 0x%lx info %llx %llx",
> +		  __entry->vcpu_id,
>   		 (__entry->isa == KVM_ISA_VMX) ?
>   		 __print_symbolic(__entry->exit_reason, VMX_EXIT_REASONS) :
>   		 __print_symbolic(__entry->exit_reason, SVM_EXIT_REASONS),

Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
diff mbox series

Patch

diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index 4d47a2631d1f..26423d2e45df 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -232,17 +232,20 @@  TRACE_EVENT(kvm_exit,
 		__field(	u32,	        isa             )
 		__field(	u64,	        info1           )
 		__field(	u64,	        info2           )
+		__field(	int,	        vcpu_id         )
 	),
 
 	TP_fast_assign(
 		__entry->exit_reason	= exit_reason;
 		__entry->guest_rip	= kvm_rip_read(vcpu);
 		__entry->isa            = isa;
+		__entry->vcpu_id        = vcpu->vcpu_id;
 		kvm_x86_ops->get_exit_info(vcpu, &__entry->info1,
 					   &__entry->info2);
 	),
 
-	TP_printk("reason %s rip 0x%lx info %llx %llx",
+	TP_printk("vcpu %d reason %s rip 0x%lx info %llx %llx",
+		  __entry->vcpu_id,
 		 (__entry->isa == KVM_ISA_VMX) ?
 		 __print_symbolic(__entry->exit_reason, VMX_EXIT_REASONS) :
 		 __print_symbolic(__entry->exit_reason, SVM_EXIT_REASONS),