Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1997785yba; Mon, 15 Apr 2019 02:49:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLquA8iSSOAbPng6qzlPG7USp+ZR28MPfNVggg9euDDP7N+678dxyo0pweLW3Bp+q8dkbU X-Received: by 2002:a17:902:59c5:: with SMTP id d5mr74244833plj.104.1555321777362; Mon, 15 Apr 2019 02:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555321777; cv=none; d=google.com; s=arc-20160816; b=innH92KlhwQ0YuVglQIPFTEkxzjLYET/pLWzMPROyMU5iMaLUjSJdomw9DnV5VPXTB eMcGffZ+TORz19uNIF50Ql5dHTsFCG/iUabXUc3mwvxQCe6GK67JyhSwkp2dtgq1TRuT 2rBvQVRO6Nox30QsAO3oCUf3Gb3DZrVLE1LrCcRQbOFWjSQRRFxnoqFtoWDUikGkUT57 L/jWd0g6PBObmPc5Axb8XyTDx90/FQoXD6zmfmaV6N6+pJh6/BD0ajOi6AtcTLLVSYRI /2mHHFY/HjBsBpFnr2KPJ7C7uMWx+2VYZrc40M2NECfNRyihHjlgOGjnD59Sjij7vKUR ukNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=llFLrQB0nSoB3A+7gjaiaqtDxfL7I7K5AnWY+OeHpDE=; b=NKzzPVp+SoI0C+vO4aH27fQIo25UbpmicCvyiW2S7aMsFX8UoaZXTb9JW6dYR09LWV P7IO8esJqh4NE0P+GbrWUtarLMXAOw8MfulCq/RkzTzlT4cYhaJRru41YxfILPiRALwt qIwaTwJ2ZPGX07JcHlQAw4kWSuxs7naoFL5SQWpzSiJmQRyQ1vxWWPq73dpwvoSlji57 Mxvn8+Bx+GaVuk6x3Ri2YNAg4fT/LJTPQ9oXtUXxx2G0e3pfYSYdRnqbvezF+YEZdHaB V+j+W1Dfm7/CKpLpeOCZh9VY/0vWEHGcd1Q0rk2/cR8SllIu9/w6IqsIbwF0k/29PU/A foLg== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k16si45614705pgb.587.2019.04.15.02.49.21; Mon, 15 Apr 2019 02:49:37 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727120AbfDOJsK (ORCPT + 99 others); Mon, 15 Apr 2019 05:48:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44844 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725798AbfDOJsK (ORCPT ); Mon, 15 Apr 2019 05:48:10 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 52D01C05E76E; Mon, 15 Apr 2019 09:48:10 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with SMTP id 0ABF460FCD; Mon, 15 Apr 2019 09:48:06 +0000 (UTC) Date: Mon, 15 Apr 2019 11:48:06 +0200 From: Jiri Olsa To: Bandan Das Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] perf/x86: descriptive failure messages for PMU init Message-ID: <20190415094806.GE13124@krava> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 15 Apr 2019 09:48:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 12, 2019 at 03:09:17PM -0400, Bandan Das wrote: SNIP > msr_fail: > - if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) { > + if (virt) > pr_cont("PMU not available due to virtualization, using software events only.\n"); > - } else { > - pr_cont("Broken PMU hardware detected, using software events only.\n"); > - pr_err("Failed to access perfctr msr (MSR %x is %Lx)\n", > - reg, val_new); > + switch (status) { > + case READ_FAIL: > + if (virt) > + pr_debug("Failed to read perfctr msr (MSR %x)\n", reg); > + else > + pr_err("Failed to read perfctr msr (MSR %x)\n", reg); > + break; > + case WRITE_FAIL: > + if (virt) > + pr_debug("Failed to write perfctr msr (MSR %x, wrote: %llx, read: %llx)\n", > + reg, val, val_new); > + else > + pr_err("Failed to write perfctr msr (MSR %x, wrote: %llx, read: %llx)\n", > + reg, val, val_new); > + break; > + case PMU_FAIL: > + /* fall through for default message */ > + default: > + if (virt) > + pr_debug("Broken PMU hardware detected, using software events only.\n"); > + else > + pr_cont("Broken PMU hardware detected, using software events only.\n"); hum, why can't we have just one pr_err for both virt and bare metal? jirka > } > > return false; > -- > 2.19.2 >