[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9d26106-95d2-69ae-b7ed-1b47449dacd1@linux.ibm.com>
Date: Wed, 25 Jan 2023 10:25:17 +0530
From: kajoljain <kjain@...ux.ibm.com>
To: Ian Rogers <irogers@...gle.com>,
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
Cc: Stephane Eranian <eranian@...gle.com>,
Perry Taylor <perry.taylor@...el.com>,
Caleb Biggers <caleb.biggers@...el.com>
Subject: Re: [PATCH v3 01/11] perf jevents metric: Correct Function equality
On 1/24/23 12:03, Ian Rogers wrote:
> 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 4797ed4fd817..2f2fd220e843 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
>
>
Patch looks good to me.
Reviewed-by: Kajol Jain<kjain@...ux.ibm.com>
Thanks,
Kajol Jain
Powered by blists - more mailing lists