lkml.org 
[lkml]   [2019]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf/x86: descriptive failure messages for PMU init
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
>

\
 
 \ /
  Last update: 2019-04-15 11:48    [W:0.039 / U:1.500 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site