Skip to content

RFC Add trace event support to eBPF

Tom Zanussi lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10tracing: Move some constants to ring_buffer.hinclude/linux/ring_buffer.h kernel/trace/ring_buffer.c+35 -310 replies
2/10eBPF: Add BPF_PROG_TYPE_TRACE_EVENT prog typeinclude/linux/trace_events.h include/uapi/linux/bpf.h kernel/events/core.c +1 more+77 -50 replies
3/10tracing: Add an 'accessor' function to ftrace_event_fieldkernel/trace/trace.h+5 -00 replies
4/10tracing: Add trace event accessor functionskernel/trace/trace_events.c kernel/trace/trace_events_hist.c+121 -930 replies
5/10eBPF/tracing: Add eBPF trace event field access helpersinclude/uapi/linux/bpf.h kernel/bpf/verifier.c kernel/trace/bpf_trace.c+106 -10 replies
6/10tracing: Add kprobe/uprobe support for TRACE_EVENT eBPF progskernel/trace/trace_kprobe.c kernel/trace/trace_uprobe.c+28 -30 replies
7/10tracing: Add eBPF program support to static trace eventsinclude/trace/perf.h kernel/trace/trace_syscalls.c+28 -00 replies
8/10samples/bpf: Add support for trace events to the eBPF loading codesamples/bpf/bpf_helpers.h samples/bpf/bpf_load.c+45 -50 replies
9/10samples/bpf: Add readcounts-by-pid examplesamples/bpf/Makefile samples/bpf/readcounts-by-pid_kern.c samples/bpf/readcounts-by-pid_user.c+127 -00 replies
10/10samples/bpf: Add kprobe-event-fields examplesamples/bpf/Makefile samples/bpf/kprobe-event-fields_kern.c samples/bpf/kprobe-event-fields_user.c+85 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 00/10] Add trace event support to eBPF

Hi,

As promised in previous threads, this patchset shares some common functionality with the hist triggers code and enables trace events to be accessed from eBPF programs.

It needs to be applied on top of current tracing/for-next with the hist triggers v13 patches applied:

https://lkml.org/lkml/2015/12/10/640

Any input welcome, especially things that could be done better wrt eBPF, since I'm not as familiar with that code...

Thanks,

Tom

The following changes since commit def7919edab980525728a6ee9728c23ececdaf52:

tracing: Add hist trigger 'log2' modifier (2016-02-10 09:51:54 -0600)

are available in the git repository at:

git://git.yoctoproject.org/linux-yocto-contrib.git tzanussi/ebpf-trace-events-v0
http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/log/?h=tzanussi/ebpf-trace-events-v0

Tom Zanussi (10):
tracing: Move some constants to ring_buffer.h
eBPF: Add BPF_PROG_TYPE_TRACE_EVENT prog type
tracing: Add an 'accessor' function to ftrace_event_field
tracing: Add trace event accessor functions eBPF/tracing: Add eBPF trace event field access helpers
tracing: Add kprobe/uprobe support for TRACE_EVENT eBPF progs
tracing: Add eBPF program support to static trace events samples/bpf: Add support for trace events to the eBPF loading code samples/bpf: Add readcounts-by-pid example
samples/bpf: Add kprobe-event-fields example

 include/linux/ring_buffer.h            |  35 ++++++++
 include/linux/trace_events.h           |   7 ++
 include/trace/perf.h                   |  10 +++
 include/uapi/linux/bpf.h               |  19 +++++
 kernel/bpf/verifier.c                  |   2 +-
 kernel/events/core.c                   |  12 +--
 kernel/trace/bpf_trace.c               | 149 +++++++++++++++++++++++++++++++++
 kernel/trace/ring_buffer.c             |  31 -------
 kernel/trace/trace.h                   |   5 ++
 kernel/trace/trace_events.c            | 111 ++++++++++++++++++++++++
 kernel/trace/trace_events_hist.c       | 103 +++--------------------
 kernel/trace/trace_kprobe.c            |  20 ++++-
 kernel/trace/trace_syscalls.c          |  18 ++++
 kernel/trace/trace_uprobe.c            |  11 ++-
 samples/bpf/Makefile                   |   8 ++
 samples/bpf/bpf_helpers.h              |   4 +
 samples/bpf/bpf_load.c                 |  46 ++++++++--
 samples/bpf/kprobe-event-fields_kern.c |  56 +++++++++++++
 samples/bpf/kprobe-event-fields_user.c |  25 ++++++
 samples/bpf/readcounts-by-pid_kern.c   |  57 +++++++++++++
 samples/bpf/readcounts-by-pid_user.c   |  66 +++++++++++++++
 21 files changed, 657 insertions(+), 138 deletions(-)
 create mode 100644 samples/bpf/kprobe-event-fields_kern.c
 create mode 100644 samples/bpf/kprobe-event-fields_user.c
 create mode 100644 samples/bpf/readcounts-by-pid_kern.c
 create mode 100644 samples/bpf/readcounts-by-pid_user.c
Signature · 1 line
1.9.3