[PATCH v5 00/13] Python generated AMD Zen metrics

Ian Rogers posted 13 patches 1 month ago
There is a newer version of this series
tools/perf/pmu-events/amd_metrics.py | 654 ++++++++++++++++++++++++++-
1 file changed, 651 insertions(+), 3 deletions(-)
[PATCH v5 00/13] Python generated AMD Zen metrics
Posted by Ian Rogers 1 month ago
Generate thirteen sets of additional metrics for AMD zen.  Rapl and
Idle metrics aren't specific to AMD but are placed here for ease and
convenience. Uncore L3 metrics are added along with the majority of
core metrics.

The patches should be applied on top of:
https://lore.kernel.org/lkml/20250829030727.4159703-1-irogers@google.com/

v5. Rebase. Add uop cache hit/miss rates patch. Prefix all metric
    names with lpm_ (short for Linux Perf Metric) so that python
    generated metrics are clearly namespaced.

v4. Rebase.
    https://lore.kernel.org/lkml/20240926174101.406874-1-irogers@google.com/

v3. Some minor code cleanup changes.
    https://lore.kernel.org/lkml/20240314055839.1975063-1-irogers@google.com/

v2. Drop the cycles breakdown in favor of having it as a common
    metric, suggested by Kan Liang <kan.liang@linux.intel.com>.
    https://lore.kernel.org/lkml/20240301184737.2660108-1-irogers@google.com/

v1. https://lore.kernel.org/lkml/20240229001537.4158049-1-irogers@google.com/

Ian Rogers (13):
  perf jevents: Add RAPL event metric for AMD zen models
  perf jevents: Add idle metric for AMD zen models
  perf jevents: Add upc metric for uops per cycle for AMD
  perf jevents: Add br metric group for branch statistics on AMD
  perf jevents: Add software prefetch (swpf) metric group for AMD
  perf jevents: Add hardware prefetch (hwpf) metric group for AMD
  perf jevents: Add itlb metric group for AMD
  perf jevents: Add dtlb metric group for AMD
  perf jevents: Add uncore l3 metric group for AMD
  perf jevents: Add load store breakdown metrics ldst for AMD
  perf jevents: Add ILP metrics for AMD
  perf jevents: Add context switch metrics for AMD
  perf jevents: Add uop cache hit/miss rates for AMD

 tools/perf/pmu-events/amd_metrics.py | 654 ++++++++++++++++++++++++++-
 1 file changed, 651 insertions(+), 3 deletions(-)

-- 
2.51.0.318.gd7df087d1a-goog
Re: [PATCH v5 00/13] Python generated AMD Zen metrics
Posted by Sandipan Das 4 weeks, 1 day ago
On 8/29/2025 9:01 AM, Ian Rogers wrote:
> Generate thirteen sets of additional metrics for AMD zen.  Rapl and
> Idle metrics aren't specific to AMD but are placed here for ease and
> convenience. Uncore L3 metrics are added along with the majority of
> core metrics.
> 
> The patches should be applied on top of:
> https://lore.kernel.org/lkml/20250829030727.4159703-1-irogers@google.com/
> 
> v5. Rebase. Add uop cache hit/miss rates patch. Prefix all metric
>     names with lpm_ (short for Linux Perf Metric) so that python
>     generated metrics are clearly namespaced.
> 
> v4. Rebase.
>     https://lore.kernel.org/lkml/20240926174101.406874-1-irogers@google.com/
> 
> v3. Some minor code cleanup changes.
>     https://lore.kernel.org/lkml/20240314055839.1975063-1-irogers@google.com/
> 
> v2. Drop the cycles breakdown in favor of having it as a common
>     metric, suggested by Kan Liang <kan.liang@linux.intel.com>.
>     https://lore.kernel.org/lkml/20240301184737.2660108-1-irogers@google.com/
> 
> v1. https://lore.kernel.org/lkml/20240229001537.4158049-1-irogers@google.com/
> 
> Ian Rogers (13):
>   perf jevents: Add RAPL event metric for AMD zen models
>   perf jevents: Add idle metric for AMD zen models
>   perf jevents: Add upc metric for uops per cycle for AMD
>   perf jevents: Add br metric group for branch statistics on AMD
>   perf jevents: Add software prefetch (swpf) metric group for AMD
>   perf jevents: Add hardware prefetch (hwpf) metric group for AMD
>   perf jevents: Add itlb metric group for AMD
>   perf jevents: Add dtlb metric group for AMD
>   perf jevents: Add uncore l3 metric group for AMD
>   perf jevents: Add load store breakdown metrics ldst for AMD
>   perf jevents: Add ILP metrics for AMD
>   perf jevents: Add context switch metrics for AMD
>   perf jevents: Add uop cache hit/miss rates for AMD
> 
>  tools/perf/pmu-events/amd_metrics.py | 654 ++++++++++++++++++++++++++-
>  1 file changed, 651 insertions(+), 3 deletions(-)
> 

For clean builds, I am seeing some warnings for the "context-switches" and
"energy-pkg" events.

...
/home/sandipan/linux/tools/perf/pmu-events/amd_metrics.py:124: SyntaxWarning: invalid escape sequence '\-'
  cs = Event("context\-switches")
...
/home/sandipan/linux/tools/perf/pmu-events/amd_metrics.py:615: SyntaxWarning: invalid escape sequence '\-'
  pkg = Event("power/energy\-pkg/")
...
Re: [PATCH v5 00/13] Python generated AMD Zen metrics
Posted by Ian Rogers 4 weeks, 1 day ago
On Wed, Sep 3, 2025 at 7:26 AM Sandipan Das <sandidas@amd.com> wrote:
>
> On 8/29/2025 9:01 AM, Ian Rogers wrote:
> > Generate thirteen sets of additional metrics for AMD zen.  Rapl and
> > Idle metrics aren't specific to AMD but are placed here for ease and
> > convenience. Uncore L3 metrics are added along with the majority of
> > core metrics.
> >
> > The patches should be applied on top of:
> > https://lore.kernel.org/lkml/20250829030727.4159703-1-irogers@google.com/
> >
> > v5. Rebase. Add uop cache hit/miss rates patch. Prefix all metric
> >     names with lpm_ (short for Linux Perf Metric) so that python
> >     generated metrics are clearly namespaced.
> >
> > v4. Rebase.
> >     https://lore.kernel.org/lkml/20240926174101.406874-1-irogers@google.com/
> >
> > v3. Some minor code cleanup changes.
> >     https://lore.kernel.org/lkml/20240314055839.1975063-1-irogers@google.com/
> >
> > v2. Drop the cycles breakdown in favor of having it as a common
> >     metric, suggested by Kan Liang <kan.liang@linux.intel.com>.
> >     https://lore.kernel.org/lkml/20240301184737.2660108-1-irogers@google.com/
> >
> > v1. https://lore.kernel.org/lkml/20240229001537.4158049-1-irogers@google.com/
> >
> > Ian Rogers (13):
> >   perf jevents: Add RAPL event metric for AMD zen models
> >   perf jevents: Add idle metric for AMD zen models
> >   perf jevents: Add upc metric for uops per cycle for AMD
> >   perf jevents: Add br metric group for branch statistics on AMD
> >   perf jevents: Add software prefetch (swpf) metric group for AMD
> >   perf jevents: Add hardware prefetch (hwpf) metric group for AMD
> >   perf jevents: Add itlb metric group for AMD
> >   perf jevents: Add dtlb metric group for AMD
> >   perf jevents: Add uncore l3 metric group for AMD
> >   perf jevents: Add load store breakdown metrics ldst for AMD
> >   perf jevents: Add ILP metrics for AMD
> >   perf jevents: Add context switch metrics for AMD
> >   perf jevents: Add uop cache hit/miss rates for AMD
> >
> >  tools/perf/pmu-events/amd_metrics.py | 654 ++++++++++++++++++++++++++-
> >  1 file changed, 651 insertions(+), 3 deletions(-)
> >
>
> For clean builds, I am seeing some warnings for the "context-switches" and
> "energy-pkg" events.
>
> ...
> /home/sandipan/linux/tools/perf/pmu-events/amd_metrics.py:124: SyntaxWarning: invalid escape sequence '\-'
>   cs = Event("context\-switches")
> ...
> /home/sandipan/linux/tools/perf/pmu-events/amd_metrics.py:615: SyntaxWarning: invalid escape sequence '\-'
>   pkg = Event("power/energy\-pkg/")
> ...

Thanks Sandipan, I'll fix the warning in v6.

Ian