bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: <netdev@vger.kernel.org>, <bpf@vger.kernel.org>
Cc: <kernel-team@fb.com>, <ast@kernel.org>, <daniel@iogearbox.net>,
	<john.fastabend@gmail.com>, <kpsingh@chromium.org>,
	Song Liu <songliubraving@fb.com>
Subject: [PATCH v5 bpf-next 0/3] enable BPF_PROG_TEST_RUN for raw_tp
Date: Thu, 24 Sep 2020 16:02:06 -0700	[thread overview]
Message-ID: <20200924230209.2561658-1-songliubraving@fb.com> (raw)

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 v4 => v5:
1.Fail test_run with non-zero test.cpu but no BPF_F_TEST_RUN_ON_CPU.
  (Andrii)
2. Add extra check for invalid test.cpu value. (Andrii)
3. Shuffle bpf_test_run_opts to remove holes. (Andrii)
4. Fixes in selftests. (Andrii)

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: 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                            | 91 +++++++++++++++++
 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          | 98 +++++++++++++++++++
 .../bpf/progs/test_raw_tp_test_run.c          | 24 +++++
 12 files changed, 295 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

             reply	other threads:[~2020-09-24 23:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24 23:02 Song Liu [this message]
2020-09-24 23:02 ` [PATCH v5 bpf-next 1/3] bpf: enable BPF_PROG_TEST_RUN for raw_tracepoint Song Liu
2020-09-25 17:21   ` Andrii Nakryiko
2020-09-24 23:02 ` [PATCH v5 bpf-next 2/3] libbpf: support test run of raw tracepoint programs Song Liu
2020-09-25 17:22   ` Andrii Nakryiko
2020-09-24 23:02 ` [PATCH v5 bpf-next 3/3] selftests/bpf: add raw_tp_test_run Song Liu
2020-09-25  1:01   ` John Fastabend
2020-09-25  3:01     ` Song Liu
2020-09-25 17:31   ` Andrii Nakryiko
2020-09-25 19:49     ` Song Liu

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=20200924230209.2561658-1-songliubraving@fb.com \
    --to=songliubraving@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=netdev@vger.kernel.org \
    /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).