Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp994362rdh; Sun, 24 Sep 2023 22:59:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFydQJq9eWd4iW5t4+Ha4MY9gAf+ZhfttNS2d6Hh4xDPGuuJJ1T13zkWd6ZM2kcn+5GrSNL X-Received: by 2002:a05:6a20:12d4:b0:15e:9c2f:5294 with SMTP id v20-20020a056a2012d400b0015e9c2f5294mr2167390pzg.56.1695621591112; Sun, 24 Sep 2023 22:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695621591; cv=none; d=google.com; s=arc-20160816; b=f9+8NxsqEhopH14IkdghBJMEchj1o9TqrvCOzVsy8OzaINjiRCO+GsmEEu6lCTrp2V QbH3h+iAqV2ck5/9s/ziiPSZzT4hUNrrl/A9dVKPWQMR4MT1/OA2qp698/DGyulTwJfB /ydRCHcp0osHauhnpgDDUBnxUYdy2mrq1PvTOpSyY9Eh7K2Y0sSKUG3xPe/VFRt12c6N LM89BazxJ1DXgTH0YPCDjp9H1nC3gBTpNbe+fzJcJag4m3I8k4iHlelA7c6P7qiRFdem K16H6z3HpaSaPCqa5S6qafjrUG6T6wq0i8wa8FH71ivnizbsksYUBr5tASV3Px0yTaeh u1Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=uj4J3edTP0Uypkt96XmGj+M2dV+CzB6CJhuoq4Pn8r4=; fh=9KkEy5BETl+n6HvtEwBLK4NkRgCt0Iv6FwLxABl1azE=; b=fVpQ+qGZitMl3y2/Zy1ferVfmK29qPl0iYBIeYuZ8u97FFiLRZKfvl9Mva6Pk+LjaK 31+vdddaclJ+oyZ0lfbHt0x8GQyXFoU0kfw8509NaIWGgWJm/UrT40f0NxH76dyl4FF+ RDPzDy8bmJoHzWt7xjCYBwAVrfNT7nSxLiaaq3oT2SrNXgo4cFptuRrqReV6EtOd2XGB 6qOfO5Fc2m/H9m0cIMABq1QxVE6fBYsiqIPHtHUdFTC3x8xVpVc40SxjnGMXYPI5uTO/ uhvqG1cVAeUZ81WpI985eJlMWtzGPrJjmOfWMYf/GJ/l7eT87rypZLx3i+FrUFjrEC8p x0jA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id pc2-20020a17090b3b8200b0027740943ec2si3545344pjb.158.2023.09.24.22.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 22:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 990DF8025B6B; Sun, 24 Sep 2023 22:58:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbjIYF6o (ORCPT + 99 others); Mon, 25 Sep 2023 01:58:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbjIYF6h (ORCPT ); Mon, 25 Sep 2023 01:58:37 -0400 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB4B2E8; Sun, 24 Sep 2023 22:58:30 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R671e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0Vsl7J2J_1695621506; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0Vsl7J2J_1695621506) by smtp.aliyun-inc.com; Mon, 25 Sep 2023 13:58:26 +0800 From: Jing Zhang To: John Garry , Ian Rogers Cc: Will Deacon , James Clark , Arnaldo Carvalho de Melo , Mark Rutland , Mike Leach , Leo Yan , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-doc@vger.kernel.org, Zhuo Song , Jing Zhang , Shuai Xue Subject: [PATCH v10 3/7] perf jevents: Support EventidCode and NodeType Date: Mon, 25 Sep 2023 13:57:20 +0800 Message-Id: <1695621444-56530-4-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1695621444-56530-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1695621444-56530-1-git-send-email-renyu.zj@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 24 Sep 2023 22:58:44 -0700 (PDT) The previous code assumes an event has either an "event=" or "config" field at the beginning. For CMN neither of these may be present, as an event is typically "type=xx,eventid=xxx". So add EventidCode and NodeType to support CMN event description. I compared pmu_event.c before and after compiling with JEVENT_ARCH=all, they are consistent. Signed-off-by: Jing Zhang --- tools/perf/pmu-events/jevents.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index a7e8833..057d51aa 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -298,6 +298,7 @@ class JsonEvent: if 'ExtSel' in jd: eventcode |= int(jd['ExtSel']) << 8 configcode = int(jd['ConfigCode'], 0) if 'ConfigCode' in jd else None + eventidcode = int(jd['EventidCode'], 0) if 'EventidCode' in jd else None self.name = jd['EventName'].lower() if 'EventName' in jd else None self.topic = '' self.compat = jd.get('Compat') @@ -335,7 +336,13 @@ class JsonEvent: if precise and self.desc and '(Precise Event)' not in self.desc: extra_desc += ' (Must be precise)' if precise == '2' else (' (Precise ' 'event)') - event = f'config={llx(configcode)}' if configcode is not None else f'event={llx(eventcode)}' + event = None + if configcode is not None: + event = f'config={llx(configcode)}' + elif eventidcode is not None: + event = f'eventid={llx(eventidcode)}' + else: + event = f'event={llx(eventcode)}' event_fields = [ ('AnyThread', 'any='), ('PortMask', 'ch_mask='), @@ -345,6 +352,7 @@ class JsonEvent: ('Invert', 'inv='), ('SampleAfterValue', 'period='), ('UMask', 'umask='), + ('NodeType', 'type='), ] for key, value in event_fields: if key in jd and jd[key] != '0': -- 1.8.3.1