[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <586a307e-a51d-d176-b9f9-fc730278317e@arm.com>
Date: Wed, 22 Sep 2021 15:21:49 +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 13/17] coresight: trbe: Add a helper to determine the
minimum buffer size
On 9/21/21 7:11 PM, Suzuki K Poulose wrote:
> For the TRBE to operate, we need a minimum space available to collect
> meaningful trace session. This is currently a few bytes, but we may need
> to extend this for working around errata. So, abstract this into a helper
> function.
>
> 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 | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
> index 797d978f9fa7..3373f4e2183b 100644
> --- a/drivers/hwtracing/coresight/coresight-trbe.c
> +++ b/drivers/hwtracing/coresight/coresight-trbe.c
> @@ -277,6 +277,11 @@ trbe_handle_to_cpudata(struct perf_output_handle *handle)
> return buf->cpudata;
> }
>
> +static u64 trbe_min_trace_buf_size(struct perf_output_handle *handle)
> +{
> + return TRBE_TRACE_MIN_BUF_SIZE;
> +}
Assuming that struct perf_output_handle could provide all the
required support for a variable minimum trace buffer length.
Reviewed-by: Anshuman Khandual <anshuman.khandual@....com>
> +
> /*
> * TRBE Limit Calculation
> *
> @@ -447,7 +452,7 @@ static unsigned long trbe_normal_offset(struct perf_output_handle *handle)
> * have space for a meaningful run, we rather pad it
> * and start fresh.
> */
> - if (limit && (limit - head < TRBE_TRACE_MIN_BUF_SIZE)) {
> + if (limit && ((limit - head) < trbe_min_trace_buf_size(handle))) {
> trbe_pad_buf(handle, limit - head);
> limit = __trbe_normal_offset(handle);
> }
>
Powered by blists - more mailing lists