Skip to content

perf: Fix uncore metric issue

Jin Yao lkml 1 version Applied

Status from this message: The following commit has been merged into the perf/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4perf util: Change convert_scale from static to globaltools/perf/util/pmu.c tools/perf/util/pmu.h+5 -30 replies
2/4perf vendor events intel: Update cascadelakex uncore events to v1.04tools/perf/pmu-events/arch/x86/cascadelakex/uncore-memory.json tools/perf/pmu-events/arch/x86/cascadelakex/uncore-other.json+1971 -292 replies
3/4perf util: Scale the metric resulttools/perf/util/metricgroup.c tools/perf/util/metricgroup.h tools/perf/util/stat-shadow.c+31 -110 replies
4/4perf util: Support multiple events for metricgrouptools/perf/util/evsel.h tools/perf/util/metricgroup.c tools/perf/util/stat-shadow.c+68 -440 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/4] perf: Fix uncore metric issue

Some uncore metrics don't work as expected. For example, on cascadelakex,

root@lkp-csl-2sp2:~# perf stat -M UNC_M_PMM_BANDWIDTH.TOTAL -a -- sleep 1

Performance counter stats for 'system wide':

           1841092      unc_m_pmm_rpq_inserts
           3680816      unc_m_pmm_wpq_inserts

       1.001775055 seconds time elapsed
root@lkp-csl-2sp2:~# perf stat -M UNC_M_PMM_READ_LATENCY -a -- sleep 1

Performance counter stats for 'system wide':

         860649746      unc_m_pmm_rpq_occupancy.all
           1840557      unc_m_pmm_rpq_inserts
       12790627455      unc_m_clockticks
       1.001773348 seconds time elapsed

No metrics 'UNC_M_PMM_BANDWIDTH.TOTAL' or 'UNC_M_PMM_READ_LATENCY' are reported.

The issue is, the case of an alias expanding to mulitple events is not supported, typically the uncore events.
(see comments in find_evsel_group()). For detail, please check the description in patch 'perf util: Support multiple events for metricgroup'.

With this patch set,

root@lkp-csl-2sp2:~# perf stat -M UNC_M_PMM_BANDWIDTH.TOTAL -a -- sleep 1

Performance counter stats for 'system wide':

           1842108      unc_m_pmm_rpq_inserts     #    337.2 MB/sec  UNC_M_PMM_BANDWIDTH.TOTAL
           3682209      unc_m_pmm_wpq_inserts

       1.001819706 seconds time elapsed
root@lkp-csl-2sp2:~# perf stat -M UNC_M_PMM_READ_LATENCY -a -- sleep 1

Performance counter stats for 'system wide':

         861970685      unc_m_pmm_rpq_occupancy.all #    219.4 ns  UNC_M_PMM_READ_LATENCY
           1842772      unc_m_pmm_rpq_inserts
       12790196356      unc_m_clockticks
       1.001749103 seconds time elapsed

Now we can see the correct metrics 'UNC_M_PMM_BANDWIDTH.TOTAL' and 'UNC_M_PMM_READ_LATENCY'.

Haiyan Song (1):
perf vendor events intel: Update cascadelakex uncore events to v1.04

Jin Yao (3):
perf util: Change convert_scale from static to global perf util: Scale the metric result
perf util: Support multiple events for metricgroup

 .../arch/x86/cascadelakex/uncore-memory.json  |  191 ++
 .../arch/x86/cascadelakex/uncore-other.json   | 1809 ++++++++++++++++-
 tools/perf/util/evsel.h                       |    1 +
 tools/perf/util/metricgroup.c                 |   87 +-
 tools/perf/util/metricgroup.h                 |    1 +
 tools/perf/util/pmu.c                         |    6 +-
 tools/perf/util/pmu.h                         |    2 +
 tools/perf/util/stat-shadow.c                 |   65 +-
 8 files changed, 2075 insertions(+), 87 deletions(-)
Signature · 1 line
2.17.1