• David S. Miller's avatar
    sparc: Fix single-pcr perf event counter management. · 4c04e74c
    David S. Miller authored
    [ Upstream commit cfdc3170d214046b9509183fe9b9544dc644d40b ]
    
    It is important to clear the hw->state value for non-stopped events
    when they are added into the PMU.  Otherwise when the event is
    scheduled out, we won't read the counter because HES_UPTODATE is still
    set.  This breaks 'perf stat' and similar use cases, causing all the
    events to show zero.
    
    This worked for multi-pcr because we make explicit sparc_pmu_start()
    calls in calculate_multiple_pcrs().  calculate_single_pcr() doesn't do
    this because the idea there is to accumulate all of the counter
    settings into the single pcr value.  So we have to add explicit
    hw->state handling there.
    
    Like x86, we use the PERF_HES_ARCH bit to track truly stopped events
    so that we don't accidently start them on a reload.
    
    Related to all of this, sparc_pmu_start() is missing a userpage update
    so add it.
    Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    4c04e74c
Name
Last commit
Last update
..
.gitignore Loading commit data...
Makefile Loading commit data...
apc.c Loading commit data...
asm-offsets.c Loading commit data...
audit.c Loading commit data...
auxio_32.c Loading commit data...
auxio_64.c Loading commit data...
btext.c Loading commit data...
central.c Loading commit data...
cherrs.S Loading commit data...
chmc.c Loading commit data...
compat_audit.c Loading commit data...
cpu.c Loading commit data...
cpumap.c Loading commit data...
cpumap.h Loading commit data...
devices.c Loading commit data...
dma.c Loading commit data...
ds.c Loading commit data...
dtlb_miss.S Loading commit data...
dtlb_prot.S Loading commit data...
ebus.c Loading commit data...
entry.S Loading commit data...
entry.h Loading commit data...
etrap_32.S Loading commit data...
etrap_64.S Loading commit data...
fpu_traps.S Loading commit data...
ftrace.c Loading commit data...
getsetcc.S Loading commit data...
head_32.S Loading commit data...
head_64.S Loading commit data...
helpers.S Loading commit data...
hvapi.c Loading commit data...
hvcalls.S Loading commit data...
hvtramp.S Loading commit data...
idprom.c Loading commit data...
iommu.c Loading commit data...
iommu_common.h Loading commit data...
ioport.c Loading commit data...
irq.h Loading commit data...
irq_32.c Loading commit data...
irq_64.c Loading commit data...
itlb_miss.S Loading commit data...
ivec.S Loading commit data...
jump_label.c Loading commit data...
kernel.h Loading commit data...
kgdb_32.c Loading commit data...
kgdb_64.c Loading commit data...
kprobes.c Loading commit data...
kstack.h Loading commit data...
ktlb.S Loading commit data...
ldc.c Loading commit data...
led.c Loading commit data...
leon_kernel.c Loading commit data...
leon_pci.c Loading commit data...
leon_pci_grpci1.c Loading commit data...
leon_pci_grpci2.c Loading commit data...
leon_pmc.c Loading commit data...
leon_smp.c Loading commit data...
mdesc.c Loading commit data...
misctrap.S Loading commit data...
module.c Loading commit data...
nmi.c Loading commit data...
of_device_32.c Loading commit data...
of_device_64.c Loading commit data...
of_device_common.c Loading commit data...
of_device_common.h Loading commit data...
pci.c Loading commit data...
pci_common.c Loading commit data...
pci_fire.c Loading commit data...
pci_impl.h Loading commit data...
pci_msi.c Loading commit data...
pci_psycho.c Loading commit data...
pci_sabre.c Loading commit data...
pci_schizo.c Loading commit data...
pci_sun4v.c Loading commit data...
pci_sun4v.h Loading commit data...
pci_sun4v_asm.S Loading commit data...
pcic.c Loading commit data...
pcr.c Loading commit data...
perf_event.c Loading commit data...
pmc.c Loading commit data...
power.c Loading commit data...
process_32.c Loading commit data...
process_64.c Loading commit data...
prom.h Loading commit data...
prom_32.c Loading commit data...
prom_64.c Loading commit data...
prom_common.c Loading commit data...
prom_irqtrans.c Loading commit data...
psycho_common.c Loading commit data...
psycho_common.h Loading commit data...
ptrace_32.c Loading commit data...
ptrace_64.c Loading commit data...
reboot.c Loading commit data...
rtrap_32.S Loading commit data...
rtrap_64.S Loading commit data...
sbus.c Loading commit data...
setup_32.c Loading commit data...
setup_64.c Loading commit data...
signal32.c Loading commit data...
signal_32.c Loading commit data...
signal_64.c Loading commit data...
sigutil.h Loading commit data...
sigutil_32.c Loading commit data...
sigutil_64.c Loading commit data...
smp_32.c Loading commit data...
smp_64.c Loading commit data...
sparc_ksyms.c Loading commit data...
spiterrs.S Loading commit data...
sstate.c Loading commit data...
stacktrace.c Loading commit data...
starfire.c Loading commit data...
sun4d_irq.c Loading commit data...
sun4d_smp.c Loading commit data...
sun4m_irq.c Loading commit data...
sun4m_smp.c Loading commit data...
sun4v_ivec.S Loading commit data...
sun4v_tlb_miss.S Loading commit data...
sys32.S Loading commit data...
sys_sparc32.c Loading commit data...
sys_sparc_32.c Loading commit data...
sys_sparc_64.c Loading commit data...
syscalls.S Loading commit data...
sysfs.c Loading commit data...
systbls.h Loading commit data...
systbls_32.S Loading commit data...
systbls_64.S Loading commit data...
time_32.c Loading commit data...
time_64.c Loading commit data...
trampoline_32.S Loading commit data...
trampoline_64.S Loading commit data...
traps_32.c Loading commit data...
traps_64.c Loading commit data...
tsb.S Loading commit data...
ttable_32.S Loading commit data...
ttable_64.S Loading commit data...
una_asm_32.S Loading commit data...
una_asm_64.S Loading commit data...
unaligned_32.c Loading commit data...
unaligned_64.c Loading commit data...
urtt_fill.S Loading commit data...
utrap.S Loading commit data...
vio.c Loading commit data...
viohs.c Loading commit data...
visemul.c Loading commit data...
vmlinux.lds.S Loading commit data...
windows.c Loading commit data...
winfixup.S Loading commit data...
wof.S Loading commit data...
wuf.S Loading commit data...