Thread (8 messages) 8 messages, 2 authors, 2020-09-24
STALE2121d
Revisions (6)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 current
  5. v5 [diff vs current]
  6. v6 [diff vs current]

[PATCH v4 bpf-next 0/3] enable BPF_PROG_TEST_RUN for raw_tp

From: Song Liu <hidden>
Date: 2020-09-24 01:49:21
Also in: bpf

This set enables BPF_PROG_TEST_RUN for raw_tracepoint type programs. This
set also enables running the raw_tp program on a specific CPU. This feature
can be used by user space to trigger programs that access percpu resources,
e.g. perf_event, percpu variables.

Changes v3 => v4:
1. Use cpu+flags instead of cpu_plus. (Andrii)
2. Rework libbpf support. (Andrii)

Changes v2 => v3:
1. Fix memory leak in the selftest. (Andrii)
2. Use __u64 instead of unsigned long long. (Andrii)

Changes v1 => v2:
1. More checks for retval in the selftest. (John)
2. Remove unnecessary goto in bpf_prog_test_run_raw_tp. (John)

Song Liu (3):
  bpf: enable BPF_PROG_TEST_RUN for raw_tracepoint
  libbpf: introduce bpf_prog_test_run_xattr_opts
  selftests/bpf: add raw_tp_test_run

Song Liu (3):
  bpf: enable BPF_PROG_TEST_RUN for raw_tracepoint
  libbpf: support test run of raw tracepoint programs
  selftests/bpf: add raw_tp_test_run

 include/linux/bpf.h                           |  3 +
 include/uapi/linux/bpf.h                      |  7 ++
 kernel/bpf/syscall.c                          |  2 +-
 kernel/trace/bpf_trace.c                      |  1 +
 net/bpf/test_run.c                            | 89 +++++++++++++++++++
 tools/include/uapi/linux/bpf.h                |  7 ++
 tools/lib/bpf/bpf.c                           | 31 +++++++
 tools/lib/bpf/bpf.h                           | 26 ++++++
 tools/lib/bpf/libbpf.map                      |  1 +
 tools/lib/bpf/libbpf_internal.h               |  5 ++
 .../bpf/prog_tests/raw_tp_test_run.c          | 80 +++++++++++++++++
 .../bpf/progs/test_raw_tp_test_run.c          | 25 ++++++
 12 files changed, 276 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/raw_tp_test_run.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_raw_tp_test_run.c

--
2.24.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help