From: Jiri Olsa <jolsa@redhat.com>
To: Bandan Das <bsd@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH] perf/x86: descriptive failure messages for PMU init
Date: Mon, 15 Apr 2019 11:48:06 +0200 [thread overview]
Message-ID: <20190415094806.GE13124@krava> (raw)
In-Reply-To: <jpg5zrjavmq.fsf@linux.bootlegged.copy>
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
>
next prev parent reply other threads:[~2019-04-15 9:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 19:09 [PATCH] perf/x86: descriptive failure messages for PMU init Bandan Das
2019-04-15 9:48 ` Jiri Olsa [this message]
2019-04-15 12:04 ` Peter Zijlstra
2019-04-15 12:42 ` Bandan Das
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190415094806.GE13124@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=bsd@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).