From: Song Liu <liu.song.a23@gmail.com>
To: Daniel Xu <dxu@dxuuu.xyz>
Cc: Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
Andrii Nakryiko <andriin@fb.com>, bpf <bpf@vger.kernel.org>,
Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH 1/3] tracing/kprobe: Add PERF_EVENT_IOC_QUERY_KPROBE ioctl
Date: Wed, 7 Aug 2019 11:14:21 -0700 [thread overview]
Message-ID: <CAPhsuW7z9A=5AtWaOEEfdhyV9CmWKYXRn5itOh2tcsOgbdxOiQ@mail.gmail.com> (raw)
In-Reply-To: <20190806234131.5655-1-dxu@dxuuu.xyz>
On Tue, Aug 6, 2019 at 4:41 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>
> It's useful to know kprobe's nmissed and nhit stats. For example with
> tracing tools, it's important to know when events may have been lost.
> There is currently no way to get that information from the perf API.
> This patch adds a new ioctl that lets users query this information.
> ---
[...]
> +
> /*
> * Ioctls that can be done on a perf event fd:
> */
> @@ -462,6 +484,7 @@ struct perf_event_query_bpf {
> #define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32)
> #define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *)
> #define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *)
> +#define PERF_EVENT_IOC_QUERY_KPROBE _IOWR('$', 12, struct perf_event_query_kprobe *)
This should be _IOR().
[...]
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index 9d483ad9bb6c..5449182f3056 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -196,6 +196,31 @@ bool trace_kprobe_error_injectable(struct trace_event_call *call)
> return within_error_injection_list(trace_kprobe_address(tk));
> }
>
> +int perf_event_query_kprobe(struct perf_event *event, void __user *info)
I think perf_kprobe_event_query() would be a better name, especially that we
have struct perf_event_query_kprobe.
Thanks,
Song
next prev parent reply other threads:[~2019-08-07 18:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 23:41 [PATCH 1/3] tracing/kprobe: Add PERF_EVENT_IOC_QUERY_KPROBE ioctl Daniel Xu
2019-08-07 5:51 ` Yonghong Song
2019-08-07 18:16 ` Song Liu
2019-08-07 21:07 ` Daniel Xu
2019-08-07 6:06 ` Yonghong Song
2019-08-07 21:15 ` Daniel Xu
2019-08-07 21:46 ` Andrii Nakryiko
2019-08-07 18:14 ` Song Liu [this message]
2019-08-07 21:08 ` Daniel Xu
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='CAPhsuW7z9A=5AtWaOEEfdhyV9CmWKYXRn5itOh2tcsOgbdxOiQ@mail.gmail.com' \
--to=liu.song.a23@gmail.com \
--cc=andriin@fb.com \
--cc=bpf@vger.kernel.org \
--cc=dxu@dxuuu.xyz \
--cc=kernel-team@fb.com \
--cc=songliubraving@fb.com \
--cc=yhs@fb.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;
as well as URLs for NNTP newsgroup(s).