alistair23-linux/tools
Andi Kleen 44b1e60ab5 perf stat: Basic support for TopDown in perf stat
Add basic plumbing for TopDown in perf stat

TopDown is intended to replace the frontend cycles idle/ backend cycles
idle metrics in standard perf stat output.  These metrics are not
reliable in many workloads, due to out of order effects.

This implements a new --topdown mode in perf stat (similar to
--transaction) that measures the pipe line bottlenecks using
standardized formulas. The measurement can be all done with 5 counters
(one fixed counter)

The result are four metrics:

FrontendBound, BackendBound, BadSpeculation, Retiring

that describe the CPU pipeline behavior on a high level.

The full top down methology has many hierarchical metrics.  This
implementation only supports level 1 which can be collected without
multiplexing. A full implementation of top down on top of perf is
available in pmu-tools toplev.  (http://github.com/andikleen/pmu-tools)

The current version works on Intel Core CPUs starting with Sandy Bridge,
and Atom CPUs starting with Silvermont.  In principle the generic
metrics should be also implementable on other out of order CPUs.

TopDown level 1 uses a set of abstracted metrics which are generic to
out of order CPU cores (although some CPUs may not implement all of
them):

  topdown-total-slots       Available slots in the pipeline
  topdown-slots-issued      Slots issued into the pipeline
  topdown-slots-retired     Slots successfully retired
  topdown-fetch-bubbles     Pipeline gaps in the frontend
  topdown-recovery-bubbles  Pipeline gaps during recovery
                            from misspeculation

These metrics then allow to compute four useful metrics:

FrontendBound, BackendBound, Retiring, BadSpeculation.

Add a new --topdown options to enable events.  When --topdown is
specified set up events for all topdown events supported by the kernel.
Add topdown-* as a special case to the event parser, as is needed for
all events containing -.

The actual code to compute the metrics is in follow-on patches.

v2: Use standard sysctl read function.
v3: Move x86 specific code to arch/
v4: Enable --metric-only implicitly for topdown.
v5: Add --single-thread option to not force per core mode
v6: Fix output order of topdown metrics
v7: Allow combining with -d
v8: Remove --single-thread again
v9: Rename functions, adding arch_ and topdown_.
v10: Expand man page and describe TopDown better
Paste intro into commit description.
Print error when malloc fails.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/1464119559-17203-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-06-06 17:04:15 -03:00
..
arch tools include: Add basic atomic.h implementation from the kernel sources 2015-05-08 16:11:05 -03:00
build perf probe: Check if dwarf_getlocations() is available 2016-05-12 11:26:59 -03:00
cgroup
firewire
gpio gpio: present the consumer of a line to userspace 2016-02-25 21:07:23 +01:00
hv tools/hv: Use include/uapi with __EXPORTED_HEADERS__ 2016-02-07 21:34:12 -08:00
iio iio: generic_buffer: be helpful about enabling channels 2015-08-16 10:51:26 +01:00
include Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-24 10:02:14 -07:00
laptop/freefall Move freefall program from Documentation/ to tools/ 2015-06-08 16:42:07 -06:00
lguest tools/lguest: Force disable tboot and APM 2016-04-22 10:29:03 +02:00
lib tools lib api: Respect CROSS_COMPILE for the linker 2016-06-03 14:53:46 -03:00
net tools: bpf_jit_disasm: check for klogctl failure 2016-05-08 23:32:59 -04:00
nfsd
objtool objtool: Detect falling through to the next function 2016-04-16 11:14:17 +02:00
perf perf stat: Basic support for TopDown in perf stat 2016-06-06 17:04:15 -03:00
power Merge branches 'pm-core', 'powercap' and 'pm-tools' 2016-04-08 21:46:56 +02:00
scripts tools: Move utilities.mak from perf to tools/scripts/ 2016-03-18 13:57:20 -03:00
spi spi: spidev_test: Fix typo in error message 2015-12-08 17:58:56 +00:00
testing Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-05-16 15:15:17 -07:00
thermal/tmon tools/thermal: tmon: use pkg-config also for CFLAGS 2015-10-10 11:32:31 +08:00
time
usb usb: patches for v4.4 merge window 2015-10-22 17:19:33 -07:00
virtio virtio_ring: Support DMA APIs 2016-03-02 17:01:57 +02:00
vm tools/vm/page-types.c: avoid memset() in walk_pfn() when count == 1 2016-03-17 15:09:34 -07:00
Makefile tools build: Fix perf_clean target 2016-04-25 17:59:36 -03:00