Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp826832rdf; Tue, 21 Nov 2023 19:09:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHObp+fynuNrJ9cGj1RY5fFxVfeBdzQ8ZiYk21rkaWRbNWFnU2xWyg2N3V5C9Yittqd/Rzr X-Received: by 2002:a17:902:f544:b0:1cc:29ef:df7d with SMTP id h4-20020a170902f54400b001cc29efdf7dmr1368463plf.65.1700622598509; Tue, 21 Nov 2023 19:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700622598; cv=none; d=google.com; s=arc-20160816; b=DMBMzTnF7IwXZ8+mX2yBcE/JLMQQ4zY7ns1biikmFDTWNjWNV4/i4rrGgrovB4EbQ5 hOMf5ngVnFyWI6Se4gdPQbK40Jlml3xOaEyfWr9EXIkBgzzV/cgiAOzwtTZFicpnG3Kf VxevfSS1AeAlgENWW1wECvley/S+vg3Q3JO6x00Fidlr/L+aiqVz2wdppmgyI2RiHVTO gk9xide5fcOiwkI2PjRoLUXQz0V1rl2FORVpTme+/AaSdNZogrVWpTb/HKgecasj8tW1 2RSKbzFW8JzbkRFLAvai5KxThAS8ky9pwG99nfzysaMJzknAQu8SDwyeAtREcv+XSyJO 0psQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=g4zJ6UGtreOXAp9hxyJ6TpuNXox6A2KVtxksohs5b9Q=; fh=3GEq+eOVXmReVKw3ubCG3EqcNoaDB6TXYWZVTuzepts=; b=LqnnNiL/n5mDm6C7k//WBuMyT8Hn7hi8KegWWD+cP0pS3D7LHNzqkMI8Pe86GrDD3C Rhth6KdDrXgP0GryO8XKuXiUF+rMwf9tdEyTVvMi23wM+tsiE8N+D18jojIZpZLibA/7 kUAn4cGTXx9m5s4S8169Q/zdG3B1+K0KNlZbD5dkzSumFgSFQzFcczJ1qqCTyACcjELg 8967WB35TPDlSCGe7HfanE6DSZPwDJwshPD4cl2ST1GiVqvjkgKKf3100BlVXn3oTO4P XWzYSLVhfUwIjjROmHDZZ9QxY+9m8B4SRlI7EvkktCM75+1sQrHPyk7B2m5I63XM2I79 CFQg== 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id c14-20020a170903234e00b001cf67883f24si4403045plh.264.2023.11.21.19.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 19:09:58 -0800 (PST) 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9D1C3801C1BE; Tue, 21 Nov 2023 19:09:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343565AbjKVDJz convert rfc822-to-8bit (ORCPT + 99 others); Tue, 21 Nov 2023 22:09:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235037AbjKVDJw (ORCPT ); Tue, 21 Nov 2023 22:09:52 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA8BF4; Tue, 21 Nov 2023 19:09:44 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 5E58424DB84; Wed, 22 Nov 2023 11:09:36 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 22 Nov 2023 11:09:36 +0800 Received: from localhost.localdomain (202.188.176.82) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 22 Nov 2023 11:09:30 +0800 From: Ji Sheng Teoh To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , "Namhyung Kim" , Ian Rogers , Adrian Hunter , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , "Nikita Shubin" CC: Ji Sheng Teoh , Ley Foon Tan , , , Subject: [PATCH v4] perf vendor events riscv: add StarFive Dubhe-90 JSON file Date: Wed, 22 Nov 2023 11:09:08 +0800 Message-ID: <20231122030908.2981502-1-jisheng.teoh@starfivetech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.188.176.82] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Tue, 21 Nov 2023 19:09:57 -0800 (PST) Similar to StarFive's Dubhe-80, Dubhe-90 supports raw event id 0x00 - 0x22. Reuse Dubhe-80 firmware and common json file. The raw events are enabled through PMU node of DT binding. Besides raw event, add standard RISC-V firmware events to support monitoring of firmware event. Example of PMU DT node: pmu { compatible = "riscv,pmu"; riscv,raw-event-to-mhpmcounters = /* Event ID 1-31 */ <0x00 0x00 0xFFFFFFFF 0xFFFFFFE0 0x00007FF8>, /* Event ID 32-33 */ <0x00 0x20 0xFFFFFFFF 0xFFFFFFFE 0x00007FF8>, /* Event ID 34 */ <0x00 0x22 0xFFFFFFFF 0xFFFFFF22 0x00007FF8>; }; Perf stat output: [root@user]# perf stat -a \ -e access_mmu_stlb \ -e miss_mmu_stlb \ -e access_mmu_pte_c \ -e rob_flush \ -e btb_prediction_miss \ -e itlb_miss \ -e sync_del_fetch_g \ -e icache_miss \ -e bpu_br_retire \ -e bpu_br_miss \ -e ret_ins_retire \ -e ret_ins_miss \ -- openssl speed rsa2048 Doing 2048 bits private rsa's for 10s: 39 2048 bits private RSA's in 10.03s Doing 2048 bits public rsa's for 10s: 1469 2048 bits public RSA's in 9.47s version: 3.0.10 built on: Tue Aug 1 13:47:24 2023 UTC options: bn(64,64) CPUINFO: N/A sign verify sign/s verify/s rsa 2048 bits 0.257179s 0.006447s 3.9 155.1 Performance counter stats for 'system wide': 3112882 access_mmu_stlb 10550 miss_mmu_stlb 18251 access_mmu_pte_c 274765 rob_flush 22470560 btb_prediction_miss 3035839 itlb_miss 643549060 sync_del_fetch_g 133013 icache_miss 62982796 bpu_br_retire 287548 bpu_br_miss 8935910 ret_ins_retire 8308 ret_ins_miss 20.656182600 seconds time elapsed Signed-off-by: Ji Sheng Teoh Reviewed-by: Ley Foon Tan --- Changelog: v3 -> v4: - Reuse common and firmware json file from starfive/dubhe-80. - Rebase against latest perf-tools-next - Update commit message to reflect the above changes. v2 -> v3: - Add standard RISC-V firmware event - Update commit message to reflect addition of standard RISC-V firmware event. v1 -> v2: - Rename 'Starfive Dubhe' to 'StarFive Dubhe-90' in commit message. - Rename 'starfive/dubhe' pmu-events folder to 'starfive/dubhe-90' - Update MARCHID to 0x80000000db000090 in mapfile.csv --- tools/perf/pmu-events/arch/riscv/mapfile.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/pmu-events/arch/riscv/mapfile.csv b/tools/perf/pmu-events/arch/riscv/mapfile.csv index ee61e26f90cd..56b03138d46a 100644 --- a/tools/perf/pmu-events/arch/riscv/mapfile.csv +++ b/tools/perf/pmu-events/arch/riscv/mapfile.csv @@ -15,4 +15,4 @@ # #MVENDORID-MARCHID-MIMPID,Version,Filename,EventType 0x489-0x8000000000000007-0x[[:xdigit:]]+,v1,sifive/u74,core -0x67e-0x80000000db000080-0x[[:xdigit:]]+,v1,starfive/dubhe-80,core +0x67e-0x80000000db0000[89]0-0x[[:xdigit:]]+,v1,starfive/dubhe-80,core -- 2.25.1