Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2360922rdh; Tue, 26 Sep 2023 23:24:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgf4tMRWGCLpU6B9hWFYXcUc+kDBkDEqA4ERLcD6yDRtpKxKTrJH2t/wuTi7NBdcVYvmKO X-Received: by 2002:a17:90b:4a83:b0:262:ba7f:30cd with SMTP id lp3-20020a17090b4a8300b00262ba7f30cdmr709234pjb.31.1695795899179; Tue, 26 Sep 2023 23:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695795899; cv=none; d=google.com; s=arc-20160816; b=liV2e1Jgsm45pGWreY5ALcpy/KMGXZp3NAYtl4gHPr8shwv0EQNPNJyrbi8INTW2tZ 9eCAJdD6GS4k+PCHRogbtsrvvGJ7Px7f9HeNWTTJVtrwCBre8gOV6TR36YO6xiDMMouZ 38LUtoVFujsR/98Sn8RKO3XPremAmROvGUUxrG+TsRYqESyxs2yQDUnAoSnZ2L/flPY0 52UwunqwPGRiI4knhXJyxSVMG5ibVU+NpWZg/a/7Z2dKd7X93YKR+IXQJRXeusiIs+HR Z1hlhb4X3SV9agJVYMV67s3Qi112Ro/SLC7jZXF4IT6nM7yVURHoFJHohxz0X1stGSE4 YFJQ== 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=54EQ7PAu4jNaTHGUh9ny9Sj502t1h+dzHO0Kf8w83vA=; fh=9KkEy5BETl+n6HvtEwBLK4NkRgCt0Iv6FwLxABl1azE=; b=g8rHcOKFRTwMDVL0lU7T6WtBITZp38cKbGIyaDfP2xLteLoclLmi7vCl839QqqIeY9 BUuo66lR3PYvy0M3S/3RjiGiMm0TotnBJg4B9K+IL8ygwI0EJPWgg6dgicgu/AdtXL0t Xbhy52fodCSKqDpNuMDCOhSLt0yaXj0jjduGVgYZ607CfKSV848v1OGURJNDt0EGSPRz 96yBEgpXwIWpKrnm2TnKUnTIsebFHlvvlMIhHby7pwjn7BlOF7EFBhtkX7ynwFf/5g92 NQptokzu5y0MSGvDFMsHDSPIBTk1rTOaEgT3y3JO5+FZv3QDZ16odqzJdJhdSnf69jV8 QqYA== 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:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id q92-20020a17090a756500b002766bd6d3f3si16616019pjk.10.2023.09.26.23.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 23:24:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id ECDBD805092D; Tue, 26 Sep 2023 23:00:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229679AbjI0GAP (ORCPT + 99 others); Wed, 27 Sep 2023 02:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjI0GAI (ORCPT ); Wed, 27 Sep 2023 02:00:08 -0400 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF7192; Tue, 26 Sep 2023 23:00:05 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R601e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VszCdNB_1695794402; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VszCdNB_1695794402) by smtp.aliyun-inc.com; Wed, 27 Sep 2023 14:00:02 +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 v11 3/7] perf jevents: Support EventidCode and NodeType Date: Wed, 27 Sep 2023 13:59:47 +0800 Message-Id: <1695794391-34817-4-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1695794391-34817-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1695794391-34817-1-git-send-email-renyu.zj@linux.alibaba.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 23:00:30 -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 Reviewed-by: Ian Rogers Tested-by: Ian Rogers --- 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 af15fa2..f863aec 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