[Bug 284735] hwpmc: pmcstat on Ampere eMAG has glitches in counts

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 11 Feb 2025 15:25:58 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284735

            Bug ID: 284735
           Summary: hwpmc: pmcstat on Ampere eMAG has glitches in counts
           Product: Base System
           Version: 14.2-STABLE
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: freebsd-arm@FreeBSD.org
          Reporter: jfc@mit.edu

On Ampere eMAG running stable/14, about 10-20% of the time pmcstat -p reports a
count 2^32 greater than the correct count.

$ while true ; do pmcstat -p instructions echo \\c ; done
while true ; do pmcstat -p instructions echo \\c ; done
# p/instructions 
         2207015 
# p/instructions 
         2156016 
# p/instructions 
      4297118204 
# p/instructions 
         2200683 
# p/instructions 

Note that 4297118204 is 2^32 + 2150908.

On CURRENT, Cortex A53 consistently reports about 3,400,000 instructions. 
Cortex A57 consistently reports about 4,150,000 instructions.  I don't know
which count is closer to the truth.  On a RockPro64 pmcstat doesn't really work
because of the heterogenous cores.

I am initially filing this against the arm component on the assumption that it
is CPU-specific code at fault.

-- 
You are receiving this mail because:
You are the assignee for the bug.