bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Xu <dxu@dxuuu.xyz>
To: songliubraving@fb.com, yhs@fb.com, andriin@fb.com
Cc: Daniel Xu <dxu@dxuuu.xyz>, bpf@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH 0/3] Add PERF_EVENT_IOC_QUERY_KPROBE ioctl
Date: Tue,  6 Aug 2019 16:38:23 -0700	[thread overview]
Message-ID: <20190806233826.2478-1-dxu@dxuuu.xyz> (raw)

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.

Daniel Xu (3):
  tracing/kprobe: Add PERF_EVENT_IOC_QUERY_KPROBE ioctl
  libbpf: Add helper to extract perf fd from bpf_link
  tracing/kprobe: Add self test for PERF_EVENT_IOC_QUERY_KPROBE

 include/linux/trace_events.h                  |  6 +++
 include/uapi/linux/perf_event.h               | 23 ++++++++++
 kernel/events/core.c                          | 11 +++++
 kernel/trace/trace_kprobe.c                   | 25 +++++++++++
 tools/include/uapi/linux/perf_event.h         | 23 ++++++++++
 tools/lib/bpf/libbpf.c                        | 13 ++++++
 tools/lib/bpf/libbpf.h                        |  1 +
 tools/lib/bpf/libbpf.map                      |  5 +++
 .../selftests/bpf/prog_tests/attach_probe.c   | 43 +++++++++++++++++++
 9 files changed, 150 insertions(+)

-- 
2.20.1


             reply	other threads:[~2019-08-06 23:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 23:38 Daniel Xu [this message]
2019-08-07  5:24 ` [PATCH 0/3] Add PERF_EVENT_IOC_QUERY_KPROBE ioctl Yonghong Song
2019-08-07 17:49 ` Song Liu
2019-08-07 19:03 ` Andrii Nakryiko
2019-08-08 22:32   ` Daniel Xu
2019-08-09 17:18     ` Andrii Nakryiko

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=20190806233826.2478-1-dxu@dxuuu.xyz \
    --to=dxu@dxuuu.xyz \
    --cc=andriin@fb.com \
    --cc=bpf@vger.kernel.org \
    --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).