hwpmc: fix fixed counters checks

This commit is contained in:
Matt Macy 2018-06-04 04:49:06 +00:00
parent a9a99372d9
commit 9645bcabdf

View File

@ -251,14 +251,13 @@ iaf_allocate_pmc(int cpu, int ri, struct pmc *pm,
if (ev == 0xC0 && ri != 0)
return (EINVAL);
/* CPU_CLK_UNHALTED.THREAD */
else if (ev == 0x3C && ri != 1)
if (ev == 0x3C && ri != 1)
return (EINVAL);
/* CPU_CLK_UNHALTED.REF */
else if (ev == 0x0 && umask == 0x3 && ri != 2)
return (EINVAL);
else
if (ev == 0x0 && umask == 0x3 && ri != 2)
return (EINVAL);
flags = 0;
if (config & IAP_OS)
flags |= IAF_OS;