lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 29 Feb 2024 16:54:07 -0800
From: Ian Rogers <irogers@...gle.com>
To: "Liang, Kan" <kan.liang@...ux.intel.com>
Cc: Perry Taylor <perry.taylor@...el.com>, Samantha Alt <samantha.alt@...el.com>, 
	Caleb Biggers <caleb.biggers@...el.com>, Weilin Wang <weilin.wang@...el.com>, 
	Edward Baker <edward.baker@...el.com>, Andi Kleen <ak@...ux.intel.com>, 
	Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, 
	Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>, 
	Mark Rutland <mark.rutland@....com>, 
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, 
	Adrian Hunter <adrian.hunter@...el.com>, John Garry <john.g.garry@...cle.com>, 
	Jing Zhang <renyu.zj@...ux.alibaba.com>, Thomas Richter <tmricht@...ux.ibm.com>, 
	James Clark <james.clark@....com>, linux-kernel@...r.kernel.org, 
	linux-perf-users@...r.kernel.org, Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v1 03/20] perf jevents: Add smi metric group for Intel models

On Thu, Feb 29, 2024 at 1:09 PM Liang, Kan <kan.liang@...ux.intel.com> wrote:
>
>
>
> On 2024-02-28 7:17 p.m., Ian Rogers wrote:
> > Allow duplicated metric to be dropped from json files.
> >
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > ---
> >  tools/perf/pmu-events/intel_metrics.py | 18 +++++++++++++++++-
> >  1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/pmu-events/intel_metrics.py b/tools/perf/pmu-events/intel_metrics.py
> > index 46866a25b166..20c25d142f24 100755
> > --- a/tools/perf/pmu-events/intel_metrics.py
> > +++ b/tools/perf/pmu-events/intel_metrics.py
> > @@ -2,7 +2,7 @@
> >  # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
> >  from metric import (d_ratio, has_event, max, Event, JsonEncodeMetric,
> >                      JsonEncodeMetricGroupDescriptions, LoadEvents, Metric,
> > -                    MetricGroup, Select)
> > +                    MetricGroup, MetricRef, Select)
> >  import argparse
> >  import json
> >  import math
> > @@ -62,9 +62,25 @@ def Rapl() -> MetricGroup:
> >                       description="Processor socket power consumption estimates")
> >
> >
> > +def Smi() -> MetricGroup:
> > +    aperf = Event('msr/aperf/')
>
> There are CPUID enumeration for the aperf and mperf. I believe they
> should be always available for a newer bare metal. But they may not be
> enumerated in an virtualization env. Should we add a has_event() check
> before using it?

It would make sense to have the has_event so that the metric doesn't
fail in perf test. I'll add it.

Thanks,
Ian

> Thanks,
> Kan
>
> > +    cycles = Event('cycles')
> > +    smi_num = Event('msr/smi/')
> > +    smi_cycles = Select((aperf - cycles) / aperf, smi_num > 0, 0)
> > +    return MetricGroup('smi', [
> > +        Metric('smi_num', 'Number of SMI interrupts.',
> > +               smi_num, 'SMI#'),
> > +        # Note, the smi_cycles "Event" is really a reference to the metric.
> > +        Metric('smi_cycles',
> > +               'Percentage of cycles spent in System Management Interrupts.',
> > +               smi_cycles, '100%', threshold=(MetricRef('smi_cycles') > 0.10))
> > +    ])
> > +
> > +
> >  all_metrics = MetricGroup("", [
> >      Idle(),
> >      Rapl(),
> > +    Smi(),
> >  ])
> >
> >  if args.metricgroups:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ