Re: [PATCH] Add performance monitoring unit extension


Anup Patel
 

Hi Brian,

 

Sure, I will include an explicit statement about “SBI PMU extension providing a perf compatible event …” (like you suggested).

 

Regards,

Anup

 

From: tech-unixplatformspec@... <tech-unixplatformspec@...> On Behalf Of Brian Grayson
Sent: 27 October 2020 02:15
To: Anup Patel <Anup.Patel@...>
Cc: tech-unixplatformspec@...; Atish Patra <Atish.Patra@...>; Al Stone <ahs3@...>
Subject: Re: [RISC-V] [tech-unixplatformspec] [PATCH] Add performance monitoring unit extension

 

On Mon, Oct 26, 2020 at 8:42 AM Anup Patel <anup.patel@...> wrote:

This patch adds SBI performance monitoring unit (PMU) extension which
allows S-mode (or VS-mode) software to configure HARDWARE/SOFTWARE
performance counters with help of M-mode (or HS-mode) software.

... 

+The SBI PMU extension will help S-mode (or VS-mode) SOFTWARE to discover
+and configure per-HART HARDWARE/SOFTWARE counters. Using SBI PMU extension,
+a SBI implementation will provide a standardized view of HARDWARE/SOFTWARE
+counters and events to S-mode (or VS-mode) SOFTWARE.

 

I would suggest something here like this, because I see three different modes of use, and they are mentioned further down but in passing, but not as explicitly as this. I know that personally my use-case would almost always require using the RAW encoding to pass through full event numbers, rather than the preordained perf view:

 

"The SBI PMU extension provides a typical "perf" <<insert link here>> compatible event interface, and also provides full access to the microarchitecture's raw event encodings, as well as access to software events."

 

+
+To define SBI PMU extension calls, we first define important entities
+`counter_idx`, `event_idx`, and `event_info`. The `counter_idx` is a
+logical number assigned to each HARDWARE/SOFTWARE counter. The `event_idx`
+represents a HARDWARE/SOFTWARE event whereas the `event_info` represents
+additional configuration or parameters for the HARDWARE/SOFTWARE event.

Join {tech-unixplatformspec@lists.riscv.org to automatically receive all group messages.