[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f84187d1-b7eb-e25e-090a-d09532f15594@arm.com>
Date: Mon, 13 Jun 2022 13:16:19 +0100
From: German Gomez <german.gomez@....com>
To: Anshuman Khandual <anshuman.khandual@....com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
peterz@...radead.org, acme@...nel.org, mark.rutland@....com,
will@...nel.org
Cc: Catalin Marinas <catalin.marinas@....com>,
James Clark <james.clark@....com>,
Rob Herring <robh@...nel.org>, Marc Zyngier <maz@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 7/8] arm64/perf: Add BRBE driver
Hi Anshuman, thanks for the update,
As I mentioned offline, I have a perf test that I've been using for the
branch records and filters. I'll let you know the result using this set.
On 13/06/2022 11:01, Anshuman Khandual wrote:
> [...]
>
> +
> +static int brbe_fetch_perf_priv(u64 brbinf)
> +{
> + int brbe_el = brbe_fetch_el(brbinf);
> +
> + switch (brbe_el) {
> + case BRBINF_EL_EL0:
> + return PERF_BR_PRIV_USER;
> + case BRBINF_EL_EL1:
> + return PERF_BR_PRIV_KERNEL;
> + case BRBINF_EL_EL2:
> + if (is_kernel_in_hyp_mode())
> + return PERF_BR_PRIV_KERNEL;
> + return PERF_BR_PRIV_HV;
> + default:
> + pr_warn("unknown branch privilege captured\n");
> + return -1;
This looks like it should return PERF_BR_PRIV_UNKNOWN.
Thanks,
German
> + }
> +}
> +
> +static void capture_brbe_flags(struct pmu_hw_events *cpuc, struct perf_event *event,
> + u64 brbinf, int idx)
> +{
>
> [...]
>
> +
> + if (branch_sample_priv(event)) {
> + /*
> + * All these information (i.e branch privilege level) are not
> + * available for source only branch records.
> + */
> + if (type != BRBINF_VALID_SOURCE)
> + cpuc->brbe_entries[idx].priv = brbe_fetch_perf_priv(brbinf);
> + }
> +}
> +
>
> [...]
Powered by blists - more mailing lists