Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp606032rwb; Fri, 13 Jan 2023 01:45:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXtCtZA13ajAMY9SoZqdN1PQ6a0E3UVm3zJ+6llvYi/rZvO6tECLpqH2YS9Nwjvn6+OHR50e X-Received: by 2002:a05:6402:b68:b0:499:b3fe:3b9 with SMTP id cb8-20020a0564020b6800b00499b3fe03b9mr15769353edb.34.1673603131175; Fri, 13 Jan 2023 01:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673603131; cv=none; d=google.com; s=arc-20160816; b=UYeiz1dHod0f+vToTOgVLk2/ApxI3f+b6FvGJtA2mvldtR1Yyc46iasjKGzYe4+iO7 qZ3Xp4kiv4++3So9nalsqIk8LtZqNy65o7+rpQzRXFvd+2rtXZaAQygI3H9GRLW5R9Pl qkAXsBHficZstyIcMqtX3acZ2E+LlAG19lJsRohX/fSI+zTNkEAX9O4N52XpWtP5VxEi Q1zwEadjumabgeLKotM/jnKdqs+i/4DY6MZsr+GkUwX9zBxBQ2gw2816Y5/+roWuKEwj ygXGttAu2Z/J6MFP/LSZOanOYfoZU6pka7cv4GaWxDe8DytZAVAW0J3hYHwfjv5LadZT 9+Xw== 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=w+/sg3UycNrKQGf9FoGn9p4mJt+ndrLfuhEFmbe0C04=; b=Y+fRXcBbKPUm8m/hJBv/vghqjrYxsxcvsjA/gubfJf+VCxihxpmjt+o+m5O8XLDLbb JjRmM1ffnD98wPf3gy3jpM7FAmq2/mIXF2FspsyAa6fPyfv4MEYQzbqRMrl1ZZk6J9br rV1HjEvYkQZSzgXILInMKzYeu3LKEk4pVvTvbwNXhTFp6B9q0UdWPxOTIbtZWXSSB2Lo lr6C7zH2xPJ6jRRDxsBnYMpeWLuwV8cXDFKy13Km2sZ0aS6BfAjntcfu1xRgaIdrKTjb sJZ6lyBIfPvBs0/0j/T7BSLR+fMXGdnSKMsRO4a10xc6ILLxP6ZPv0p85SDrMcAVistc XlqA== 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 t10-20020a056402240a00b00499b3b2cfbcsi15143228eda.586.2023.01.13.01.45.17; Fri, 13 Jan 2023 01:45:31 -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 S240690AbjAMJ26 (ORCPT + 51 others); Fri, 13 Jan 2023 04:28:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241028AbjAMJ1W (ORCPT ); Fri, 13 Jan 2023 04:27:22 -0500 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59B8B4319C; Fri, 13 Jan 2023 01:22:45 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;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_---0VZUDRU7_1673601756; Received: from srmbuffer011165236051.sqa.eu95(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VZUDRU7_1673601756) by smtp.aliyun-inc.com; Fri, 13 Jan 2023 17:22:37 +0800 From: Jing Zhang To: John Garry , Ian Rogers Cc: Xing Zhengjun , Will Deacon , James Clark , Mike Leach , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andrew Kilroy , Shuai Xue , Zhuo Song , Jing Zhang Subject: [PATCH v7 4/9] perf vendor events arm64: Add topdown L1 metrics for neoverse-n2-v2 Date: Fri, 13 Jan 2023 17:22:15 +0800 Message-Id: <1673601740-122788-5-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673601740-122788-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1673601740-122788-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,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 Add general topdown L1 metrics for neoverse-n2-v2. Due to the wrong count of stall_slot and stall_slot_frontend on neoverse-n2, the real stall_slot and real stall_slot_frontend need to subtract cpu_cycles, so overwrite the "MetricExpr" for neoverse-n2 which slots are 5. Reference from ARM neoverse-n2 errata notice [0], D117. Since neoverse-n2/neoverse-v2 does not yet support topdown L2, metric groups such as Cache, TLB, Branch, InstructionsMix and PEutilization will be added to further analysis of performance bottlenecks in the following patches. Reference from ARM PMU guide [1][2]. [0] https://documentation-service.arm.com/static/636a66a64e6cf12278ad89cb?token= [1] https://documentation-service.arm.com/static/628f8fa3dfaf015c2b76eae8?token= [2] https://documentation-service.arm.com/static/62cfe21e31ea212bb6627393?token= Signed-off-by: Jing Zhang --- .../arch/arm64/arm/neoverse-n2-v2/metrics.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json diff --git a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json new file mode 100644 index 0000000..4e7417f --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json @@ -0,0 +1,17 @@ +[ + { + "ArchStdEvent": "FRONTEND_BOUND", + "MetricExpr": "((stall_slot_frontend) if (#slots - 5) else (stall_slot_frontend - cpu_cycles)) / (#slots * cpu_cycles)" + }, + { + "ArchStdEvent": "BAD_SPECULATION", + "MetricExpr": "(1 - op_retired / op_spec) * (1 - (stall_slot if (#slots - 5) else (stall_slot - cpu_cycles)) / (#slots * cpu_cycles))" + }, + { + "ArchStdEvent": "RETIRING", + "MetricExpr": "(op_retired / op_spec) * (1 - (stall_slot if (#slots - 5) else (stall_slot - cpu_cycles)) / (#slots * cpu_cycles))" + }, + { + "ArchStdEvent": "BACKEND_BOUND" + } +] -- 1.8.3.1