Re: [PATCH] perf/arch: Remove perf_sample_data::regs_user_copy

From: Steven Rostedt
Date: Fri Oct 30 2020 - 08:34:33 EST


On Fri, 30 Oct 2020 11:59:17 +0100
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> On Fri, Oct 30, 2020 at 11:26:01AM +0100, Thomas Gleixner wrote:
> > What's worse is perf_sample_data which is 384 bytes and is 64 bytes aligned.
>
> Here; this shrinks it to 192 bytes. Combined with the static dummy this
> should reduce stack usage by 360 bytes.
>
> ---
> Subject: perf/arch: Remove perf_sample_data::regs_user_copy
>
> struct perf_sample_data lives on-stack, we should be careful about it's
> size. Furthermore, the pt_regs copy in there is only because x86_64 is a
> trainwreck, solve it differently.
>
> Halves sizeof(perf_sample_data).
>
>


I tested with just this patch and it doesn't crash when running
function tracing and perf simultaneously.

-- Steve