Message ID | 20221221223420.2157113-2-irogers@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F12AC4332F for <linux-arm-kernel@archiver.kernel.org>; Wed, 21 Dec 2022 22:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YyaQK9hziJhO7mkbG2vZQc/u5zCzwkBrb3BfWB2yAKU=; b=xfdnXGsqiKvP/G2Z2D5HEn+qf5 aH8w4yw+z/3XiHzr1cdDgCHvxcnBVB0damLiD+VAs6aeOq2NdS+LeHcW1rg96la1wssl1OIoL1ych Mk6oi7d/L9rRiK6lEZSdDkv4+W+3/KPmqQfYqW3lBMOtzE8Kxz+zDNLMJF1XUMAysTq1x6CizInhF L9gnhLWMO0VU+Faouo4DrOTkMHKbptTDPT5zw/dDIArR7p+5qyZMDZvyxMeAvXCfO+qHGtH6yy6ZI H5KmP1wPQsUUbW+TRbUT3uFETdLQNzlT4uIll1zgjC0Uvz+NkwrDDvmoQxljZSDar/E0VnoaSma5P bd2i0Hog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p87fn-00397K-9q; Wed, 21 Dec 2022 22:34:51 +0000 Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p87fb-0038yz-IE for linux-arm-kernel@lists.infradead.org; Wed, 21 Dec 2022 22:34:40 +0000 Received: by mail-pj1-x104a.google.com with SMTP id me18-20020a17090b17d200b00219f8dc7cb3so1968456pjb.4 for <linux-arm-kernel@lists.infradead.org>; Wed, 21 Dec 2022 14:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=SSNQl52T6aONyRJU3JLzaiDjv/uDuW/eBBmo/7p1gyM=; b=hWrFQqbUjVIgEbk5/HxS/gkX6UYWMxIViM61QrBDErGTC0CBNoIoSRAGz4VBIy+Jr7 JswhbaKF216kLto8y6J0fNHcsV3xpaxqEJUkJbD+LHzyL6/kkMwmt8zPho3uLPm5a1tU 7T0VUBlzwmSB8KANwYWZ61vZ432nW1Ri7IIk/cr49jkIDjO4Oxy7NlMPIhaxhInVLxGy ltZAVnrt/pg51qXbCr0/25IVChcILeO1bWJ/6ep813uuo6FrGRblDVK16UPmaEFBryDQ ofPEuG9v8tmkKCKD09he2BxVBvloOkyTcDODFbe2QSWp7KFy4BP1B8TDzbO7Dja+3Obs xBqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SSNQl52T6aONyRJU3JLzaiDjv/uDuW/eBBmo/7p1gyM=; b=geGWytPsHx3//Ws1Oy/CoXOUqB1ANzZ00PLaEQM6l79atA47ENCynLGw5AhAhsr5Yl YYFXBpi3UzCZiDCu9trjFYGRoysGj678ygOziCUab5Gz0faqSD391pKy8l+NxhVaVr35 VyvJAGtAmNATCg/VrJNWzzwUQpgrQdR9+q6AbUcXc7DIeX+NGFSQDqcGLFeqyrpR1odd 05XVW9Qgw8A/94uba6QvaoYrRywTgchASLAQwBGoKPZW0dYDPUry6kulzBE1GcfSu7Fl F+xGaArlqQS1SYT+MPTosbonflvBP8hOEyQfPdH0Jx0GwQkSzJMsG4YIFKXMEZZQUxCb Vv3A== X-Gm-Message-State: AFqh2kq9PxXMuNYrtUDprTRyH882q2JRZhPuMr4Cnv8DPhbeVmGr9SWN IWYOCAsDjEDD0Zj/Wqc/v8lvjEM+PUnv X-Google-Smtp-Source: AMrXdXv2jCTZRqgvHNw/zlM6+eqhzbGTGQXu+45bytWBX9fVfz/bcWmBaNU4rA3CFSzsBRM24pb0+K70sXOG X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:62bd:f120:1fd8:1d21]) (user=irogers job=sendgmr) by 2002:aa7:8ecc:0:b0:57c:ec11:dc0a with SMTP id b12-20020aa78ecc000000b0057cec11dc0amr247300pfr.40.1671662076792; Wed, 21 Dec 2022 14:34:36 -0800 (PST) Date: Wed, 21 Dec 2022 14:34:12 -0800 In-Reply-To: <20221221223420.2157113-1-irogers@google.com> Message-Id: <20221221223420.2157113-2-irogers@google.com> Mime-Version: 1.0 References: <20221221223420.2157113-1-irogers@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH v2 1/9] perf jevents metric: Correct Function equality From: Ian Rogers <irogers@google.com> To: John Garry <john.g.garry@oracle.com>, Will Deacon <will@kernel.org>, James Clark <james.clark@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Adrian Hunter <adrian.hunter@intel.com>, Kan Liang <kan.liang@linux.intel.com>, Kim Phillips <kim.phillips@amd.com>, Florian Fischer <florian.fischer@muhq.space>, Ravi Bangoria <ravi.bangoria@amd.com>, Xing Zhengjun <zhengjun.xing@linux.intel.com>, Rob Herring <robh@kernel.org>, Kang Minchul <tegongkang@gmail.com>, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Sandipan Das <sandipan.das@amd.com>, Jing Zhang <renyu.zj@linux.alibaba.com>, linuxppc-dev@lists.ozlabs.org, Kajol Jain <kjain@linux.ibm.com> Cc: Stephane Eranian <eranian@google.com>, Perry Taylor <perry.taylor@intel.com>, Caleb Biggers <caleb.biggers@intel.com>, Ian Rogers <irogers@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221221_143439_666127_62D71CAA X-CRM114-Status: GOOD ( 12.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
jevents/pmu-events improvements
|
expand
|
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
rhs may not be defined, say for source_count, so add a guard. Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/pmu-events/metric.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)