From: Song Liu <songliubraving@fb.com>
To: Dmitrii Dolgov <9erthalion6@gmail.com>
Cc: "linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
"peterz@infradead.org" <peterz@infradead.org>,
"mingo@redhat.com" <mingo@redhat.com>
Subject: Re: [PATCH] perf/kprobe: maxactive for fd-based kprobe
Date: Wed, 15 Jun 2022 18:20:05 +0000 [thread overview]
Message-ID: <9AB360B5-F7DE-4159-B75E-9C21106FDB49@fb.com> (raw)
In-Reply-To: <20220609192936.23985-1-9erthalion6@gmail.com>
> On Jun 9, 2022, at 12:29 PM, Dmitrii Dolgov <9erthalion6@gmail.com> wrote:
>
> Enable specifying maxactive for fd based kretprobe. This will be useful
> for tracing tools like bcc and bpftrace (see for example discussion [1]).
> Use highest 12 bit (bit 52-63) to allow maximal maxactive of 4095.
>
> The original patch [2] seems to be fallen through the cracks and wasn't
> applied. I've merely rebased the work done by Song Liu and verififed it
> still works.
>
> [1]: https://github.com/iovisor/bpftrace/issues/835
> [2]: https://lore.kernel.org/all/20191007223111.1142454-1-songliubraving@fb.com/
Thanks for pulling this out of the cracks. :)
Since there isn't much change from [2], I think this should still show
"From:" me, and with "Signed-off-by" both of us.
And a nit below:
Thanks,
Song
>
> Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com>
> ---
> include/linux/trace_events.h | 3 ++-
> kernel/events/core.c | 20 ++++++++++++++++----
> kernel/trace/trace_event_perf.c | 5 +++--
> kernel/trace/trace_kprobe.c | 4 ++--
> kernel/trace/trace_probe.h | 2 +-
> 5 files changed, 24 insertions(+), 10 deletions(-)
>
> diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
> index e6e95a9f07a5..7ca453a73252 100644
> --- a/include/linux/trace_events.h
> +++ b/include/linux/trace_events.h
> @@ -850,7 +850,8 @@ extern void perf_trace_destroy(struct perf_event *event);
> extern int perf_trace_add(struct perf_event *event, int flags);
> extern void perf_trace_del(struct perf_event *event, int flags);
> #ifdef CONFIG_KPROBE_EVENTS
> -extern int perf_kprobe_init(struct perf_event *event, bool is_retprobe);
> +extern int perf_kprobe_init(struct perf_event *event, bool is_retprobe,
> + int max_active);
> extern void perf_kprobe_destroy(struct perf_event *event);
> extern int bpf_get_kprobe_info(const struct perf_event *event,
> u32 *fd_type, const char **symbol,
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 23bb19716ad3..f0e936b3dfc4 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -9809,24 +9809,34 @@ static struct pmu perf_tracepoint = {
> * PERF_PROBE_CONFIG_IS_RETPROBE if set, create kretprobe/uretprobe
> * if not set, create kprobe/uprobe
> *
> - * The following values specify a reference counter (or semaphore in the
> - * terminology of tools like dtrace, systemtap, etc.) Userspace Statically
> - * Defined Tracepoints (USDT). Currently, we use 40 bit for the offset.
> + * PERF_UPROBE_REF_CTR_OFFSET_* specify a reference counter (or semaphore
> + * in the terminology of tools like dtrace, systemtap, etc.) Userspace
> + * Statically Defined Tracepoints (USDT). Currently, we use 40 bit for the
40 bit is not accurate anymore, let's fix it (32).
Otherwise, LGTM.
[...]
next prev parent reply other threads:[~2022-06-15 18:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 19:29 [PATCH] perf/kprobe: maxactive for fd-based kprobe Dmitrii Dolgov
2022-06-09 19:30 ` Dmitry Dolgov
2022-06-11 18:28 ` Alexei Starovoitov
2022-06-12 12:12 ` Masami Hiramatsu
2022-06-15 20:00 ` Dmitry Dolgov
2022-06-18 16:15 ` Masami Hiramatsu
2022-06-15 18:20 ` Song Liu [this message]
2022-06-15 19:57 ` Dmitry Dolgov
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=9AB360B5-F7DE-4159-B75E-9C21106FDB49@fb.com \
--to=songliubraving@fb.com \
--cc=9erthalion6@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/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