Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3128511rdh; Thu, 28 Sep 2023 03:38:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmTQiOUKyKUQHy6D4fOgyIJp2uu+F00NZJyZGT3A8je+wLdff5tNGxJLuWLzH9N2XRV5ay X-Received: by 2002:a17:902:c101:b0:1c3:a1a8:969a with SMTP id 1-20020a170902c10100b001c3a1a8969amr640681pli.8.1695897520782; Thu, 28 Sep 2023 03:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695897520; cv=none; d=google.com; s=arc-20160816; b=h8OsJLRiZDYbrhWLvc0yIpFHrpuMCr/jjdTJqQ+Ivh8o9S+S7KP2S9lmL10X3fBx+g uFJqUEgVyS2dNY9lGQsmk5UGM6JreYWdHtF2N1N12MgNU40T1ed3/dBdx4LdHcdtM9GL jqVXFsJaeksFaF9jUVY146ztmiHXgU82QB0bIGbDH3KVlaAh3aDXoDZccxhFh6a5Np0K RbWbmCb76jvcQA/a7tYHZ1MYHZ7b/1U5fGnPsU78nWbt+k4ZyK4Zd52cxGOVa9B62LzX WkWxj8jmM2soMZGT38o7o/RrtoKmQjBXLMj3O+SiVjjsThmAG8HoI55yJDkUtMxI2gX8 InFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mH5orp7ABtmUs7zOrlSxQ0vVKe4+Un5z4DZRGlQ7qEA=; fh=KbWefN6sg4WxAaYSOFhghLxZ0mosl7xBLFYLk+WwcxA=; b=fi2CndDAshNBEEcb814bAeQrVVmxE+KiqeBCOP8GrlLdntKMGeWo7ZXMipbChwQuHR 8eFcsxLshk+bREwR0X64lxrZgUdicHetboR2HakjBfZEFfwKjUebHpJEJpuQuXRg+tr5 USDd7oRkdix27CNAqOAN4MWyMlaLm/EBwG0Zs4xjufKidOHkMgZvUxocpjvz4nUqgLYp QSbO7z9w7W3QsYD6CYGKwB4AGX4bGysc/q2AcnNkEN8jSsr6Yr7ezkxAktiaXGwklfmm jWUMfiygAlgSCl0WwvvxMFzp+MdQEHESYnyFJgBn1nTk6HkAeIQdv1V5/3JykTSyKQxd gaTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D7HAt4gt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id z1-20020a1709027e8100b001c61bd9db5csi9400213pla.317.2023.09.28.03.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 03:38:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D7HAt4gt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3F32482271A9; Thu, 28 Sep 2023 03:38:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231511AbjI1KiX (ORCPT + 99 others); Thu, 28 Sep 2023 06:38:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231387AbjI1KiV (ORCPT ); Thu, 28 Sep 2023 06:38:21 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76260196 for ; Thu, 28 Sep 2023 03:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695897417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mH5orp7ABtmUs7zOrlSxQ0vVKe4+Un5z4DZRGlQ7qEA=; b=D7HAt4gt4m+YkD07shpcnR50xpYjgOMlJ6WRolQaCZt4+xv5OTy5JJplscWxNcKVddeYsv 7m/e6GWELpLwBA/PgUBQGaqnuf7Yvo6XQpC7o7isMh1KefeZEYCqHkN377JlyAU1SW0T8G fhoViOEFvZggqzLOGme+LHnlvpyKLZw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-592-zBDkmNSLPdSBgyn-12RpDg-1; Thu, 28 Sep 2023 06:36:52 -0400 X-MC-Unique: zBDkmNSLPdSBgyn-12RpDg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 241DF185A797; Thu, 28 Sep 2023 10:36:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.226.141]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFD8C492B16; Thu, 28 Sep 2023 10:36:49 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Thomas Gleixner , "H. Peter Anvin" , Sean Christopherson , Ingo Molnar , Paolo Bonzini , Borislav Petkov , linux-kernel@vger.kernel.org, x86@kernel.org, Dave Hansen , Maxim Levitsky Subject: [PATCH v3 3/4] KVM: x86: add information about pending requests to kvm_exit tracepoint Date: Thu, 28 Sep 2023 13:36:39 +0300 Message-Id: <20230928103640.78453-4-mlevitsk@redhat.com> In-Reply-To: <20230928103640.78453-1-mlevitsk@redhat.com> References: <20230928103640.78453-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 03:38:35 -0700 (PDT) This allows to gather information on how often kvm interrupts vCPUs due to specific requests. Signed-off-by: Maxim Levitsky --- arch/x86/kvm/trace.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index 28e8a63368cc02..e275a02a21e523 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h @@ -316,12 +316,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); \ static_call(kvm_x86_get_exit_info)(vcpu, \ &__entry->exit_reason, \ &__entry->info1, \ @@ -331,11 +333,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) \ ) /* -- 2.26.3