netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Teng Qin <qinteng@fb.com>
To: <ast@fb.com>, <daniel@iogearbox.net>, <netdev@vger.kernel.org>
Cc: <yhs@fb.com>, <qinteng@fb.com>, <kernel-team@fb.com>
Subject: [PATCH bpf-next 0/2] bpf: add support for bpf program to read perf event sample address
Date: Tue, 6 Mar 2018 10:55:00 -0800	[thread overview]
Message-ID: <20180306185502.1948838-1-qinteng@fb.com> (raw)

These patches add support that allows bpf programs attached to perf events to
read the address values recorded with the perf events. These values are
requested by specifying sample_type with PERF_SAMPLE_ADDR when calling
perf_event_open().

The main motivation for these changes is to support building memory or lock
access profiling and tracing tools. For example on Intel CPUs, the recorded
address values for supported memory or lock access perf events would be
the access or lock target addresses from PEBS buffer. Such information would
be very valuable for building tools that help understand memory access or
lock acquire pattern.

Teng Qin (2):
  bpf: add support to read sample address in bpf program
  samples/bpf: add example to test reading address

 include/uapi/linux/bpf_perf_event.h |  1 +
 kernel/trace/bpf_trace.c            | 20 ++++++++++++++++----
 samples/bpf/trace_event_kern.c      |  4 ++++
 samples/bpf/trace_event_user.c      | 15 +++++++++++++++
 4 files changed, 36 insertions(+), 4 deletions(-)

-- 
2.9.5

             reply	other threads:[~2018-03-06 18:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 18:55 Teng Qin [this message]
2018-03-06 18:55 ` [PATCH bpf-next 1/2] bpf: add support to read sample address in bpf program Teng Qin
2018-03-06 18:55 ` [PATCH bpf-next 2/2] samples/bpf: add example to test reading address Teng Qin
2018-03-08  1:52 ` [PATCH bpf-next 0/2] bpf: add support for bpf program to read perf event sample address Daniel Borkmann

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=20180306185502.1948838-1-qinteng@fb.com \
    --to=qinteng@fb.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --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).