linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/5] writable contexts for bpf raw tracepoints
@ 2019-04-05 23:55 Matt Mullins
  2019-04-05 23:55 ` [PATCH bpf-next v2 1/5] bpf: add writable context for " Matt Mullins
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Matt Mullins @ 2019-04-05 23:55 UTC (permalink / raw)
  To: hall, mmullins, ast, bpf, netdev
  Cc: linux-kernel, Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song

This adds an opt-in interface for tracepoints to expose a writable context to
BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE programs that are attached, while
supporting read-only access from existing BPF_PROG_TYPE_RAW_TRACEPOINT
programs, as well as from non-BPF-based tracepoints.

The initial motivation is to support tracing that can be observed from the
remote end of an NBD socket, e.g. by adding flags to the struct nbd_request
header.  Earlier attempts included adding an NBD-specific tracepoint fd, but in
code review, I was recommended to implement it more generically -- as a result,
this patchset is far simpler than my initial try.

v1->v2:
  * add selftests
    * sync tools/include/uapi/linux/bpf.h
  * reject variable offset into the buffer
  * add string representation of PTR_TO_TP_BUFFER to reg_type_str

Andrew Hall (1):
  nbd: add tracepoints for send/receive timing

Matt Mullins (4):
  bpf: add writable context for raw tracepoints
  nbd: trace sending nbd requests
  tools: sync bpf.h
  selftests: bpf: test writable buffers in raw tps

 MAINTAINERS                                   |   1 +
 drivers/block/nbd.c                           |  13 ++
 include/linux/bpf.h                           |   2 +
 include/linux/bpf_types.h                     |   1 +
 include/linux/tracepoint-defs.h               |   1 +
 include/trace/bpf_probe.h                     |  27 +++-
 include/trace/events/bpf_test_run.h           |  50 ++++++
 include/trace/events/nbd.h                    | 148 ++++++++++++++++++
 include/uapi/linux/bpf.h                      |   1 +
 kernel/bpf/syscall.c                          |   8 +-
 kernel/bpf/verifier.c                         |  31 ++++
 kernel/trace/bpf_trace.c                      |  21 +++
 net/bpf/test_run.c                            |   4 +
 tools/include/uapi/linux/bpf.h                |   1 +
 tools/lib/bpf/libbpf.c                        |   1 +
 tools/lib/bpf/libbpf_probes.c                 |   1 +
 .../raw_tp_writable_reject_nbd_invalid.c      |  40 +++++
 .../bpf/prog_tests/raw_tp_writable_test_run.c |  80 ++++++++++
 .../selftests/bpf/verifier/raw_tp_writable.c  |  34 ++++
 19 files changed, 461 insertions(+), 4 deletions(-)
 create mode 100644 include/trace/events/bpf_test_run.h
 create mode 100644 include/trace/events/nbd.h
 create mode 100644 tools/testing/selftests/bpf/prog_tests/raw_tp_writable_reject_nbd_invalid.c
 create mode 100644 tools/testing/selftests/bpf/prog_tests/raw_tp_writable_test_run.c
 create mode 100644 tools/testing/selftests/bpf/verifier/raw_tp_writable.c

-- 
2.17.1


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

end of thread, other threads:[~2019-04-08 21:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-05 23:55 [PATCH bpf-next v2 0/5] writable contexts for bpf raw tracepoints Matt Mullins
2019-04-05 23:55 ` [PATCH bpf-next v2 1/5] bpf: add writable context for " Matt Mullins
2019-04-05 23:55 ` [PATCH bpf-next v2 2/5] nbd: trace sending nbd requests Matt Mullins
2019-04-07  0:10   ` Josef Bacik
2019-04-08 21:30     ` Matt Mullins
2019-04-05 23:55 ` [PATCH bpf-next v2 3/5] nbd: add tracepoints for send/receive timing Matt Mullins
2019-04-07  0:13   ` Josef Bacik
2019-04-05 23:55 ` [PATCH bpf-next v2 4/5] tools: sync bpf.h Matt Mullins
2019-04-05 23:55 ` [PATCH bpf-next v2 5/5] selftests: bpf: test writable buffers in raw tps Matt Mullins

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