Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1823693ybi; Wed, 17 Jul 2019 22:39:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnJgFPz4XL0iEF1mhTxMI7uTjEhfHMSYkk6zv9xOpVPnr5EAUKLB4YsGJMx7yW4VxtYPMJ X-Received: by 2002:a17:902:9a82:: with SMTP id w2mr47516501plp.291.1563428387322; Wed, 17 Jul 2019 22:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563428387; cv=none; d=google.com; s=arc-20160816; b=gK5ty/QXi0XQ4BK1rurjRzwk50gy0HtqmdU0FbK9Zw1+LEG5AZSL1tas6gcUihFHOG i3/kpF6VQLoYUmDQ6wpoh5FqZZWE+dfpYxWMI9l/mimy5i1r4sry/5ZfGs0DeygtnbS9 o1/ZkhaUxLQVer9EM/MN5+1ZYgD5pnkOb8vSMpatR9SC0sxs4tfw80MvtllGxjrxZG5B LondIOf24dDtYkMwJl4qHdCP7Lw67FqzVID4uQ3REchhRsEhyvXvSV3kkybMegrH3mf1 pXuNuo8lcQN+jFJxBBxkG+EbVGSCLKMerc7ogHUiU63mtCUx5s1dCJ3ZYrVyXq/G9ovP WyeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vxH3wm/HH9SxgzQWb18Lr4fzYUcEWWQly/6cpYoNMg4=; b=Z6VM/nDZmhET7JOQRUz66YzxQgPdmKuA5DuV8kHekNWPpk/3Owt4yXIZnZRop+ntkh QmpcSCBq6GNISRa/afnK2MNcCxgcBGVewBR8Zhg0PPBWApr2L/RlGBc0o099x4KTc1JZ SGqDLfPIqfZXhjhv8Vnes9i53aN4bX6+iXUf78qM3TZK1SB0fSk17czv7M6JUZQczRuU 8x1Beg0KWZuY3gy+f/PDdpm+dpjXAWKcgp+4OV0xo7Rt7uvt98sZ8KfqOqAqQu9cj5hp 4AH4B7cnM8tNtscIx3hyAi8svQ8Dhfo+uLFZ5alQd3pg+q7IkYol59ACtxfv1UxuokCD gXjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si1003457pgm.406.2019.07.17.22.39.28; Wed, 17 Jul 2019 22:39:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729855AbfGRFiX (ORCPT + 99 others); Thu, 18 Jul 2019 01:38:23 -0400 Received: from mga05.intel.com ([192.55.52.43]:40469 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbfGRFiW (ORCPT ); Thu, 18 Jul 2019 01:38:22 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 22:38:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,276,1559545200"; d="scan'208";a="161969852" Received: from likexu-e5-2699-v4.sh.intel.com ([10.239.48.159]) by orsmga008.jf.intel.com with ESMTP; 17 Jul 2019 22:38:20 -0700 From: Like Xu To: Paolo Bonzini , Avi Kivity Cc: Joe Perches , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, like.xu@linux.intel.com Subject: [PATCH v2] KVM: x86/vPMU: refine kvm_pmu err msg when event creation failed Date: Thu, 18 Jul 2019 13:35:14 +0800 Message-Id: <20190718053514.59742-1-like.xu@linux.intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a perf_event creation fails due to any reason of the host perf subsystem, it has no chance to log the corresponding event for guest which may cause abnormal sampling data in guest result. In debug mode, this message helps to understand the state of vPMC and we may not limit the number of occurrences but not in a spamming style. Suggested-by: Joe Perches Signed-off-by: Like Xu --- arch/x86/kvm/pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index aa5a2597305a..cedaa01ceb6f 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -131,8 +131,8 @@ static void pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type, intr ? kvm_perf_overflow_intr : kvm_perf_overflow, pmc); if (IS_ERR(event)) { - printk_once("kvm_pmu: event creation failed %ld\n", - PTR_ERR(event)); + pr_debug_ratelimited("kvm_pmu: event creation failed %ld for pmc->idx = %d\n", + PTR_ERR(event), pmc->idx); return; } -- 2.21.0