Re: [PATCH v2]: perf/x86: store user space frame-pointer value on a sample

From: Alexey Budankov
Date: Thu May 24 2018 - 09:44:40 EST


Hi,

On 23.05.2018 16:09, Peter Zijlstra wrote:
> On Wed, May 23, 2018 at 01:06:58PM +0300, Alexey Budankov wrote:
>
>> Is the patch ready to be up streamed now?
>
> Please post a new one where you modify the comment about the syscalls
> not saving registers and ideally find the commit that made it so.

Sent v3 with adjusted comment.
As far comments become outdated quickly tried to be terse.

>
> Also; I think Andy would appreciate a comment near the syscall code that
> refers back to this code and states what registers we rely upon being
> there (+BP for this patch).

Not sure if I can find all proper places to put comments there.
However there is PUSH_AND_CLEAR_REGS macro that is employed at system
call implementation so it is possible to put something like this there:

.macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0
/*
...
* perf/core subsystem relies on bp register value stored
* at pt_regs->bp; see arch/x86/kernel/perf_regs.c: perf_get_regs_user()
* for more details;
...
*/

Thanks,
Alexey
>
>