[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240301185559.2661241-4-irogers@google.com>
Date: Fri, 1 Mar 2024 10:55:42 -0800
From: Ian Rogers <irogers@...gle.com>
To: 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>, 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>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@....com>, John Garry <john.g.garry@...cle.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Stephane Eranian <eranian@...gle.com>
Subject: [PATCH v2 03/20] perf jevents: Add smi metric group for Intel models
Allow duplicated metric to be dropped from json files.
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
tools/perf/pmu-events/intel_metrics.py | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/tools/perf/pmu-events/intel_metrics.py b/tools/perf/pmu-events/intel_metrics.py
index 2622d4e5ff54..81879e68da96 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,28 @@ def Rapl() -> MetricGroup:
description="Running Average Power Limit (RAPL) power consumption estimates")
+def Smi() -> MetricGroup:
+ aperf = Event('msr/aperf/')
+ cycles = Event('cycles')
+ smi_num = Event('msr/smi/')
+ smi_cycles = Select(Select((aperf - cycles) / aperf, smi_num > 0, 0),
+ has_event(aperf),
+ 0)
+ return MetricGroup('smi', [
+ Metric('smi_num', 'Number of SMI interrupts.',
+ Select(smi_num, has_event(smi_num), 0), 'SMI#'),
+ # Note, the smi_cycles "Event" is really a reference to the metric.
+ Metric('smi_cycles',
+ 'Percentage of cycles spent in System Management Interrupts. '
+ 'Requires /sys/devices/cpu/freeze_on_smi to be 1.',
+ smi_cycles, '100%', threshold=(MetricRef('smi_cycles') > 0.10))
+ ], description = 'System Management Interrupt metrics')
+
+
all_metrics = MetricGroup("", [
Idle(),
Rapl(),
+ Smi(),
])
if args.metricgroups:
--
2.44.0.278.ge034bb2e1d-goog
Powered by blists - more mailing lists