From patchwork Tue Jun 7 13:16:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nikita Shubin X-Patchwork-Id: 12871916 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB354C43334 for ; Tue, 7 Jun 2022 13:17:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZPqD49XboQ2iLU21JlJQAlUoj8hilPyrQkTxZAnJdl0=; b=qMX2HFJV6zh9Pp pQbVKOOX7G89zsxUc+ky/XtQsZ2Q54vtNEqEEd/gUbomOoWiGsIYR9P3SOtGzvxbTI0XpCpXETMrD SKrCynQ4gdW2lO04CZUeLedgN+3XA3wai9eVCSICwqnR9j7Dwqx9Sofnu9dIt7GJBcrPFT/Xjo4Pr zFBZo84283SIBWMUrLAHZK5wzs/fIyS3g2OHsDUsSIw+MZsa4qvCWsaKwEKsQg0zEuLdaaxZ3Hh5s vfy0pzsG/BlLlvlj+855DHazyuLWvzbbSRsYAFGrEpHNyIyaloddJ3/nebei4or6aM/OGwfwIDW3J UU5J+yEy/WO+tvxRS6kQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyZ5d-007csv-G2; Tue, 07 Jun 2022 13:17:45 +0000 Received: from forward501o.mail.yandex.net ([2a02:6b8:0:1a2d::611]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyZ5H-007cXR-RC for linux-riscv@lists.infradead.org; Tue, 07 Jun 2022 13:17:26 +0000 Received: from myt5-a76c7b0c543c.qloud-c.yandex.net (myt5-a76c7b0c543c.qloud-c.yandex.net [IPv6:2a02:6b8:c12:2908:0:640:a76c:7b0c]) by forward501o.mail.yandex.net (Yandex) with ESMTP id F3ED745C4C8B; Tue, 7 Jun 2022 16:17:06 +0300 (MSK) Received: from myt6-654ec0a0ab93.qloud-c.yandex.net (myt6-654ec0a0ab93.qloud-c.yandex.net [2a02:6b8:c12:1d80:0:640:654e:c0a0]) by myt5-a76c7b0c543c.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 0JqJ9qHZUZ-H6fOeVsZ; Tue, 07 Jun 2022 16:17:06 +0300 X-Yandex-Fwd: 2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1654607826; bh=H5ZJSB+X5ZPk+u9IuwBsHvhkdVj5IngYfZMVK2pBn+Q=; h=In-Reply-To:References:Date:Subject:Cc:To:From:Message-Id; b=nYhgRjYg+zJOPmbF47oV3H7hZ0cLH7P5Uk6Ki6HcvRMzoaJb0SsL1tRVTCoW953Q6 yfG5q9/auzw8JMI3gNKAPFT+Rp/Zb4YWDXcPQkaRSI2h8d7QRw56mBlOg2TUpKWqkr 4YwbpAkC8jkQv7KTU6thzeGxEKvPmGsZsaAnSR2s= Authentication-Results: myt5-a76c7b0c543c.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Received: by myt6-654ec0a0ab93.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id sOXgg17Zrk-H5M4o90G; Tue, 07 Jun 2022 16:17:05 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Nikita Shubin To: Cc: Genevieve Chan , =?utf-8?b?Sm/Do28gTcOh?= =?utf-8?b?cmlvIERvbWluZ29z?= , Nikita Shubin , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-kernel@vger.kernel.org (open list), linux-perf-users@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), linux-riscv@lists.infradead.org (open list:RISC-V ARCHITECTURE) Subject: [PATCH v3 3/4] RISC-V: Added generic pmu-events mapfile Date: Tue, 7 Jun 2022 16:16:46 +0300 Message-Id: <20220607131648.29439-4-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220607131648.29439-1-nikita.shubin@maquefel.me> References: <20220607131648.29439-1-nikita.shubin@maquefel.me> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_061724_348695_5862B7D4 X-CRM114-Status: GOOD ( 13.08 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: João Mário Domingos The pmu-events now supports custom events for RISC-V, plus the cycle, time and instret events were defined. Signed-off-by: João Mário Domingos Tested-by: Nikita Shubin --- tools/perf/pmu-events/arch/riscv/mapfile.csv | 14 +++++++++++++ .../pmu-events/arch/riscv/riscv-generic.json | 20 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tools/perf/pmu-events/arch/riscv/mapfile.csv create mode 100644 tools/perf/pmu-events/arch/riscv/riscv-generic.json diff --git a/tools/perf/pmu-events/arch/riscv/mapfile.csv b/tools/perf/pmu-events/arch/riscv/mapfile.csv new file mode 100644 index 000000000000..4f2aa199d9cb --- /dev/null +++ b/tools/perf/pmu-events/arch/riscv/mapfile.csv @@ -0,0 +1,14 @@ +# Format: +# MIDR,Version,JSON/file/pathname,Type +# +# where +# MIDR Processor version +# Variant[23:20] and Revision [3:0] should be zero. +# Version could be used to track version of JSON file +# but currently unused. +# JSON/file/pathname is the path to JSON file, relative +# to tools/perf/pmu-events/arch/riscv/. +# Type is core, uncore etc +# +# +#Family-model,Version,Filename,EventType diff --git a/tools/perf/pmu-events/arch/riscv/riscv-generic.json b/tools/perf/pmu-events/arch/riscv/riscv-generic.json new file mode 100644 index 000000000000..013e50efad99 --- /dev/null +++ b/tools/perf/pmu-events/arch/riscv/riscv-generic.json @@ -0,0 +1,20 @@ +[ + { + "PublicDescription": "CPU Cycles", + "EventCode": "0x00", + "EventName": "riscv_cycles", + "BriefDescription": "CPU cycles RISC-V generic counter" + }, + { + "PublicDescription": "CPU Time", + "EventCode": "0x01", + "EventName": "riscv_time", + "BriefDescription": "CPU time RISC-V generic counter" + }, + { + "PublicDescription": "CPU Instructions", + "EventCode": "0x02", + "EventName": "riscv_instret", + "BriefDescription": "CPU retired instructions RISC-V generic counter" + } +] \ No newline at end of file