Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4455602rwb; Mon, 21 Nov 2022 07:49:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf4nSnPsjdNS5KDqNtqahiyPuoJDgHdU++py1js8Ah8+9eCuvO1UKfz88EsorGop6bacRiJP X-Received: by 2002:a05:6402:4311:b0:458:c66a:3664 with SMTP id m17-20020a056402431100b00458c66a3664mr3158221edc.79.1669045742279; Mon, 21 Nov 2022 07:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669045742; cv=none; d=google.com; s=arc-20160816; b=axOgzL2zeUkyAwHdi3kEqnZbLcqQKmK60VjfVP1Z20QKoFQ1mt3MFtw1h3ovxfiqsg HJVNYyNh+K/6hhEirZAZGMzIJMgIiFB41wt7pI6XDUhN/PuiE9Rr+nUPvfyTkzXaLEqX vFiTqpSs6BrfMxRJrK9f1vK41IU0Vph/5mUE5o1k+TGtPdt3+9DpILBG/kfCS4k9Rf8m qI29tmRWzVZBdzT6Bh6Ua6Zyc7KtUeLyZ0Ukya5Mz1S0zskcJCY3JigUesPxr9vfP0Rv UDUTvd4bDfNb1VU0ddsOGbj1OxyDfIJK/UMxZwYoBsw9cG3jGvFbdVUlF3ZCi4nqdrC6 n6XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=/iEOyND3bK2LpEBOHvo0SmOEfxIN/dCb5vYrQ+tfiR4=; b=xQLtK7B/1BZpcFTyX3oOI1aI9om3Nx5iaQlzfvlsR5PGDrCxkQN5oZEVkZt8iPcf0n 6FEJ8qAL2xUrKM1Z/rDJmOgcshRmMhBrL3v/X9Jisz6RsGDHnuRy/e+XggimLs1/J+qN bIqqG82QLwUZ4M6FVP75g9gpUP/t4MiOBFUHz3B4Rd/04SKL9by56nM36Z5csBNQ/zgJ 1B+nsS8vWHGqT6G80JFr6gylUgs+XqAAyewumevy3fEIbgqY2UF9p8PNTbmSr8OfTTru 8MKGtqEywj4jcCIvsvEu2J7BndATJyRkDTRzLpbwFnrmtDNJRiP5F+NqU0hVhYedpu3q fQ8Q== 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=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x22-20020a05640226d600b004605f289f68si10670520edd.158.2022.11.21.07.48.31; Mon, 21 Nov 2022 07:49:02 -0800 (PST) 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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229463AbiKUPU3 (ORCPT + 91 others); Mon, 21 Nov 2022 10:20:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbiKUPUO (ORCPT ); Mon, 21 Nov 2022 10:20:14 -0500 Received: from out199-10.us.a.mail.aliyun.com (out199-10.us.a.mail.aliyun.com [47.90.199.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 251C6175B6; Mon, 21 Nov 2022 07:17:18 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=20;SR=0;TI=SMTPD_---0VVOOPHM_1669043831; Received: from 30.120.171.189(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VVOOPHM_1669043831) by smtp.aliyun-inc.com; Mon, 21 Nov 2022 23:17:13 +0800 Message-ID: Date: Mon, 21 Nov 2022 23:17:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [External] : [RFC PATCH v2 1/6] perf vendor events arm64: Add topdown L1 metrics for neoverse-n2 To: John Garry , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andrew Kilroy , Shuai Xue , Zhuo Song References: <1667214694-89839-1-git-send-email-renyu.zj@linux.alibaba.com> <1668411720-3581-2-git-send-email-renyu.zj@linux.alibaba.com> <590ff032-d271-48ee-a4d8-141cc070c335@oracle.com> From: Jing Zhang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 在 2022/11/21 下午6:22, John Garry 写道: > >> >> >> #./perf stat -e FRONTEND_BOUND sleep 1 >> event syntax error: 'FRONTEND_BOUND' > > For metrics, use -M, not -e > > If this doesn't help, verify generated pmu-events/pmu-events.c is same after you make the change to try to use std arch events for metrics. Note that I never tested running my change. > > Thanks, > John > >>                       \___ parser error >> Run 'perf list' for a list of valid events >> >>   Usage: perf stat [] [] >> >>      -e, --event    event selector. use 'perf list' to list available events >> >> >> >> diff --git a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/pipeline.json b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/pipeli >> index f9fae15..1089ca0 100644 >> --- a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/pipeline.json >> +++ b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/pipeline.json >> @@ -6,18 +6,24 @@ >>           "ArchStdEvent": "STALL_BACKEND" >>       }, >>       { >> -        "ArchStdEvent": "STALL_SLOT_FRONTEND" >> +        "ArchStdEvent": "STALL_SLOT_FRONTEND", >> +        "MetricExpr": "STALL_SLOT_FRONTEND - CPU_CYCLES" >>       }, >>       { >> I'm sorry that I misunderstood the purpose of putting metric as arch_std_event at first, and now it works after the modification over your suggestion. But there are also a few questions: 1. The value of the slot in the topdownL1 is various in different architectures, for example, the slot is 5 on neoverse-n2. If I put topdownL1 metric as arch_std_event, then I need to specify the slot to 5 in n2. I can specify slot values in metric like below, but is there any other concise way to do this? diff --git a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json index 8ff1dfe..b473baf 100644 --- a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json +++ b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json @@ -1,4 +1,23 @@ [ + { + "MetricExpr": "5", + "PublicDescription": "A pipeline slot represents the hardware resources needed to process one uOp", + "BriefDescription": "A pipeline slot represents the hardware resources needed to process one uOp", + "MetricName": "slot" + }, + { + "ArchStdEvent": "FRONTEND_BOUND" + }, + { + "ArchStdEvent": "BACKEND_BOUND" + }, + { + "ArchStdEvent": "WASTED" + }, + { + "ArchStdEvent": "RETIRING" + }, 2. Should I add the topdownL1 metric to tools/perf/pmu-event/recommended.json, or create a new json file to place the general metric? Looking forward to your reply. Thanks, Jing