Re: [PATCH v4] perf/core: Add a new read format to get a number of lost samples

From: Peter Zijlstra
Date: Fri Jun 17 2022 - 08:54:16 EST


On Thu, Jun 16, 2022 at 11:06:23AM -0700, Namhyung Kim wrote:
> Sometimes we want to know an accurate number of samples even if it's
> lost. Currenlty PERF_RECORD_LOST is generated for a ring-buffer which
> might be shared with other events. So it's hard to know per-event
> lost count.
>
> Add event->lost_samples field and PERF_FORMAT_LOST to retrieve it from
> userspace.
>
> Original-patch-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> ---

Looks OK I suppose. Bit sad to get an unconditional atomic on the lost
path, but then again, we shouldn't be hitting that in the first place.

Thanks!