Date: Tue, 6 Mar 2012 17:17:03 +0000 (UTC) From: "George V. Neville-Neil" <gnn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r232612 - head/sys/dev/hwpmc Message-ID: <201203061717.q26HH3SK049797@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gnn Date: Tue Mar 6 17:17:03 2012 New Revision: 232612 URL: http://svn.freebsd.org/changeset/base/232612 Log: Properly mask off bits that are not supported in the IAP counters. This fixes a bug where users would see massively large counts, near to 2**64 -1, due to the bits not being cleared. MFC after: 3 weeks Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 6 15:05:59 2012 (r232611) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 6 17:17:03 2012 (r232612) @@ -2021,7 +2021,7 @@ iap_read_pmc(int cpu, int ri, pmc_value_ if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) *v = iap_perfctr_value_to_reload_count(tmp); else - *v = tmp; + *v = tmp & ((1ULL << core_iap_width) - 1); PMCDBG(MDP,REA,1, "iap-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri, ri, *v);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203061717.q26HH3SK049797>