Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1805684ybi; Wed, 17 Jul 2019 22:20:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwM1PjH6yMO3vkDAaOkBkDzBpjS66LWvdMN2wjxOvVkBM5tNTuV6ntXeyFUJqC/1X0yVOi X-Received: by 2002:a17:902:29e6:: with SMTP id h93mr41422839plb.297.1563427207503; Wed, 17 Jul 2019 22:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563427207; cv=none; d=google.com; s=arc-20160816; b=KMh6HWzS+nrVMUpHkT/q912AQg6fq1ltB6RHUJL7yRPUdEgY241+/R0pEejgZI48jW HSSuyz4TpsyH/w2tUwmuM9NPaZ9Upjpt39AhabUXj2KgEo9alQoAPpAtYRc51K0MmBK3 HsmskYEcZMdY8qF5h4KaUij6pmzj7CBZF70FPvHXBCQiYV81e7uV+S8jmtmD5sEpS29d xgwYSu4D91m28NeZARdZVMyNwu2VeJu5KsCoSIgOG9U7ilI56ML2F2vTwNGR/Fm07nod c6xnm7h0QBLdYSQ/GsU7LJTeU+JNVZCTmoEjVCn+Uj16uygQzf7QY8HT7Kg9Txb8BCPq /orw== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=LCJ+LlP0bTh4W440WtDlQqxtOYOboJh7brYucY512oI=; b=deqV/4+hWGn9WNCjY8n3gPiGb2Ye28km6H3OJJI8BbrNHsfSvW38bAPZmyES8bWqVm nRe7Ayxc6hCPsrV5W3KbCH2xudMl2gdSRowrZ78d88c2lzu7r8kJpGIR1MrdyYAn+PI9 8C872CEvG8H95SDSBi1FrNRTKTau5bc0+SRzwck8PFBWhJF81UK8TcPyOTaas7t5NB2j 2179kDcYmVK4/c0M0iGnQFs8Tu7zkeBMqzssUBrHpI3D+YIAU4UwwL+fVe9Blj9KrPqc OJH38MaiqYs/k77pZtQ/QSxwlSR+swMDIZArzycRDkr2nvMHWdK7GdRAoKc1WmbtCUlV 3IHA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15si63555pgy.517.2019.07.17.22.19.50; Wed, 17 Jul 2019 22:20:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726740AbfGRFSv (ORCPT + 99 others); Thu, 18 Jul 2019 01:18:51 -0400 Received: from smtprelay0002.hostedemail.com ([216.40.44.2]:44853 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725959AbfGRFSv (ORCPT ); Thu, 18 Jul 2019 01:18:51 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id C4B22180A68BF; Thu, 18 Jul 2019 05:18:49 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:599:800:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2559:2563:2682:2685:2692:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6117:6119:6120:7901:7903:8531:8985:9025:10004:10400:10848:11026:11232:11658:11854:11914:12043:12296:12297:12438:12555:12740:12760:12895:12986:13069:13095:13311:13357:13439:14181:14659:14721:14777:21080:21212:21433:21627:21819:30034:30045:30054:30090:30091,0,RBL:23.242.196.136:@perches.com:.lbl8.mailshell.net-62.14.0.180 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: power11_12a7847651600 X-Filterd-Recvd-Size: 2231 Received: from XPS-9350 (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA; Thu, 18 Jul 2019 05:18:48 +0000 (UTC) Message-ID: <9eda0e29f524275a217411ea81352271b782baa4.camel@perches.com> Subject: Re: [PATCH] KVM: x86/vPMU: refine kvm_pmu err msg when event creation failed From: Joe Perches To: Like Xu , Paolo Bonzini , Avi Kivity Cc: kvm@vger.kernel.org, Gleb Natapov , like.xu@linux.inetl.com, linux-kernel@vger.kernel.org Date: Wed, 17 Jul 2019 22:18:46 -0700 In-Reply-To: <20190718044914.35631-1-like.xu@linux.intel.com> References: <20190718044914.35631-1-like.xu@linux.intel.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.5-0ubuntu0.18.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-07-18 at 12:49 +0800, Like Xu wrote: > 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 should not > limit the number of occurrences. [] > diff --git 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("kvm_pmu: event creation failed %ld\n for pmc->idx = %d", > + PTR_ERR(event), pmc->idx); Perhaps this was written as printk_once to avoid spamming the log with repeated messages. Maybe this should use pr_debug_ratelimited. (and it should also have a \n termination like:) pr_debug_ratelimited("kvm_pmu: event creation failed %ld for pmc->idx = %d\n", PTR_ERR(event), pmc->idx); Perhaps Avi Kivity remembers why he wrote it this way. https://lore.kernel.org/kvm/1305129333-7456-6-git-send-email-avi@redhat.com/