Re: Question about config UPROBES and UPROBE_EVENTS

From: Steven Rostedt
Date: Wed Sep 11 2024 - 09:47:21 EST


On Wed, 11 Sep 2024 14:40:56 +0800
Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:

> Hi Masami,
>
> I am a little confused about config UPROBES and UPROBE_EVENTS.
> Uprobes is the user-space counterpart to kprobes, I want to do
> some small changes:
>
> (1) since config KPROBES can be selectable, just make config UPROBES
> selectable too.
>
> (2) since config KPROBE_EVENTS depends on KPROBES rather than select
> KPROBES, just make config UPROBE_EVENTS depends on UPROBES rather
> than select UPROBES.
>
> Could you please let me know are you OK with the following changes?
> If yes, I will send formal patches later.

The difference between uprobes and kprobes is that kprobes can be enabled
inside the kernel outside of kprobe events. Where as, uprobes is only
enabled by uprobe events, so why have the separate option? That is, is
there a reason to enable uprobes without enabling uprobe events?

If you make uprobe events depend on uprobes, that may confuse people about
how to enable uprobe events. Especially since it may break existing configs.

kprobes have been around much longer than kprobe events. That's not the
same with uprobes and uprobe events. They are much more coupled.

-- Steve