Re: [PATCH v16 0/4] perf: Support the deferred unwinding infrastructure

Florian Weimer
2025-11-04T11:22:23Z

* Peter Zijlstra:

> +/*
> + * 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 indeed are.
> + *
> + * Similarly, `endbr64` (assuming 64-bit mode) is also a common pattern.
> + * If we get this wrong, captured stack trace might have one extra bogus
> + * entry, but the rest of stack trace will still be meaningful.
> + */
> +bool is_uprobe_at_func_entry(struct pt_regs *regs)

Is this specifically for uprobes? Wouldn't it make sense to tell the
kernel when the uprobe is installed whether the frame pointer has been
set up at this point? Userspace can typically figure this out easily
enough (it's not much more difficult to find the address of the
function).

Thanks,
Florian