From: Rob Herring <robh@kernel.org> To: Mark Rutland <mark.rutland@arm.com> Cc: Will Deacon <will@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Catalin Marinas <catalin.marinas@arm.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>, Kan Liang <kan.liang@linux.intel.com>, Ian Rogers <irogers@google.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>, Zachary.Leaf@arm.com, Raphael Gault <raphael.gault@arm.com>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Namhyung Kim <namhyung@kernel.org>, Itaru Kitayama <itaru.kitayama@gmail.com>, Vince Weaver <vincent.weaver@maine.edu>, linux-arm-kernel <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, linux-perf-users@vger.kernel.org Subject: Re: [PATCH v10 4/5] arm64: perf: Enable PMU counter userspace access for perf event Date: Fri, 15 Oct 2021 10:53:15 -0500 [thread overview] Message-ID: <CAL_JsqJHfpcvKekEFm-d7rMJ=UNc7dXwfaMMkUWZYsnPg=QNPQ@mail.gmail.com> (raw) In-Reply-To: <20211014165810.GA39276@lakrids.cambridge.arm.com> On Thu, Oct 14, 2021 at 11:58 AM Mark Rutland <mark.rutland@arm.com> wrote: > > Hi Rob, > > This looks pretty good! > > I have one largish query below, and otherwise only trivialities that I'm > happy to fix up. > > On Tue, Sep 14, 2021 at 03:47:59PM -0500, Rob Herring wrote: [...] > > static inline bool armv8pmu_event_is_chained(struct perf_event *event) > > { > > int idx = event->hw.idx; > > struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); > > > > - return !WARN_ON(idx < 0) && > > + return !(event->hw.flags & PERF_EVENT_FLAG_USER_READ_CNT) && > > armv8pmu_event_is_64bit(event) && > > !armv8pmu_has_long_event(cpu_pmu) && > > (idx != ARMV8_IDX_CYCLE_COUNTER); > > @@ -720,6 +726,27 @@ static inline u32 armv8pmu_getreset_flags(void) > > return value; > > Above this, could we please add: > > | static inline bool armv8pmu_event_has_user_read(struct perf_event *event) > | { > | return event->hw.flags & PERF_EVENT_FLAG_USER_READ_CNT; > | } > > ... and use that where we look at PERF_EVENT_FLAG_USER_READ_CNT? Sure, but as this is a common flag now, I should probably make that a common function in linux/perf_event.h and have x86 code use it too. Rob
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org> To: Mark Rutland <mark.rutland@arm.com> Cc: Will Deacon <will@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Catalin Marinas <catalin.marinas@arm.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>, Kan Liang <kan.liang@linux.intel.com>, Ian Rogers <irogers@google.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>, Zachary.Leaf@arm.com, Raphael Gault <raphael.gault@arm.com>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Namhyung Kim <namhyung@kernel.org>, Itaru Kitayama <itaru.kitayama@gmail.com>, Vince Weaver <vincent.weaver@maine.edu>, linux-arm-kernel <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, linux-perf-users@vger.kernel.org Subject: Re: [PATCH v10 4/5] arm64: perf: Enable PMU counter userspace access for perf event Date: Fri, 15 Oct 2021 10:53:15 -0500 [thread overview] Message-ID: <CAL_JsqJHfpcvKekEFm-d7rMJ=UNc7dXwfaMMkUWZYsnPg=QNPQ@mail.gmail.com> (raw) In-Reply-To: <20211014165810.GA39276@lakrids.cambridge.arm.com> On Thu, Oct 14, 2021 at 11:58 AM Mark Rutland <mark.rutland@arm.com> wrote: > > Hi Rob, > > This looks pretty good! > > I have one largish query below, and otherwise only trivialities that I'm > happy to fix up. > > On Tue, Sep 14, 2021 at 03:47:59PM -0500, Rob Herring wrote: [...] > > static inline bool armv8pmu_event_is_chained(struct perf_event *event) > > { > > int idx = event->hw.idx; > > struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); > > > > - return !WARN_ON(idx < 0) && > > + return !(event->hw.flags & PERF_EVENT_FLAG_USER_READ_CNT) && > > armv8pmu_event_is_64bit(event) && > > !armv8pmu_has_long_event(cpu_pmu) && > > (idx != ARMV8_IDX_CYCLE_COUNTER); > > @@ -720,6 +726,27 @@ static inline u32 armv8pmu_getreset_flags(void) > > return value; > > Above this, could we please add: > > | static inline bool armv8pmu_event_has_user_read(struct perf_event *event) > | { > | return event->hw.flags & PERF_EVENT_FLAG_USER_READ_CNT; > | } > > ... and use that where we look at PERF_EVENT_FLAG_USER_READ_CNT? Sure, but as this is a common flag now, I should probably make that a common function in linux/perf_event.h and have x86 code use it too. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-10-15 15:53 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-14 20:47 [PATCH v10 0/5] arm64 userspace counter support Rob Herring 2021-09-14 20:47 ` Rob Herring 2021-09-14 20:47 ` [PATCH v10 1/5] x86: perf: Move RDPMC event flag to a common definition Rob Herring 2021-09-14 20:47 ` Rob Herring 2021-10-13 17:25 ` Mark Rutland 2021-10-13 17:25 ` Mark Rutland 2021-09-14 20:47 ` [PATCH v10 2/5] perf: Add a counter for number of user access events in context Rob Herring 2021-09-14 20:47 ` Rob Herring 2021-10-13 17:26 ` Mark Rutland 2021-10-13 17:26 ` Mark Rutland 2021-09-14 20:47 ` [PATCH v10 3/5] arm64: perf: Add userspace counter access disable switch Rob Herring 2021-09-14 20:47 ` Rob Herring 2021-10-13 17:30 ` Mark Rutland 2021-10-13 17:30 ` Mark Rutland 2021-09-14 20:47 ` [PATCH v10 4/5] arm64: perf: Enable PMU counter userspace access for perf event Rob Herring 2021-09-14 20:47 ` Rob Herring 2021-10-14 16:58 ` Mark Rutland 2021-10-14 16:58 ` Mark Rutland 2021-10-14 19:24 ` Rob Herring 2021-10-14 19:24 ` Rob Herring 2021-10-19 15:28 ` Mark Rutland 2021-10-19 15:28 ` Mark Rutland 2021-10-15 15:53 ` Rob Herring [this message] 2021-10-15 15:53 ` Rob Herring 2021-09-14 20:48 ` [PATCH v10 5/5] Documentation: arm64: Document PMU counters access from userspace Rob Herring 2021-09-14 20:48 ` Rob Herring 2021-09-27 20:46 ` [PATCH v10 0/5] arm64 userspace counter support Rob Herring 2021-09-27 20:46 ` Rob Herring 2021-10-13 17:32 ` Mark Rutland 2021-10-13 17:32 ` Mark Rutland
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='CAL_JsqJHfpcvKekEFm-d7rMJ=UNc7dXwfaMMkUWZYsnPg=QNPQ@mail.gmail.com' \ --to=robh@kernel.org \ --cc=Jonathan.Cameron@huawei.com \ --cc=Zachary.Leaf@arm.com \ --cc=acme@kernel.org \ --cc=alexander.shishkin@linux.intel.com \ --cc=catalin.marinas@arm.com \ --cc=honnappa.nagarahalli@arm.com \ --cc=irogers@google.com \ --cc=itaru.kitayama@gmail.com \ --cc=jolsa@redhat.com \ --cc=kan.liang@linux.intel.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-perf-users@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=mingo@redhat.com \ --cc=namhyung@kernel.org \ --cc=peterz@infradead.org \ --cc=raphael.gault@arm.com \ --cc=vincent.weaver@maine.edu \ --cc=will@kernel.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: linkBe 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.