[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221213050043.1199380-2-irogers@google.com>
Date: Mon, 12 Dec 2022 21:00:35 -0800
From: Ian Rogers <irogers@...gle.com>
To: John Garry <john.g.garry@...cle.com>,
Will Deacon <will@...nel.org>,
James Clark <james.clark@....com>,
Mike Leach <mike.leach@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Kim Phillips <kim.phillips@....com>,
Florian Fischer <florian.fischer@...q.space>,
Ravi Bangoria <ravi.bangoria@....com>,
Xing Zhengjun <zhengjun.xing@...ux.intel.com>,
Rob Herring <robh@...nel.org>,
Kang Minchul <tegongkang@...il.com>,
linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Sandipan Das <sandipan.das@....com>,
Jing Zhang <renyu.zj@...ux.alibaba.com>,
linuxppc-dev@...ts.ozlabs.org, Kajol Jain <kjain@...ux.ibm.com>
Cc: Stephane Eranian <eranian@...gle.com>,
Perry Taylor <perry.taylor@...el.com>,
Caleb Biggers <caleb.biggers@...el.com>,
Ian Rogers <irogers@...gle.com>
Subject: [PATCH v1 1/9] perf jevents metric: Correct Function equality
rhs may not be defined, say for source_count, so add a guard.
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
tools/perf/pmu-events/metric.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py
index cc451a265751..1fa3478b9ab0 100644
--- a/tools/perf/pmu-events/metric.py
+++ b/tools/perf/pmu-events/metric.py
@@ -261,8 +261,10 @@ class Function(Expression):
def Equals(self, other: Expression) -> bool:
if isinstance(other, Function):
- return self.fn == other.fn and self.lhs.Equals(
- other.lhs) and self.rhs.Equals(other.rhs)
+ result = self.fn == other.fn and self.lhs.Equals(other.lhs)
+ if self.rhs:
+ result = result and self.rhs.Equals(other.rhs)
+ return result
return False
--
2.39.0.rc1.256.g54fd8350bd-goog
Powered by blists - more mailing lists