Re: [PATCHv3 1/7] uprobe: Add support for session consumer

Oleg Nesterov
2024-09-13T11:52:54Z

On 09/09, Jiri Olsa wrote:
>
> @@ -37,13 +37,16 @@ struct uprobe_consumer {
> * for the current process. If filter() is omitted or returns true,
> * UPROBE_HANDLER_REMOVE is effectively ignored.
> */
> - int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs);
> + int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs, __u64 *data);
> int (*ret_handler)(struct uprobe_consumer *self,
> unsigned long func,
> - struct pt_regs *regs);
> + struct pt_regs *regs, __u64 *data);

And... I won't insist, but I'd suggest to do this in a separate patch
which should also update the current users in bpf_trace.c, trace_uprobe.c
and bpf_testmod.c.

Then it would be easier to review the next "functional" change. But this
is minor, feel free to ignore.

Finally, imo this documentation in handler_chain()

/*
* The handler can return following values:
* 0 - execute ret_handler (if it's defined)
* 1 - remove uprobe
* 2 - do nothing (ignore ret_handler)
*/

should be moved to uprobes.h and explain UPROBE_HANDLER_REMOVE/IGNORE there.

And note that "remove uprobe" is misleading, it should say something
like "remove the breakpoint from current->mm".

Oleg.