Re: [PATCH v1 3/3] perf cs-etm: Remove callback cs_etm_find_snapshot()

From: James Clark
Date: Thu Jun 24 2021 - 12:46:41 EST




On 28/05/2021 17:15, Leo Yan wrote:
> The callback cs_etm_find_snapshot() is invoked for snapshot mode, its
> main purpose is to find the correct AUX trace data and returns "head"
> and "old" (we can call "old" as "old head") to the caller, the caller
> __auxtrace_mmap__read() uses these two pointers to decide the AUX trace
> data size.
> > cs_etm_find_snapshot() should be removed with below reasons:
>
> - The first thing in cs_etm_find_snapshot() is to check if the head has
> wrapped around, if it is not, directly bails out. The checking is
> pointless, this is because the "head" and "old" pointers both are
> monotonical increasing so they never wrap around.
>
For patch 3:

Reviewed-by: James Clark <james.clark@xxxxxxx>
Tested-by: James Clark <james.clark@xxxxxxx>

I think it's a good simplification and it also fixes the duplicate buffers
issue. And I agree with the reasoning about the pointer increasing monotonically.