From patchwork Mon Sep 18 11:52:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 141378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2602917vqi; Mon, 18 Sep 2023 05:05:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbgoh5jfK3gaWrK7ZZdD2G/gnLtBdz1O7qcqI5oLhtEvWEy8Nr5RFCpukh1i+VLORIFqRz X-Received: by 2002:a17:902:834a:b0:1c5:5d45:6a41 with SMTP id z10-20020a170902834a00b001c55d456a41mr2142264pln.66.1695038748517; Mon, 18 Sep 2023 05:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695038748; cv=none; d=google.com; s=arc-20160816; b=PWedzHEu9qjgutZZe04tktQn7/Q/4mkt9DbKeX9vLIMiENtsFPse46Bgm+FHVu7o5r AM7fRwc/TEzAEmzg8VNSJdwprZqZmloxDu/rl9KkCz46eCqhC4u9cnmWcfJ+K4QMgTEs RS98pS/knFSsJh/PMjuodasBOACebfq4H9DAuGQehhn3LtMKXz1yfPHpNHMh+DfFBfIg 3wZ5beYE2H0UaWuL07Bis6Qu2DV9Jy2NEF1yQlnO+FTLCQqZ/+DoCdjsZRztxab84CRl 5pUgBFpAOaeiSo7XvBLPmtKqpVs6qPKhsJACWFlBCeS9uPznn5W63UknTYphRsCLSP7J YUig== 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=N2Kq0jlsxu1yOOXImlhe15Ar52LjafaLduvBCuIFnPku+pRbF4CPEY+lFC8gIxBkRZ wHtAhAiCbwFLOkXfSmZMe0LOO5+t2C4Zinqjy36PQ3YnYfyIKdOk+y88lHDhJSjknNXX BxRQVXlDapr9peNSvS/pzZaa7qbewcnqqCa97M/jOhvvaOpNKCxurA4Y+64JathNhfI0 Nvm02Tl/vzqw2B6Klg+lLlCA2brmyHO5Iqu9ylL5NAunQSZkjqrDGaeTlKqbCo+HGUUM Ra/vfkLV1oaOBmGnWZNLdhJgF9FP5/8QFF4m8y9KOX3i4hXyCzypwQ8bjACeybPlKf26 nxZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t10-20020a170902e84a00b001c3fbc674bdsi1855896plg.294.2023.09.18.05.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 05:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id D63CD81BC2E7; Mon, 18 Sep 2023 04:54:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241843AbjIRLxT (ORCPT + 27 others); Mon, 18 Sep 2023 07:53:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241761AbjIRLw7 (ORCPT ); Mon, 18 Sep 2023 07:52:59 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C91C1EA; Mon, 18 Sep 2023 04:52:53 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VsMQskN_1695037966; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VsMQskN_1695037966) by smtp.aliyun-inc.com; Mon, 18 Sep 2023 19:52:47 +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 v9 3/7] perf jevents: Support EventidCode and NodeType Date: Mon, 18 Sep 2023 19:52:31 +0800 Message-Id: <1695037955-107983-4-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1695037955-107983-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1695037955-107983-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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 18 Sep 2023 04:54:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777376950572823606 X-GMAIL-MSGID: 1777376950572823606 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':