linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Atish Patra <atishp@rivosinc.com>
To: linux-kernel@vger.kernel.org
Cc: "Atish Patra" <atishp@rivosinc.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Alexandre Ghiti" <alexghiti@rivosinc.com>,
	"Andrew Jones" <ajones@ventanamicro.com>,
	"Anup Patel" <anup@brainfault.org>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Atish Patra" <atishp@atishpatra.org>,
	"Christian Brauner" <brauner@kernel.org>,
	"Clément Léger" <cleger@rivosinc.com>,
	"Conor Dooley" <conor@kernel.org>,
	devicetree@vger.kernel.org, "Evan Green" <evan@rivosinc.com>,
	"Guo Ren" <guoren@kernel.org>, "Heiko Stuebner" <heiko@sntech.de>,
	"Ian Rogers" <irogers@google.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"James Clark" <james.clark@arm.com>,
	"Jing Zhang" <renyu.zj@linux.alibaba.com>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Ji Sheng Teoh" <jisheng.teoh@starfivetech.com>,
	"John Garry" <john.g.garry@oracle.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Kan Liang" <kan.liang@linux.intel.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	kvm-riscv@lists.infradead.org, kvm@vger.kernel.org,
	"Ley Foon Tan" <leyfoon.tan@starfivetech.com>,
	linux-doc@vger.kernel.org, linux-perf-users@vger.kernel.org,
	linux-riscv@lists.infradead.org,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Samuel Holland" <samuel.holland@sifive.com>,
	"Weilin Wang" <weilin.wang@intel.com>,
	"Will Deacon" <will@kernel.org>,
	kaiwenxue1@gmail.com, "Yang Jihong" <yangjihong1@huawei.com>
Subject: [PATCH RFC 17/20] perf: Add json file for virt machine supported events
Date: Fri, 16 Feb 2024 16:57:35 -0800	[thread overview]
Message-ID: <20240217005738.3744121-18-atishp@rivosinc.com> (raw)
In-Reply-To: <20240217005738.3744121-1-atishp@rivosinc.com>

The linux driver will use the event encodings specified in platform
specific json file only for platforms with counter delegation support.

Use the perf json infrastructure to encode those events and let the
driver uses that if counter delegation is available.

Signed-off-by: Atish Patra <atishp@rivosinc.com>
---
 tools/perf/pmu-events/arch/riscv/mapfile.csv  |  1 +
 .../pmu-events/arch/riscv/qemu/virt/cpu.json  | 30 ++++++++
 .../arch/riscv/qemu/virt/firmware.json        | 68 +++++++++++++++++++
 3 files changed, 99 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/riscv/qemu/virt/cpu.json
 create mode 100644 tools/perf/pmu-events/arch/riscv/qemu/virt/firmware.json

diff --git a/tools/perf/pmu-events/arch/riscv/mapfile.csv b/tools/perf/pmu-events/arch/riscv/mapfile.csv
index cfc449b19810..b3e7d544e29c 100644
--- a/tools/perf/pmu-events/arch/riscv/mapfile.csv
+++ b/tools/perf/pmu-events/arch/riscv/mapfile.csv
@@ -17,3 +17,4 @@
 0x489-0x8000000000000007-0x[[:xdigit:]]+,v1,sifive/u74,core
 0x5b7-0x0-0x0,v1,thead/c900-legacy,core
 0x67e-0x80000000db0000[89]0-0x[[:xdigit:]]+,v1,starfive/dubhe-80,core
+0x0-0x0-0x0,v1,qemu/virt,core
diff --git a/tools/perf/pmu-events/arch/riscv/qemu/virt/cpu.json b/tools/perf/pmu-events/arch/riscv/qemu/virt/cpu.json
new file mode 100644
index 000000000000..9ab631723c88
--- /dev/null
+++ b/tools/perf/pmu-events/arch/riscv/qemu/virt/cpu.json
@@ -0,0 +1,30 @@
+[
+  {
+    "ArchStdEvent": "instructions",
+    "EventCode": "0x02",
+    "Counter":"2,3,4,5,6,7,8,9,10"
+  },
+  {
+    "ArchStdEvent": "cycles",
+    "EventCode": "0x01",
+    "Counter":"0,3,4,5,6,7,8,9,10"
+  },
+  {
+    "EventName": "dTLB-load-misses",
+    "EventCode": "0x10019",
+    "BriefDescription": "Data TLB load miss",
+    "Counter":"3,4,5,6,7,8,9,10"
+  },
+  {
+    "EventName": "dTLB-store-misses",
+    "EventCode": "0x1001B",
+    "BriefDescription": "Data TLB store miss",
+    "Counter":"3,4,5,6,7,8,9,10"
+  },
+  {
+    "EventName": "iTLB-load-misses",
+    "EventCode": "0x10021",
+    "BriefDescription": "Instruction fetch TLB load miss",
+    "Counter":"3,4,5,6,7,8,9,10"
+  }
+]
diff --git a/tools/perf/pmu-events/arch/riscv/qemu/virt/firmware.json b/tools/perf/pmu-events/arch/riscv/qemu/virt/firmware.json
new file mode 100644
index 000000000000..9b4a032186a7
--- /dev/null
+++ b/tools/perf/pmu-events/arch/riscv/qemu/virt/firmware.json
@@ -0,0 +1,68 @@
+[
+  {
+    "ArchStdEvent": "FW_MISALIGNED_LOAD"
+  },
+  {
+    "ArchStdEvent": "FW_MISALIGNED_STORE"
+  },
+  {
+    "ArchStdEvent": "FW_ACCESS_LOAD"
+  },
+  {
+    "ArchStdEvent": "FW_ACCESS_STORE"
+  },
+  {
+    "ArchStdEvent": "FW_ILLEGAL_INSN"
+  },
+  {
+    "ArchStdEvent": "FW_SET_TIMER"
+  },
+  {
+    "ArchStdEvent": "FW_IPI_SENT"
+  },
+  {
+    "ArchStdEvent": "FW_IPI_RECEIVED"
+  },
+  {
+    "ArchStdEvent": "FW_FENCE_I_SENT"
+  },
+  {
+    "ArchStdEvent": "FW_FENCE_I_RECEIVED"
+  },
+  {
+    "ArchStdEvent": "FW_SFENCE_VMA_SENT"
+  },
+  {
+    "ArchStdEvent": "FW_SFENCE_VMA_RECEIVED"
+  },
+  {
+    "ArchStdEvent": "FW_SFENCE_VMA_RECEIVED"
+  },
+  {
+    "ArchStdEvent": "FW_SFENCE_VMA_ASID_RECEIVED"
+  },
+  {
+    "ArchStdEvent": "FW_HFENCE_GVMA_SENT"
+  },
+  {
+    "ArchStdEvent": "FW_HFENCE_GVMA_RECEIVED"
+  },
+  {
+    "ArchStdEvent": "FW_HFENCE_GVMA_VMID_SENT"
+  },
+  {
+    "ArchStdEvent": "FW_HFENCE_GVMA_VMID_RECEIVED"
+  },
+  {
+    "ArchStdEvent": "FW_HFENCE_VVMA_SENT"
+  },
+  {
+    "ArchStdEvent": "FW_HFENCE_VVMA_RECEIVED"
+  },
+  {
+    "ArchStdEvent": "FW_HFENCE_VVMA_ASID_SENT"
+  },
+  {
+    "ArchStdEvent": "FW_HFENCE_VVMA_ASID_RECEIVED"
+  }
+]
-- 
2.34.1


  parent reply	other threads:[~2024-02-17  0:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17  0:57 [PATCH RFC 00/20] Add Counter delegation ISA extension support Atish Patra
2024-02-17  0:57 ` [PATCH RFC 01/20] perf pmu-events: Add functions in jevent.py to parse counter and event info for hardware aware grouping Atish Patra
2024-02-17  0:57 ` [PATCH RFC 02/20] RISC-V: Add Sxcsrind ISA extension CSR definitions Atish Patra
2024-02-17  0:57 ` [PATCH RFC 03/20] RISC-V: Add Sxcsrind ISA extension definition and parsing Atish Patra
2024-02-17  0:57 ` [PATCH RFC 04/20] dt-bindings: riscv: add Sxcsrind ISA extension description Atish Patra
2024-02-18 12:47   ` Conor Dooley
2024-02-17  0:57 ` [PATCH RFC 05/20] RISC-V: Define indirect CSR access helpers Atish Patra
2024-02-17  0:57 ` [PATCH RFC 06/20] RISC-V: Add Sscfg extension CSR definition Atish Patra
2024-02-17  0:57 ` [PATCH RFC 07/20] RISC-V: Add Ssccfg ISA extension definition and parsing Atish Patra
2024-02-17  0:57 ` [PATCH RFC 08/20] dt-bindings: riscv: add Ssccfg ISA extension description Atish Patra
2024-02-17  2:33   ` Rob Herring
2024-02-17  0:57 ` [PATCH RFC 09/20] RISC-V: Add Smcntrpmf extension parsing Atish Patra
2024-02-18 12:50   ` Conor Dooley
2024-02-17  0:57 ` [PATCH RFC 10/20] dt-bindings: riscv: add Smcntrpmf ISA extension description Atish Patra
2024-02-17  2:33   ` Rob Herring
2024-02-17  0:57 ` [PATCH RFC 11/20] RISC-V: perf: Restructure the SBI PMU code Atish Patra
2024-02-17  0:57 ` [PATCH RFC 12/20] RISC-V: perf: Modify the counter discovery mechanism Atish Patra
2024-02-17  0:57 ` [PATCH RFC 13/20] RISC-V: perf: Implement supervisor counter delegation support Atish Patra
2024-02-17  0:57 ` [PATCH RFC 14/20] RISC-V: perf: Use config2 for event to counter mapping Atish Patra
2024-02-17  0:57 ` [PATCH RFC 15/20] tools/perf: Add arch hooks to override perf standard events Atish Patra
2024-02-17  0:57 ` [PATCH RFC 16/20] tools/perf: Pass the Counter constraint values in the pmu events Atish Patra
2024-02-17  0:57 ` Atish Patra [this message]
2024-02-17  0:57 ` [PATCH RFC 18/20] tools arch uapi: Sync the uinstd.h header file for RISC-V Atish Patra
2024-02-17  0:57 ` [PATCH RFC 19/20] RISC-V: Add hwprobe support for Counter delegation extensions Atish Patra
2024-02-17  0:57 ` [PATCH RFC 20/20] tools/perf: Detect if platform supports counter delegation Atish Patra
2024-02-17 20:28 ` [PATCH RFC 00/20] Add Counter delegation ISA extension support Ian Rogers
2024-02-29  1:25   ` Atish Patra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240217005738.3744121-18-atishp@rivosinc.com \
    --to=atishp@rivosinc.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ajones@ventanamicro.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexghiti@rivosinc.com \
    --cc=anup@brainfault.org \
    --cc=atishp@atishpatra.org \
    --cc=brauner@kernel.org \
    --cc=cleger@rivosinc.com \
    --cc=conor@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=evan@rivosinc.com \
    --cc=guoren@kernel.org \
    --cc=heiko@sntech.de \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jisheng.teoh@starfivetech.com \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=kaiwenxue1@gmail.com \
    --cc=kan.liang@linux.intel.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=leyfoon.tan@starfivetech.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterz@infradead.org \
    --cc=renyu.zj@linux.alibaba.com \
    --cc=robh+dt@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=weilin.wang@intel.com \
    --cc=will@kernel.org \
    --cc=yangjihong1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).