Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp32205695rwd; Fri, 7 Jul 2023 10:07:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlE536CY0IGoDNaSRKhdU5DRfn6py3m5dIapQufbYbYO8iUVGSQ+G5sCZwRRZXt5I3o+I5dG X-Received: by 2002:a17:907:3a4a:b0:991:fef4:bb9 with SMTP id fc10-20020a1709073a4a00b00991fef40bb9mr4056391ejc.58.1688749641711; Fri, 07 Jul 2023 10:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688749641; cv=none; d=google.com; s=arc-20160816; b=AoE9w6UbdzEIf4+smd/q1hL+qF0Etj3fwXq8gFP7qKbSawPHXtkh/aNbQJAQu6tTjH 7Y9qTvIjHhPeLKgYXDuGJD5sas0VQdIE0eWG/r7/Ua/z40Y1NAEr1GKcfJDLk7fza2tm SbcLdOmtCOdOBJOFuGmw+HxSV8tgEijNSCX8Q8rv6akO03QNZgqKZBDsaIkAWmG7sDDG yp6YjmL+5iNgZ6Qdr3XiPoIyWLBLTA058G+uDjYVTIrbPWE57GFT5+JzGf5EZ9KmlUgT 5eoOVmx+dYpdI/YiqyRvSAsPgZi8wYHtx+gcmUt4VMB1MZha9lrn4ocDR+t79sE5QrWz BgXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VzCufH1UpU6UclGmGG8N8GUvR+P+j+JOcXsDU9gJtpk=; fh=RJSKoTNAfycfk3vCbvbM/drn0IJyeBxhVqVaqmZBzyo=; b=bi5MTImD83sCIeHuyWYKoHT3QobtzK4ZBAlx45eL5h81V/pTbQgrWqCoDF6lnGrblh Ku8S9mLxwbAADGSd00bfdwij3yvCDmcTYN5J8YR10zM8e2dl7OXIt6ttilPBZS6tVIKN k1boQjbNS8DNF+8hTeHooi2NkMqjl+KCkPFRe2MuDcgLHp7gdtM9CiGQPgayBhiRCOId vG8TYfqCTiGMuAVLf74HFQdDQXd5SmziHlbVxkbGaL9+Xb4z7TXpMLZyahuIo1gDzexc DdJ/DvKEwXnDZgGnbHpWSclF7PndqvPSbL7cOjgS++nvbxz1vm5AC8Xw2DEhUIXfHfJC qRcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a170906559300b009930f844671si2506999ejp.963.2023.07.07.10.06.49; Fri, 07 Jul 2023 10:07:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232905AbjGGQiX (ORCPT + 99 others); Fri, 7 Jul 2023 12:38:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232770AbjGGQiV (ORCPT ); Fri, 7 Jul 2023 12:38:21 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B956A210C for ; Fri, 7 Jul 2023 09:38:20 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 927EA1063; Fri, 7 Jul 2023 09:39:02 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9B1043F740; Fri, 7 Jul 2023 09:38:19 -0700 (PDT) From: Robin Murphy To: will@kernel.org Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ilkka@os.amperecomputing.com, blakgeof@amazon.com Subject: [PATCH 1/3] perf/arm-cmn: Remove spurious event aliases Date: Fri, 7 Jul 2023 17:38:11 +0100 Message-Id: X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As the name suggests, the "partial DAT flit" event is only counted for the DAT channel, and furthermore is only applicable to device ports, not mesh links (strictly it's only device ports with CHI-A requesters connected, but detecting that degree of detail is more bother than it's worth). Stop generating spurious event aliases for other combinations which aren't meaningful. Signed-off-by: Robin Murphy --- drivers/perf/arm-cmn.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index b8c15878bc86..a007648dbf1c 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -791,16 +791,22 @@ static umode_t arm_cmn_event_attr_is_visible(struct kobject *kobj, _CMN_EVENT_HNF(_model, _name##_read, _event, 5, SEL_CBUSY_SNTHROTTLE_SEL), \ _CMN_EVENT_HNF(_model, _name##_write, _event, 6, SEL_CBUSY_SNTHROTTLE_SEL) -#define _CMN_EVENT_XP(_name, _event) \ +#define _CMN_EVENT_XP_MESH(_name, _event) \ __CMN_EVENT_XP(e_##_name, (_event) | (0 << 2)), \ __CMN_EVENT_XP(w_##_name, (_event) | (1 << 2)), \ __CMN_EVENT_XP(n_##_name, (_event) | (2 << 2)), \ - __CMN_EVENT_XP(s_##_name, (_event) | (3 << 2)), \ + __CMN_EVENT_XP(s_##_name, (_event) | (3 << 2)) + +#define _CMN_EVENT_XP_PORT(_name, _event) \ __CMN_EVENT_XP(p0_##_name, (_event) | (4 << 2)), \ __CMN_EVENT_XP(p1_##_name, (_event) | (5 << 2)), \ __CMN_EVENT_XP(p2_##_name, (_event) | (6 << 2)), \ __CMN_EVENT_XP(p3_##_name, (_event) | (7 << 2)) +#define _CMN_EVENT_XP(_name, _event) \ + _CMN_EVENT_XP_MESH(_name, _event), \ + _CMN_EVENT_XP_PORT(_name, _event) + /* Good thing there are only 3 fundamental XP events... */ #define CMN_EVENT_XP(_name, _event) \ _CMN_EVENT_XP(req_##_name, (_event) | (0 << 5)), \ @@ -813,6 +819,10 @@ static umode_t arm_cmn_event_attr_is_visible(struct kobject *kobj, _CMN_EVENT_XP(snp2_##_name, (_event) | (7 << 5)), \ _CMN_EVENT_XP(req2_##_name, (_event) | (8 << 5)) +#define CMN_EVENT_XP_DAT(_name, _event) \ + _CMN_EVENT_XP_PORT(dat_##_name, (_event) | (3 << 5)), \ + _CMN_EVENT_XP_PORT(dat2_##_name, (_event) | (6 << 5)) + static struct attribute *arm_cmn_event_attrs[] = { CMN_EVENT_DTC(cycles), @@ -943,7 +953,7 @@ static struct attribute *arm_cmn_event_attrs[] = { CMN_EVENT_XP(txflit_valid, 0x01), CMN_EVENT_XP(txflit_stall, 0x02), - CMN_EVENT_XP(partial_dat_flit, 0x03), + CMN_EVENT_XP_DAT(partial_dat_flit, 0x03), /* We treat watchpoints as a special made-up class of XP events */ CMN_EVENT_ATTR(CMN_ANY, watchpoint_up, CMN_TYPE_WP, CMN_WP_UP), CMN_EVENT_ATTR(CMN_ANY, watchpoint_down, CMN_TYPE_WP, CMN_WP_DOWN), -- 2.39.2.101.g768bb238c484.dirty