From: Anshuman Khandual <anshuman.khandual@arm.com>
To: James Clark <james.clark@arm.com>
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Marc Zyngier <maz@kernel.org>,
Suzuki Poulose <suzuki.poulose@arm.com>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, peterz@infradead.org,
acme@kernel.org, mark.rutland@arm.com, will@kernel.org,
catalin.marinas@arm.com
Subject: Re: [PATCH V4 6/7] arm64/perf: Add BRBE driver
Date: Mon, 7 Nov 2022 08:11:28 +0530 [thread overview]
Message-ID: <a3e223bb-fdfa-4acc-a2f0-c12cd585e1a6@arm.com> (raw)
In-Reply-To: <c5585dd1-4491-c48d-311d-ddc27aaa01a3@arm.com>
On 11/2/22 21:06, James Clark wrote:
>
> On 17/10/2022 06:57, Anshuman Khandual wrote:
>> This adds a BRBE driver which implements all the required helper functions
>> for struct arm_pmu. Following functions are defined by this driver which
>> will configure, enable, capture, reset and disable BRBE buffer HW as and
>> when requested via perf branch stack sampling framework.
>>
>> - arm64_pmu_brbe_filter()
>> - arm64_pmu_brbe_enable()
>> - arm64_pmu_brbe_disable()
>> - arm64_pmu_brbe_read()
>> - arm64_pmu_brbe_probe()
>> - arm64_pmu_brbe_reset()
>> - arm64_pmu_brbe_supported()
>>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: Will Deacon <will@kernel.org>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-perf-users@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>> ---
>> arch/arm64/kernel/perf_event.c | 8 +-
>> drivers/perf/Kconfig | 11 +
>> drivers/perf/Makefile | 1 +
>> drivers/perf/arm_pmu_brbe.c | 441 +++++++++++++++++++++++++++++++++
>> drivers/perf/arm_pmu_brbe.h | 259 +++++++++++++++++++
>> include/linux/perf/arm_pmu.h | 20 ++
>> 6 files changed, 739 insertions(+), 1 deletion(-)
>> create mode 100644 drivers/perf/arm_pmu_brbe.c
>> create mode 100644 drivers/perf/arm_pmu_brbe.h
>>
>> diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
>> index 97db333d1208..85a3aaefc0fb 100644
>> --- a/arch/arm64/kernel/perf_event.c
>> +++ b/arch/arm64/kernel/perf_event.c
>> @@ -1034,31 +1034,37 @@ static int armv8pmu_filter_match(struct perf_event *event)
>>
>> static void armv8pmu_brbe_filter(struct pmu_hw_events *hw_event, struct perf_event *event)
>> {
>> + arm64_pmu_brbe_filter(hw_event, event);
>> }
>>
>> static void armv8pmu_brbe_enable(struct pmu_hw_events *hw_event)
>> {
>> + arm64_pmu_brbe_enable(hw_event);
>> }
>>
>> static void armv8pmu_brbe_disable(struct pmu_hw_events *hw_event)
>> {
>> + arm64_pmu_brbe_disable(hw_event);
>> }
>>
>> static void armv8pmu_brbe_read(struct pmu_hw_events *hw_event, struct perf_event *event)
>> {
>> + arm64_pmu_brbe_read(hw_event, event);
>> }
>>
>> static void armv8pmu_brbe_probe(struct pmu_hw_events *hw_event)
>> {
>> + arm64_pmu_brbe_probe(hw_event);
>> }
>>
>> static void armv8pmu_brbe_reset(struct pmu_hw_events *hw_event)
>> {
>> + arm64_pmu_brbe_reset(hw_event);
>> }
>>
>> static bool armv8pmu_brbe_supported(struct perf_event *event)
>> {
>> - return false;
>> + return arm64_pmu_brbe_supported(event);
>> }
>>
>> static void armv8pmu_reset(void *info)
>> diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
>> index 341010f20b77..4efd0a77c5ff 100644
>> --- a/drivers/perf/Kconfig
>> +++ b/drivers/perf/Kconfig
>> @@ -190,6 +190,17 @@ config ALIBABA_UNCORE_DRW_PMU
>> Support for Driveway PMU events monitoring on Yitian 710 DDR
>> Sub-system.
>>
>> +config ARM_BRBE_PMU
>> + tristate "Enable support for Branch Record Buffer Extension (BRBE)"
> Hi Anshuman,
>
> I get a few build errors if this is enabled as a module, and it's
> missing the module boilerplate stuff. I'm wondering if tristate is a
> mistake and it's supposed to be static only? Otherwise it probably needs
> a few different things fixing up.
>
> It would be nice to have it as a module so it's easy to work on in the
> future.
>
>> + depends on ARM64 && ARM_PMU
>> + default y
> Should this be default m?
>
Right, "Tristate" here does not really make sense as ARM_BRBE_PMU is dependent
on base ARM_PMU, where as ARM_SPE is abstracted as a separate PMU in itself.
next prev parent reply other threads:[~2022-11-07 2:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 5:57 [PATCH V4 0/7] arm64/perf: Enable branch stack sampling Anshuman Khandual
2022-10-17 5:57 ` [PATCH V4 1/7] arm64/perf: Add BRBE registers and fields Anshuman Khandual
2022-10-18 13:56 ` Mark Brown
2022-10-19 3:01 ` Anshuman Khandual
2022-10-17 5:57 ` [PATCH V4 2/7] arm64/perf: Update struct arm_pmu for BRBE Anshuman Khandual
2022-10-17 5:57 ` [PATCH V4 3/7] arm64/perf: Update struct pmu_hw_events " Anshuman Khandual
2022-10-17 5:57 ` [PATCH V4 4/7] driver/perf/arm_pmu_platform: Add support for BRBE attributes detection Anshuman Khandual
2022-10-17 5:57 ` [PATCH V4 5/7] arm64/perf: Drive BRBE from perf event states Anshuman Khandual
2022-10-17 5:57 ` [PATCH V4 6/7] arm64/perf: Add BRBE driver Anshuman Khandual
2022-11-02 15:36 ` James Clark
2022-11-07 2:41 ` Anshuman Khandual [this message]
2022-10-17 5:57 ` [PATCH V4 7/7] arm64/perf: Enable branch stack sampling Anshuman Khandual
2022-10-27 2:51 ` [PATCH V4 0/7] " Anshuman Khandual
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=a3e223bb-fdfa-4acc-a2f0-c12cd585e1a6@arm.com \
--to=anshuman.khandual@arm.com \
--cc=acme@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.clark@arm.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=maz@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=suzuki.poulose@arm.com \
--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: 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
all inboxes | Powered by JetHome®