Skip to content

Commit 0e77b32

Browse files
Maxim Levitskysean-jc
authored andcommitted
KVM: x86: Add information about pending requests to kvm_exit tracepoint
Print pending requests in the kvm_exit tracepoint, which allows userspace to gather information on how often KVM interrupts vCPUs due to specific requests. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Link: https://lore.kernel.org/r/20240910200350.264245-3-mlevitsk@redhat.com [sean: massage changelog] Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 3e633e7 commit 0e77b32

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arch/x86/kvm/trace.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,14 @@ TRACE_EVENT(name, \
315315
__field( u32, intr_info ) \
316316
__field( u32, error_code ) \
317317
__field( unsigned int, vcpu_id ) \
318+
__field( u64, requests ) \
318319
), \
319320
\
320321
TP_fast_assign( \
321322
__entry->guest_rip = kvm_rip_read(vcpu); \
322323
__entry->isa = isa; \
323324
__entry->vcpu_id = vcpu->vcpu_id; \
325+
__entry->requests = READ_ONCE(vcpu->requests); \
324326
kvm_x86_call(get_exit_info)(vcpu, \
325327
&__entry->exit_reason, \
326328
&__entry->info1, \
@@ -330,11 +332,13 @@ TRACE_EVENT(name, \
330332
), \
331333
\
332334
TP_printk("vcpu %u reason %s%s%s rip 0x%lx info1 0x%016llx " \
333-
"info2 0x%016llx intr_info 0x%08x error_code 0x%08x", \
335+
"info2 0x%016llx intr_info 0x%08x error_code 0x%08x " \
336+
"requests 0x%016llx", \
334337
__entry->vcpu_id, \
335338
kvm_print_exit_reason(__entry->exit_reason, __entry->isa), \
336339
__entry->guest_rip, __entry->info1, __entry->info2, \
337-
__entry->intr_info, __entry->error_code) \
340+
__entry->intr_info, __entry->error_code, \
341+
__entry->requests) \
338342
)
339343

340344
/*

0 commit comments

Comments
 (0)