[RFC] perf: ref-cycle useless with watchdog changes

From: Stephane Eranian
Date: Sun Jul 10 2016 - 14:48:29 EST


Hi,

Since Andi added:

commit 2c95afc1e83d93fac3be6923465e1753c2c53b0a
Author: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Date: Thu Jun 9 06:14:38 2016 -0700

perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86


$ perf stat -e ref-cycles ls
<not counted> ....

fails systematically because the ref-cycles is now used by the
watchdog and given this is a system-wide pinned event, it monopolizes
the fixed counter 2 which is the
only counter able to measure this event.

So we either redirect ref-cycles towards 0x013c
(cpu_clk_unhalted:xlck) or another event maybe from the msr PMU, such
as msr/tsc/ or we revert Andi's patch. Each of these solutions has
problems:

- 0x013c is that is counts supposedly at a fixed frequency (used to
be 100Mhz)
but this is not guaranteed and user would still need to figure
out ref frequency
of CPU to compare with core cycles

- msr/tsc/ counts in halted state. Recent paranoid default changes, make it not
supported by default. msr/tsc/ counts user/kernel, with paranoid=2,
it does not
work

- Revert Andi's patch, makes everything working again at the cost of
multiplexing
for topdown.


It is not clear to me why topdown would be so sensitive to
multiplexing compared to other metrics.

Any comment?
Thanks