[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eacda231-eb0b-fb33-bc95-1b37d116e3b2@arm.com>
Date: Wed, 22 Sep 2021 13:29:40 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Suzuki K Poulose <suzuki.poulose@....com>,
linux-arm-kernel@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, maz@...nel.org,
catalin.marinas@....com, mark.rutland@....com, james.morse@....com,
leo.yan@...aro.org, mike.leach@...aro.org,
mathieu.poirier@...aro.org, will@...nel.org, lcherian@...vell.com,
coresight@...ts.linaro.org
Subject: Re: [PATCH v2 12/17] coresight: trbe: Add a helper to fetch cpudata
from perf handle
On 9/21/21 7:11 PM, Suzuki K Poulose wrote:
> Add a helper to get the CPU specific data for TRBE instance, from
> a given perf handle. This also adds extra checks to make sure that
> the event associated with the handle is "bound" to the CPU and is
> active on the TRBE.
>
> Cc: Anshuman Khandual <anshuman.khandual@....com>
> Cc: Mike Leach <mike.leach@...aro.org>
> Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
> Cc: Leo Yan <leo.yan@...aro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
> ---
> drivers/hwtracing/coresight/coresight-trbe.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
> index 983dd5039e52..797d978f9fa7 100644
> --- a/drivers/hwtracing/coresight/coresight-trbe.c
> +++ b/drivers/hwtracing/coresight/coresight-trbe.c
> @@ -268,6 +268,15 @@ static unsigned long trbe_snapshot_offset(struct perf_output_handle *handle)
> return buf->nr_pages * PAGE_SIZE;
> }
>
> +static inline struct trbe_cpudata *
> +trbe_handle_to_cpudata(struct perf_output_handle *handle)
This is actually a perf handle not a TRBE handle. Hence
should be renamed as 'perf_handle_to_cpudata' instead.
> +{
> + struct trbe_buf *buf = etm_perf_sink_config(handle);
> +
> + BUG_ON(!buf || !buf->cpudata);
> + return buf->cpudata;
> +}
> +
> /*
> * TRBE Limit Calculation
> *
> @@ -533,8 +542,7 @@ static enum trbe_fault_action trbe_get_fault_act(struct perf_output_handle *hand
> {
> int ec = get_trbe_ec(trbsr);
> int bsc = get_trbe_bsc(trbsr);
> - struct trbe_buf *buf = etm_perf_sink_config(handle);
> - struct trbe_cpudata *cpudata = buf->cpudata;
> + struct trbe_cpudata *cpudata = trbe_handle_to_cpudata(handle);
>
> WARN_ON(is_trbe_running(trbsr));
> if (is_trbe_trg(trbsr) || is_trbe_abort(trbsr))
>
Powered by blists - more mailing lists