2023-01-13 04:30:14

by Ravi Bangoria

[permalink] [raw]
Subject: Re: [PATCH] uprobes: list all active uprobes in the system

+cc: Steven, Oleg, Masami

On 11-Jan-23 4:18 PM, [email protected] wrote:
> From: Longjun Luo <[email protected]>
>
> Since uprobes will replace instructions in the process
> memory, it is necessary to provide one way to list
> all active uprobes. One can access this file through
> /sys/kernel/debug/uprobes/list.
>
> Output looks like this
> =====================
> inode+offset/ref_ctr_offset 4160760670+0x30a10/0x0
> ref 1
> register_rwsem (unlocked)
> consumer_rwsem (unlocked)
> consumers-1
> handler 0xffffffffc03ee02e(handler) uprobe
> ret_handler 0x0000000000000000( )
> filter 0xffffffffc03ee010(filter) uprobe
> consumers-2
> handler 0xffffffffc03e902e(handler_1) uprobe_1
> ret_handler 0x0000000000000000( )
> filter 0xffffffffc03e9010(filter_1) uprobe_1

You can list uprobes via /sys/kernel/tracing/uprobe_events. Any specific reason
to introduce another way?

Thanks,
Ravi


2023-01-13 16:01:21

by Masami Hiramatsu

[permalink] [raw]
Subject: Re: [PATCH] uprobes: list all active uprobes in the system

On Fri, 13 Jan 2023 09:33:41 +0530
Ravi Bangoria <[email protected]> wrote:

> +cc: Steven, Oleg, Masami
>
> On 11-Jan-23 4:18 PM, [email protected] wrote:
> > From: Longjun Luo <[email protected]>
> >
> > Since uprobes will replace instructions in the process
> > memory, it is necessary to provide one way to list
> > all active uprobes. One can access this file through
> > /sys/kernel/debug/uprobes/list.
> >
> > Output looks like this
> > =====================
> > inode+offset/ref_ctr_offset 4160760670+0x30a10/0x0
> > ref 1
> > register_rwsem (unlocked)
> > consumer_rwsem (unlocked)
> > consumers-1
> > handler 0xffffffffc03ee02e(handler) uprobe
> > ret_handler 0x0000000000000000( )
> > filter 0xffffffffc03ee010(filter) uprobe
> > consumers-2
> > handler 0xffffffffc03e902e(handler_1) uprobe_1
> > ret_handler 0x0000000000000000( )
> > filter 0xffffffffc03e9010(filter_1) uprobe_1
>
> You can list uprobes via /sys/kernel/tracing/uprobe_events. Any specific reason
> to introduce another way?

Note that /sys/kernel/tracing/uprobe_events is only for the uprobes defined
by ftrace, it doesn't include the uprobes registered by out-of-tree modules.

Thank you,

>
> Thanks,
> Ravi


--
Masami Hiramatsu (Google) <[email protected]>