linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] uprobe: fix comment of uprobe_apply()
@ 2024-08-20 13:52 Zhen Lei
  2024-08-20 14:30 ` Oleg Nesterov
  0 siblings, 1 reply; 3+ messages in thread
From: Zhen Lei @ 2024-08-20 13:52 UTC (permalink / raw)
  To: Masami Hiramatsu, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Liang Kan, linux-trace-kernel, linux-perf-users, linux-kernel
  Cc: Zhen Lei

Depending on the argument 'add', uprobe_apply() may be registering or
unregistering a probe. The current comment misses the description of the
registration.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 kernel/events/uprobes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 73cc47708679f0c..c9de255e56e777f 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1201,8 +1201,8 @@ int uprobe_register_refctr(struct inode *inode, loff_t offset,
 EXPORT_SYMBOL_GPL(uprobe_register_refctr);
 
 /*
- * uprobe_apply - unregister an already registered probe.
- * @inode: the file in which the probe has to be removed.
+ * uprobe_apply - register a probe or unregister an already registered probe.
+ * @inode: the file in which the probe has to be placed or removed.
  * @offset: offset from the start of the file.
  * @uc: consumer which wants to add more or remove some breakpoints
  * @add: add or remove the breakpoints
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] uprobe: fix comment of uprobe_apply()
  2024-08-20 13:52 [PATCH 1/1] uprobe: fix comment of uprobe_apply() Zhen Lei
@ 2024-08-20 14:30 ` Oleg Nesterov
  2024-08-21  1:39   ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Nesterov @ 2024-08-20 14:30 UTC (permalink / raw)
  To: Zhen Lei
  Cc: Masami Hiramatsu, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Liang Kan, linux-trace-kernel, linux-perf-users, linux-kernel

On 08/20, Zhen Lei wrote:
>
> Depending on the argument 'add', uprobe_apply() may be registering or
> unregistering a probe.

...

>  /*
> - * uprobe_apply - unregister an already registered probe.
> - * @inode: the file in which the probe has to be removed.
> + * uprobe_apply - register a probe or unregister an already registered probe.

Not really.

See the commit 3c83a9ad0295eb63bd ("uprobes: make uprobe_register() return struct uprobe *")
in tip/perf/core which changed this description

	* uprobe_apply - add or remove the breakpoints according to @uc->filter

still looks confusing, yes...

Oleg.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] uprobe: fix comment of uprobe_apply()
  2024-08-20 14:30 ` Oleg Nesterov
@ 2024-08-21  1:39   ` Leizhen (ThunderTown)
  0 siblings, 0 replies; 3+ messages in thread
From: Leizhen (ThunderTown) @ 2024-08-21  1:39 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: Masami Hiramatsu, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Liang Kan, linux-trace-kernel, linux-perf-users, linux-kernel



On 2024/8/20 22:30, Oleg Nesterov wrote:
> On 08/20, Zhen Lei wrote:
>>
>> Depending on the argument 'add', uprobe_apply() may be registering or
>> unregistering a probe.
> 
> ...
> 
>>  /*
>> - * uprobe_apply - unregister an already registered probe.
>> - * @inode: the file in which the probe has to be removed.
>> + * uprobe_apply - register a probe or unregister an already registered probe.
> 
> Not really.
> 
> See the commit 3c83a9ad0295eb63bd ("uprobes: make uprobe_register() return struct uprobe *")
> in tip/perf/core which changed this description
> 
> 	* uprobe_apply - add or remove the breakpoints according to @uc->filter
> 
> still looks confusing, yes...

OK, I got it. I mistakenly thought the comment was based on register_for_each_vma.
It seems necessary to rename 'register_for_each_vma' to 'apply_for_each_vma',
or some other more appropriate name.

> 
> Oleg.
> 
> 
> .
> 

-- 
Regards,
  Zhen Lei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-21  1:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 13:52 [PATCH 1/1] uprobe: fix comment of uprobe_apply() Zhen Lei
2024-08-20 14:30 ` Oleg Nesterov
2024-08-21  1:39   ` Leizhen (ThunderTown)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).