netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: add support for bpf program to read perf event sample address
@ 2018-03-06 18:55 Teng Qin
  2018-03-06 18:55 ` [PATCH bpf-next 1/2] bpf: add support to read sample address in bpf program Teng Qin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Teng Qin @ 2018-03-06 18:55 UTC (permalink / raw)
  To: ast, daniel, netdev; +Cc: yhs, qinteng, kernel-team

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-08  1:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06 18:55 [PATCH bpf-next 0/2] bpf: add support for bpf program to read perf event sample address Teng Qin
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

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).