linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] TopDown metrics support for Ice Lake (perf tool)
@ 2020-08-20 16:45 kan.liang
  2020-08-20 16:45 ` [PATCH 1/4] perf tools: Rename group to topdown kan.liang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: kan.liang @ 2020-08-20 16:45 UTC (permalink / raw)
  To: acme, peterz, mingo, jolsa, namhyung, linux-kernel; +Cc: eranian, ak, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

The kernel patches have been merged into the tip's perf/core branch.
The patch set is on top of commit 2cb5383b30d4 ("perf/x86/intel: Support
per-thread RDPMC TopDown metrics") of the tip's perf/core branch.

The changes for the perf tool include:
- Extend --topdown option to support per thread TopDown metrics
- Support sample-read topdown metric group
- Add a complete document for the TopDown usage.

Ice Lake has support for measuring the level 1 TopDown metrics
directly in hardware. This is implemented by an additional METRICS
register, and a new Fixed Counter 3 that measures pipeline SLOTS.

New in Icelake
- Do not require generic counters. This allows to collect TopDown always
  in addition to other events.
- Measuring TopDown per thread/process instead of only per core

For the Ice Lake implementation of performance metrics, the values in
PERF_METRICS MSR are derived from fixed counter 3. Software should start
both registers, PERF_METRICS and fixed counter 3, from zero.
Additionally, software is recommended to periodically clear both
registers in order to maintain accurate measurements. The latter is
required for certain scenarios that involve sampling metrics at high
rates. Software should always write fixed counter 3 before write to
PERF_METRICS.

IA32_PERF_GLOBAL_STATUS. OVF_PERF_METRICS[48]: If this bit is set,
it indicates that some PERF_METRICS-related counter has overflowed and
a PMI is triggered. Software has to synchronize, e.g. re-start,
PERF_METRICS as well as fixed counter 3. Otherwise, PERF_METRICS may
return invalid values.

Limitation
- To get accurate result and avoid reading the METRICS register multiple
  times, the TopDown metrics events and SLOTS event have to be in the
  same group.
- METRICS and SLOTS registers have to be cleared after each read by SW.
  That is to prevent the lose of precision.
- Cannot do sampling read SLOTS and TopDown metric events

Please refer SDM Vol3, 18.3.9.3 Performance Metrics for the details of
TopDown metrics.

Andi Kleen (2):
  perf stat: Support new per thread TopDown metrics
  perf, tools: Add documentation for topdown metrics

Kan Liang (2):
  perf tools: Rename group to topdown
  perf record: Support sample-read topdown metric group

 tools/perf/Documentation/perf-stat.txt |   7 +-
 tools/perf/Documentation/topdown.txt   | 256 +++++++++++++++++++++++++
 tools/perf/arch/x86/util/Build         |   2 +-
 tools/perf/arch/x86/util/group.c       |  28 ---
 tools/perf/arch/x86/util/topdown.c     |  63 ++++++
 tools/perf/builtin-stat.c              |  81 +++-----
 tools/perf/util/Build                  |   1 +
 tools/perf/util/group.h                |   8 -
 tools/perf/util/record.c               |   3 +-
 tools/perf/util/stat-shadow.c          |  89 +++++++++
 tools/perf/util/stat.c                 |   4 +
 tools/perf/util/stat.h                 |   8 +
 tools/perf/util/topdown.c              |  58 ++++++
 tools/perf/util/topdown.h              |  12 ++
 14 files changed, 528 insertions(+), 92 deletions(-)
 create mode 100644 tools/perf/Documentation/topdown.txt
 delete mode 100644 tools/perf/arch/x86/util/group.c
 create mode 100644 tools/perf/arch/x86/util/topdown.c
 delete mode 100644 tools/perf/util/group.h
 create mode 100644 tools/perf/util/topdown.c
 create mode 100644 tools/perf/util/topdown.h

-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-08-27 14:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 16:45 [PATCH 0/4] TopDown metrics support for Ice Lake (perf tool) kan.liang
2020-08-20 16:45 ` [PATCH 1/4] perf tools: Rename group to topdown kan.liang
2020-08-20 16:45 ` [PATCH 2/4] perf record: Support sample-read topdown metric group kan.liang
2020-08-20 16:45 ` [PATCH 3/4] perf stat: Support new per thread TopDown metrics kan.liang
2020-08-20 20:05   ` Andi Kleen
2020-08-20 16:45 ` [PATCH 4/4] perf, tools: Add documentation for topdown metrics kan.liang
2020-08-26 15:54 ` [PATCH 0/4] TopDown metrics support for Ice Lake (perf tool) Jiri Olsa
2020-08-27 12:39   ` Liang, Kan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).