[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4424d36-b18e-d801-8657-85565817554b@huawei.com>
Date: Fri, 13 Jan 2023 15:49:34 +0800
From: Longjun Luo <luolongjun@...wei.com>
To: Ravi Bangoria <ravi.bangoria@....com>, <peterz@...radead.org>,
<mingo@...hat.com>, <acme@...nel.org>, <mark.rutland@....com>,
<alexander.shishkin@...ux.intel.com>, <jolsa@...nel.org>,
<namhyung@...nel.org>
CC: <linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<sangyan@...wei.com>, <luanjianhai@...wei.com>,
<zhuling8@...wei.com>, <lizongwu@...wei.com>,
<luolongjuna@...il.com>, <rostedt@...dmis.org>,
<mhiramat@...nel.org>, <oleg@...hat.com>
Subject: Re: [PATCH] uprobes: list all active uprobes in the system
在 1/13/2023 12:03 PM, Ravi Bangoria 写道:
> +cc: Steven, Oleg, Masami
>
> On 11-Jan-23 4:18 PM, luolongjun@...wei.com wrote:
>> From: Longjun Luo <luolongjun@...wei.com>
>>
>> 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
/sys/kernel/tracing/uprobe_events only lists tracing events, not all uprobe events.
For example, if I write a kernel module to call the uprobe_register to add a new uprobe event, it will not be listed by /sys/kernel/tracing/uprobe_events.
Compare it with the kprobe is like:
/sys/kernel/tracing/uprobe_events -> /sys/kernel/tracing/kprobe_events
/sys/kernel/debug/uprobes/list -> /sys/kernel/debug/kprobes/list
Nowadays, only the trace system uses the uprobe, so /sys/kernel/tracing/uprobe_events is enough.
But we try to extend the usage of the uprobe, and we add many uprobe events by calling the uprobe_register.
For this situation, we need a approach to see all the uprobe events in the kernel.
Powered by blists - more mailing lists