From: Nikita Shubin <nikita.shubin@maquefel.me>
To: Atish Patra <atishp@atishpatra.org>
Cc: "Anup Patel" <anup@brainfault.org>,
"João Mário Domingos" <joao.mario@tecnico.ulisboa.pt>,
linux <linux@yadro.com>, "Nikita Shubin" <n.shubin@yadro.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Jiri Olsa" <jolsa@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"linux-kernel@vger.kernel.org List"
<linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org,
linux-riscv <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v4 3/5] perf arch events: riscv arch std event files
Date: Sat, 25 Jun 2022 08:32:53 +0300 [thread overview]
Message-ID: <20220625083253.61b3e0db@redslave.neermore.group> (raw)
In-Reply-To: <CAOnJCU+B+dXXhqL6CYRG7Lhr_QWwyxrDZdGZG6HphnTEE9o5Mw@mail.gmail.com>
Hello Atish!
On Fri, 24 Jun 2022 10:01:07 -0700
Atish Patra <atishp@atishpatra.org> wrote:
> On Fri, Jun 24, 2022 at 9:01 AM Nikita Shubin
> <nikita.shubin@maquefel.me> wrote:
> >
> > From: Nikita Shubin <n.shubin@yadro.com>
> >
> > cycles, time and instret counters are defined by RISC-V privileged
> > spec and they should be available on any RISC-V implementation,
> > epose them to arch std event files, so they can be reused by
> > particular PMU bindings.
> >
> > Derived-from-code-by: João Mário Domingos
> > <joao.mario@tecnico.ulisboa.pt> Signed-off-by: Nikita Shubin
> > <n.shubin@yadro.com>
>
> Why do we need this ? The PMU driver already parses the standard perf
> events. So you can pass -e cycles -e instructions.
>
> Even though time is described as a counter and accessibility
> controlled by mcounteren, you can not start/stop it (no bit in
> mcountinhibit).
> Thus, it can't be used from perf.
My first thought was that we can use cycle, time, instret on any RISC-V
platform even without any bindings, but as you pointed out it's
indeed useless.
I'll drop this one.
>
> > ---
> > .../pmu-events/arch/riscv/riscv-generic.json | 20
> > +++++++++++++++++++ 1 file changed, 20 insertions(+)
> > create mode 100644
> > tools/perf/pmu-events/arch/riscv/riscv-generic.json
> >
> > 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..a7ffbe87a0f7
> > --- /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"
> > + }
> > +]
> > --
> > 2.35.1
> >
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Nikita Shubin <nikita.shubin@maquefel.me>
To: Atish Patra <atishp@atishpatra.org>
Cc: "Anup Patel" <anup@brainfault.org>,
"João Mário Domingos" <joao.mario@tecnico.ulisboa.pt>,
linux <linux@yadro.com>, "Nikita Shubin" <n.shubin@yadro.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Jiri Olsa" <jolsa@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"linux-kernel@vger.kernel.org List"
<linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org,
linux-riscv <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v4 3/5] perf arch events: riscv arch std event files
Date: Sat, 25 Jun 2022 08:32:53 +0300 [thread overview]
Message-ID: <20220625083253.61b3e0db@redslave.neermore.group> (raw)
In-Reply-To: <CAOnJCU+B+dXXhqL6CYRG7Lhr_QWwyxrDZdGZG6HphnTEE9o5Mw@mail.gmail.com>
Hello Atish!
On Fri, 24 Jun 2022 10:01:07 -0700
Atish Patra <atishp@atishpatra.org> wrote:
> On Fri, Jun 24, 2022 at 9:01 AM Nikita Shubin
> <nikita.shubin@maquefel.me> wrote:
> >
> > From: Nikita Shubin <n.shubin@yadro.com>
> >
> > cycles, time and instret counters are defined by RISC-V privileged
> > spec and they should be available on any RISC-V implementation,
> > epose them to arch std event files, so they can be reused by
> > particular PMU bindings.
> >
> > Derived-from-code-by: João Mário Domingos
> > <joao.mario@tecnico.ulisboa.pt> Signed-off-by: Nikita Shubin
> > <n.shubin@yadro.com>
>
> Why do we need this ? The PMU driver already parses the standard perf
> events. So you can pass -e cycles -e instructions.
>
> Even though time is described as a counter and accessibility
> controlled by mcounteren, you can not start/stop it (no bit in
> mcountinhibit).
> Thus, it can't be used from perf.
My first thought was that we can use cycle, time, instret on any RISC-V
platform even without any bindings, but as you pointed out it's
indeed useless.
I'll drop this one.
>
> > ---
> > .../pmu-events/arch/riscv/riscv-generic.json | 20
> > +++++++++++++++++++ 1 file changed, 20 insertions(+)
> > create mode 100644
> > tools/perf/pmu-events/arch/riscv/riscv-generic.json
> >
> > 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..a7ffbe87a0f7
> > --- /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"
> > + }
> > +]
> > --
> > 2.35.1
> >
>
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2022-06-25 5:33 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 16:00 [PATCH v4 0/5] RISC-V: Create unique identification for SoC PMU Nikita Shubin
2022-06-24 16:00 ` Nikita Shubin
2022-06-24 16:00 ` Nikita Shubin
2022-06-24 16:00 ` [PATCH v4 1/5] drivers/perf: riscv_pmu_sbi: perf format Nikita Shubin
2022-06-24 16:00 ` Nikita Shubin
2022-06-24 16:00 ` Nikita Shubin
2022-06-24 16:51 ` Atish Patra
2022-06-24 16:51 ` Atish Patra
2022-06-24 16:51 ` Atish Patra
2022-06-27 10:56 ` Will Deacon
2022-06-27 10:56 ` Will Deacon
2022-06-27 10:56 ` Will Deacon
2022-06-24 16:00 ` [PATCH v4 2/5] perf tools riscv: Add support for get_cpuid_str function Nikita Shubin
2022-06-24 16:00 ` Nikita Shubin
2022-06-24 16:32 ` Arnaldo Carvalho de Melo
2022-06-24 16:32 ` Arnaldo Carvalho de Melo
2022-06-25 5:28 ` Nikita Shubin
2022-06-25 5:28 ` Nikita Shubin
2022-06-24 16:00 ` [PATCH v4 3/5] perf arch events: riscv arch std event files Nikita Shubin
2022-06-24 16:00 ` Nikita Shubin
2022-06-24 17:01 ` Atish Patra
2022-06-24 17:01 ` Atish Patra
2022-06-25 5:32 ` Nikita Shubin [this message]
2022-06-25 5:32 ` Nikita Shubin
2022-06-24 16:00 ` [PATCH v4 4/5] perf arch events: riscv sbi firmware " Nikita Shubin
2022-06-24 16:00 ` Nikita Shubin
2022-06-24 16:00 ` [PATCH v4 5/5] perf vendor events riscv: add Sifive U74 JSON file Nikita Shubin
2022-06-24 16:00 ` Nikita Shubin
2022-06-24 17:05 ` [PATCH v4 0/5] RISC-V: Create unique identification for SoC PMU Atish Patra
2022-06-24 17:05 ` Atish Patra
2022-06-24 17:05 ` Atish Patra
2022-06-25 5:39 ` Nikita Shubin
2022-06-25 5:39 ` Nikita Shubin
2022-06-25 5:39 ` Nikita Shubin
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=20220625083253.61b3e0db@redslave.neermore.group \
--to=nikita.shubin@maquefel.me \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atishp@atishpatra.org \
--cc=joao.mario@tecnico.ulisboa.pt \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@yadro.com \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=n.shubin@yadro.com \
--cc=namhyung@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterz@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.