summaryrefslogtreecommitdiff
path: root/tools/perf/python
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-01-21 01:06:55 +0300
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-01-21 01:06:55 +0300
commitcc4adab164b772a34b3340d644b7c4728498581e (patch)
tree11f5bb42d738c5fc9ac6a8bd19cdbe17147b09dd /tools/perf/python
parent3f6cf0653f8a2117ec135b2ca322ec68abc1b26c (diff)
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff)
downloadlinux-cc4adab164b772a34b3340d644b7c4728498581e.tar.xz
Merge tag 'v6.19-rc1' into msm-next
Merge Linux 6.19-rc1 in order to catch up with other changes (e.g. UBWC config database defining UBWC_6). Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Diffstat (limited to 'tools/perf/python')
-rwxr-xr-xtools/perf/python/ilist.py32
1 files changed, 26 insertions, 6 deletions
diff --git a/tools/perf/python/ilist.py b/tools/perf/python/ilist.py
index 9d6465c60df3..0d757ddb4795 100755
--- a/tools/perf/python/ilist.py
+++ b/tools/perf/python/ilist.py
@@ -51,6 +51,7 @@ class TreeValue(ABC):
class Metric(TreeValue):
"""A metric in the tree."""
metric_name: str
+ metric_pmu: str
def name(self) -> str:
return self.metric_name
@@ -60,6 +61,8 @@ class Metric(TreeValue):
for metric in perf.metrics():
if metric["MetricName"] != self.metric_name:
continue
+ if self.metric_pmu and metric["PMU"] != self.metric_pmu:
+ continue
desc = get_info(metric, "BriefDescription")
desc += get_info(metric, "PublicDescription")
desc += get_info(metric, "MetricExpr")
@@ -71,11 +74,15 @@ class Metric(TreeValue):
return query in self.metric_name
def parse(self) -> perf.evlist:
- return perf.parse_metrics(self.metric_name)
+ return perf.parse_metrics(self.metric_name, self.metric_pmu)
def value(self, evlist: perf.evlist, evsel: perf.evsel, cpu: int, thread: int) -> float:
- val = evlist.compute_metric(self.metric_name, cpu, thread)
- return 0 if math.isnan(val) else val
+ try:
+ val = evlist.compute_metric(self.metric_name, cpu, thread)
+ return 0 if math.isnan(val) else val
+ except:
+ # Be tolerant of failures to compute metrics on particular CPUs/threads.
+ return 0
@dataclass
@@ -439,6 +446,8 @@ class IListApp(App):
pmu_node = pmus.add(pmu_name)
try:
for event in sorted(pmu.events(), key=lambda x: x["name"]):
+ if "deprecated" in event:
+ continue
if "name" in event:
e = event["name"].lower()
if "alias" in event:
@@ -454,14 +463,25 @@ class IListApp(App):
for metric in perf.metrics():
groups.update(metric["MetricGroup"])
- def add_metrics_to_tree(node: TreeNode[TreeValue], parent: str):
+ def add_metrics_to_tree(node: TreeNode[TreeValue], parent: str, pmu: str = None):
for metric in sorted(perf.metrics(), key=lambda x: x["MetricName"]):
+ metric_pmu = metric.get('PMU')
+ if pmu and metric_pmu and metric_pmu != pmu:
+ continue
if parent in metric["MetricGroup"]:
name = metric["MetricName"]
- node.add_leaf(name, data=Metric(name))
+ display_name = name
+ if metric_pmu:
+ display_name += f" ({metric_pmu})"
+ node.add_leaf(display_name, data=Metric(name, metric_pmu))
child_group_name = f'{name}_group'
if child_group_name in groups:
- add_metrics_to_tree(node.add(child_group_name), child_group_name)
+ display_child_group_name = child_group_name
+ if metric_pmu:
+ display_child_group_name += f" ({metric_pmu})"
+ add_metrics_to_tree(node.add(display_child_group_name),
+ child_group_name,
+ metric_pmu)
for group in sorted(groups):
if group.endswith('_group'):