Netdev List
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andriin@fb.com, bpf@vger.kernel.org
Cc: kafai@fb.com, songliubraving@fb.com, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@chromium.org,
	linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
	Alan Maguire <alan.maguire@oracle.com>
Subject: [PATCH bpf-next] selftests/bpf: add general instructions for test execution
Date: Mon, 18 May 2020 12:23:10 +0100	[thread overview]
Message-ID: <1589800990-11209-1-git-send-email-alan.maguire@oracle.com> (raw)

Getting a clean BPF selftests run involves ensuring latest trunk LLVM/clang
are used, pahole is recent (>=1.16) and config matches the specified
config file as closely as possible.  Document all of this in the general
README.rst file.  Also note how to work around timeout failures.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
---
 tools/testing/selftests/bpf/README.rst | 46 ++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/tools/testing/selftests/bpf/README.rst b/tools/testing/selftests/bpf/README.rst
index 0f67f1b..b00eebb 100644
--- a/tools/testing/selftests/bpf/README.rst
+++ b/tools/testing/selftests/bpf/README.rst
@@ -1,6 +1,52 @@
 ==================
 BPF Selftest Notes
 ==================
+First verify the built kernel config options match the config options
+specified in the config file in this directory.  Test failures for
+unknown helpers, inability to find BTF etc will be observed otherwise.
+
+To ensure the maximum number of tests pass, it is best to use the latest
+trunk LLVM/clang, i.e.
+
+git clone https://github.com/llvm/llvm-project
+
+Build/install trunk LLVM:
+
+.. code-block:: bash
+  git clone https://github.com/llvm/llvm-project
+  cd llvm-project
+  mkdir build/llvm
+  cd build/llvm
+  cmake ../../llvm/
+  make
+  sudo make install
+  cd ../../
+
+Build/install trunk clang:
+
+.. code-block:: bash
+  mkdir -p build/clang
+  cd build/clang
+  cmake ../../clang
+  make
+  sudo make install
+
+When building the kernel with CONFIG_DEBUG_INFO_BTF, pahole
+version 16 or later is also required for BTF function
+support. pahole can be built from the source at
+
+https://github.com/acmel/dwarves
+
+It is often available in "dwarves/libdwarves" packages also,
+but be aware that versions prior to 1.16 will fail with
+errors that functions cannot be found in BTF.
+
+When running selftests, the default timeout of 45 seconds
+can be exceeded by some tests.  We can override the default
+timeout via a "settings" file; for example:
+
+.. code-block:: bash
+  echo "timeout=120" > tools/testing/selftests/bpf/settings
 
 Additional information about selftest failures are
 documented here.
-- 
1.8.3.1


             reply	other threads:[~2020-05-18 11:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 11:23 Alan Maguire [this message]
2020-05-18 23:48 ` [PATCH bpf-next] selftests/bpf: add general instructions for test execution Andrii Nakryiko
2020-05-19 15:50 ` Alexei Starovoitov
2020-05-19 21:34   ` Alan Maguire
2020-05-20  5:26     ` Alexei Starovoitov

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=1589800990-11209-1-git-send-email-alan.maguire@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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