]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: x86: Add information about pending requests to kvm_exit tracepoint
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 10 Sep 2024 20:03:49 +0000 (16:03 -0400)
committerSean Christopherson <seanjc@google.com>
Wed, 18 Dec 2024 23:14:49 +0000 (15:14 -0800)
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>
arch/x86/kvm/trace.h

index c2edf4a36faddc9cf05dff530f915bb7f48cfd08..0b844cb97978a5c1d89c0eb3806f6ef70310093e 100644 (file)
@@ -315,12 +315,14 @@ TRACE_EVENT(name,                                                      \
                __field(        u32,            intr_info       )            \
                __field(        u32,            error_code      )            \
                __field(        unsigned int,   vcpu_id         )            \
+               __field(        u64,            requests        )            \
        ),                                                                   \
                                                                             \
        TP_fast_assign(                                                      \
                __entry->guest_rip      = kvm_rip_read(vcpu);                \
                __entry->isa            = isa;                               \
                __entry->vcpu_id        = vcpu->vcpu_id;                     \
+               __entry->requests       = READ_ONCE(vcpu->requests);         \
                kvm_x86_call(get_exit_info)(vcpu,                            \
                                            &__entry->exit_reason,           \
                                            &__entry->info1,                 \
@@ -330,11 +332,13 @@ TRACE_EVENT(name,                                                      \
        ),                                                                   \
                                                                             \
        TP_printk("vcpu %u reason %s%s%s rip 0x%lx info1 0x%016llx "         \
-                 "info2 0x%016llx intr_info 0x%08x error_code 0x%08x",      \
+                 "info2 0x%016llx intr_info 0x%08x error_code 0x%08x "      \
+                 "requests 0x%016llx",                                      \
                  __entry->vcpu_id,                                          \
                  kvm_print_exit_reason(__entry->exit_reason, __entry->isa), \
                  __entry->guest_rip, __entry->info1, __entry->info2,        \
-                 __entry->intr_info, __entry->error_code)                   \
+                 __entry->intr_info, __entry->error_code,                   \
+                 __entry->requests)                                         \
 )
 
 /*