mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Longjun Luo <luolongjun@huawei.com>
To: Ravi Bangoria <ravi.bangoria@amd.com>, <peterz@infradead.org>,
	<mingo@redhat.com>, <acme@kernel.org>, <mark.rutland@arm.com>,
	<alexander.shishkin@linux.intel.com>, <jolsa@kernel.org>,
	<namhyung@kernel.org>
Cc: <linux-perf-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <sangyan@huawei.com>,
	<luanjianhai@huawei.com>, <zhuling8@huawei.com>,
	<lizongwu@huawei.com>, <luolongjuna@gmail.com>,
	<rostedt@goodmis.org>, <mhiramat@kernel.org>, <oleg@redhat.com>
Subject: Re: [PATCH] uprobes: list all active uprobes in the system
Date: Fri, 13 Jan 2023 15:49:34 +0800	[thread overview]
Message-ID: <f4424d36-b18e-d801-8657-85565817554b@huawei.com> (raw)
In-Reply-To: <b4109593-1aa9-bf7a-cb1b-3ccd586f31d6@amd.com>


在 1/13/2023 12:03 PM, Ravi Bangoria 写道:
> +cc: Steven, Oleg, Masami
>
> On 11-Jan-23 4:18 PM, luolongjun@huawei.com wrote:
>> From: Longjun Luo <luolongjun@huawei.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.


  reply	other threads:[~2023-01-13  7:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 10:48 luolongjun
2023-01-11 21:35 ` Ian Rogers
2023-01-12  4:15   ` Longjun Luo
2023-01-13  4:03 ` Ravi Bangoria
2023-01-13  7:49   ` Longjun Luo [this message]
2023-01-13 15:29   ` Masami Hiramatsu
  -- strict thread matches above, loose matches on Subject: below --
2023-01-11 10:42 luolongjun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4424d36-b18e-d801-8657-85565817554b@huawei.com \
    --to=luolongjun@huawei.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=lizongwu@huawei.com \
    --cc=luanjianhai@huawei.com \
    --cc=luolongjuna@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=rostedt@goodmis.org \
    --cc=sangyan@huawei.com \
    --cc=zhuling8@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®