RISC-V: Added generic pmu-events mapfile
authorJoão Mário Domingos <joao.mario@tecnico.ulisboa.pt>
Tue, 16 Nov 2021 15:48:11 +0000 (15:48 +0000)
committerminda.chen <minda.chen@starfivetech.com>
Tue, 3 Jan 2023 06:26:18 +0000 (14:26 +0800)
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 <joao.mario@tecnico.ulisboa.pt>
tools/perf/pmu-events/arch/riscv/mapfile.csv [new file with mode: 0644]
tools/perf/pmu-events/arch/riscv/riscv-generic.json [new file with mode: 0644]

diff --git a/tools/perf/pmu-events/arch/riscv/mapfile.csv b/tools/perf/pmu-events/arch/riscv/mapfile.csv
new file mode 100644 (file)
index 0000000..4f2aa19
--- /dev/null
@@ -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 (file)
index 0000000..013e50e
--- /dev/null
@@ -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