Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-10 Thread Andrii Nakryiko
On Wed, Jul 10, 2024 at 9:24 AM Josh Poimboeuf wrote: > > On Wed, Jul 10, 2024 at 08:11:57AM -0700, Andrii Nakryiko wrote: > > On Wed, Jul 10, 2024 at 4:39 AM Peter Zijlstra wrote: > > > On Tue, Jul 09, 2024 at 10:50:00AM -0700, Andrii Nakryiko wrote: > > > > You can see it replaced the first byt

Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-10 Thread Josh Poimboeuf
On Wed, Jul 10, 2024 at 08:11:57AM -0700, Andrii Nakryiko wrote: > On Wed, Jul 10, 2024 at 4:39 AM Peter Zijlstra wrote: > > On Tue, Jul 09, 2024 at 10:50:00AM -0700, Andrii Nakryiko wrote: > > > You can see it replaced the first byte, the following 3 bytes are > > > remnants of endb64 (gdb says i

Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-10 Thread Andrii Nakryiko
On Wed, Jul 10, 2024 at 4:39 AM Peter Zijlstra wrote: > > On Tue, Jul 09, 2024 at 10:50:00AM -0700, Andrii Nakryiko wrote: > > On Tue, Jul 9, 2024 at 3:11 AM Peter Zijlstra wrote: > > > > > > On Mon, Jul 08, 2024 at 04:11:27PM -0700, Andrii Nakryiko wrote: > > > > +#ifdef CONFIG_UPROBES > > > > +

Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-10 Thread Peter Zijlstra
On Tue, Jul 09, 2024 at 10:50:00AM -0700, Andrii Nakryiko wrote: > On Tue, Jul 9, 2024 at 3:11 AM Peter Zijlstra wrote: > > > > On Mon, Jul 08, 2024 at 04:11:27PM -0700, Andrii Nakryiko wrote: > > > +#ifdef CONFIG_UPROBES > > > +/* > > > + * Heuristic-based check if uprobe is installed at the func

Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-09 Thread Andrii Nakryiko
On Tue, Jul 9, 2024 at 3:11 AM Peter Zijlstra wrote: > > On Mon, Jul 08, 2024 at 04:11:27PM -0700, Andrii Nakryiko wrote: > > +#ifdef CONFIG_UPROBES > > +/* > > + * Heuristic-based check if uprobe is installed at the function entry. > > + * > > + * Under assumption of user code being compiled with

Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-09 Thread Peter Zijlstra
On Tue, Jul 09, 2024 at 11:10:17PM +0900, Masami Hiramatsu wrote: > On Tue, 9 Jul 2024 12:11:33 +0200 > Peter Zijlstra wrote: > > > On Mon, Jul 08, 2024 at 04:11:27PM -0700, Andrii Nakryiko wrote: > > > +#ifdef CONFIG_UPROBES > > > +/* > > > + * Heuristic-based check if uprobe is installed at the

Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-09 Thread Google
On Tue, 9 Jul 2024 12:11:33 +0200 Peter Zijlstra wrote: > On Mon, Jul 08, 2024 at 04:11:27PM -0700, Andrii Nakryiko wrote: > > +#ifdef CONFIG_UPROBES > > +/* > > + * Heuristic-based check if uprobe is installed at the function entry. > > + * > > + * Under assumption of user code being compiled wi

Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-09 Thread Peter Zijlstra
On Mon, Jul 08, 2024 at 04:11:27PM -0700, Andrii Nakryiko wrote: > +#ifdef CONFIG_UPROBES > +/* > + * Heuristic-based check if uprobe is installed at the function entry. > + * > + * Under assumption of user code being compiled with frame pointers, > + * `push %rbp/%ebp` is a good indicator that we

[PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-08 Thread Andrii Nakryiko
When tracing user functions with uprobe functionality, it's common to install the probe (e.g., a BPF program) at the first instruction of the function. This is often going to be `push %rbp` instruction in function preamble, which means that within that function frame pointer hasn't been established