Re: Perf raw sample overflows perf record

From: Namhyung Kim
Date: Tue Oct 27 2020 - 01:09:11 EST


+ LKML

On Sat, Oct 24, 2020 at 8:44 AM George Prekas <prekageo@xxxxxxxxxx> wrote:
>
> The header of a perf sample has a u16 field for the size of the record.
> On the other hand, a PERF_SAMPLE_RAW has a u32 field for its size.
>
> I've written a test perf driver that creates large raw samples and it
> doesn't work correctly (as expected). For example, perf record fails with:
>
> Can't parse sample, err = -14
> 0x4688 [0x8]: failed to process type: 68 [Bad address]
>
> Is this expected? Is the developer of the perf driver responsible to
> make sure that each perf record does not exceed 64KB in size? If that's
> the case, I am wondering why the raw sample has a u32 for its size.

For the large records, you may consider an auxtrace interface.

Thanks
Namhyung