[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ9a7Vi28GuPUx8jvGoYhqBRzWanwhiLJJuLnaZuPj46g3ex2w@mail.gmail.com>
Date: Mon, 26 Jul 2021 13:34:37 +0100
From: Mike Leach <mike.leach@...aro.org>
To: Suzuki K Poulose <suzuki.poulose@....com>
Cc: Coresight ML <coresight@...ts.linaro.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
tamas.zsoldos@....com, Al Grant <al.grant@....com>,
Leo Yan <leo.yan@...aro.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Anshuman Khandual <anshuman.khandual@....com>,
jinlmao@....qualcomm.com, James Clark <james.clark@....com>
Subject: Re: [PATCH v2 07/10] coresight: trbe: Do not truncate buffer on IRQ
Hi Suzuki,
On Fri, 23 Jul 2021 at 13:46, Suzuki K Poulose <suzuki.poulose@....com> wrote:
>
> The TRBE driver marks the AUX buffer as TRUNCATED when we get an IRQ
> on FILL event. This has rather unwanted side-effect of the event
> being disabled when there may be more space in the ring buffer.
>
> So, instead of TRUNCATE we need a different flag to indicate
> that the trace may have lost a few bytes (i.e from the point of
> generating the FILL event until the IRQ is consumed). Anyways, the
> userspace must use the size from RECORD_AUX headers to restrict
> the "trace" decoding.
>
> Using PARTIAL flag causes the perf tool to generate the
> following warning:
>
> Warning:
> AUX data had gaps in it XX times out of YY!
>
> Are you running a KVM guest in the background?
>
> which is pointlessly scary for a user. The other remaining options
> are :
> - COLLISION - Use by SPE to indicate samples collided
> - Add a new flag - Specifically for CoreSight, doesn't sound
> so good, if we can re-use something.
>
What is the user visible behaviour when using COLLISION?
The TRUNCATE warning is at least accurate - even if the KVM thing is
something of a red herring.
It is easier to explain a "scary" warning, than try to debug someones
problems if perf is silent or misleading when using the COLLISION
flag.
Regards
Mike
> Given that we don't already use the "COLLISION" flag, the above
> behavior can be notified using this flag for CoreSight.
>
> Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
> Cc: James Clark <james.clark@....com>
> Cc: Mike Leach <mike.leach@...aro.org>
> Cc: Anshuman Khandual <anshuman.khandual@....com>
> Cc: Leo Yan <leo.yan@...aro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
> ---
> drivers/hwtracing/coresight/coresight-trbe.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
> index 503bea0137ae..d50f142e86d1 100644
> --- a/drivers/hwtracing/coresight/coresight-trbe.c
> +++ b/drivers/hwtracing/coresight/coresight-trbe.c
> @@ -615,7 +615,7 @@ static unsigned long arm_trbe_update_buffer(struct coresight_device *csdev,
> * for correct size. Also, mark the buffer truncated.
> */
> write = get_trbe_limit_pointer();
> - perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED);
> + perf_aux_output_flag(handle, PERF_AUX_FLAG_COLLISION);
> }
>
> offset = write - base;
> @@ -708,7 +708,7 @@ static void trbe_handle_overflow(struct perf_output_handle *handle)
> * collection upon the WRAP event, without stopping the source.
> */
> perf_aux_output_flag(handle, PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW |
> - PERF_AUX_FLAG_TRUNCATED);
> + PERF_AUX_FLAG_COLLISION);
> perf_aux_output_end(handle, size);
> event_data = perf_aux_output_begin(handle, event);
> if (!event_data) {
> --
> 2.24.1
>
--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK
Powered by blists - more mailing lists