mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-10 18:49:06 +08:00
ci: fetch and build latest pahole
Build latest pahole from sources and not rely on hacky Ubuntu repository approach. Also enable tests for latest kernel that rely on pahole 1.16. Signed-off-by: Andrii Nakryiko <andriin@fb.com>
This commit is contained in:
committed by
Andrii Nakryiko
parent
17c26b7da6
commit
22d5d40493
@@ -21,6 +21,7 @@ addons:
|
|||||||
- elfutils
|
- elfutils
|
||||||
- libcap-dev
|
- libcap-dev
|
||||||
- libelf-dev
|
- libelf-dev
|
||||||
|
- libdw-dev
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
# Run Coverity periodically instead of for each PR for following reasons:
|
# Run Coverity periodically instead of for each PR for following reasons:
|
||||||
@@ -96,13 +97,6 @@ jobs:
|
|||||||
env: KERNEL=5.5.0
|
env: KERNEL=5.5.0
|
||||||
script: $CI_ROOT/vmtest/run_vmtest.sh || travis_terminate
|
script: $CI_ROOT/vmtest/run_vmtest.sh || travis_terminate
|
||||||
|
|
||||||
# 5.5.0-rc6 is built from bpf-next; TODO(hex@): remove when pahole v1.16 is available
|
|
||||||
- name: Kernel 5.5.0-rc6 (pahole 1.16) + selftests
|
|
||||||
language: bash
|
|
||||||
env: KERNEL=5.5.0-rc6
|
|
||||||
install: sudo adduser "${USER}" kvm
|
|
||||||
script: $CI_ROOT/vmtest/run_vmtest.sh || travis_terminate
|
|
||||||
|
|
||||||
- name: Kernel LATEST + selftests
|
- name: Kernel LATEST + selftests
|
||||||
language: bash
|
language: bash
|
||||||
env: KERNEL=LATEST
|
env: KERNEL=LATEST
|
||||||
|
|||||||
25
travis-ci/vmtest/build_pahole.sh
Executable file
25
travis-ci/vmtest/build_pahole.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
CWD=$(pwd)
|
||||||
|
REPO_PATH=$1
|
||||||
|
PAHOLE_ORIGIN=https://git.kernel.org/pub/scm/devel/pahole/pahole.git
|
||||||
|
|
||||||
|
mkdir -p ${REPO_PATH}
|
||||||
|
cd ${REPO_PATH}
|
||||||
|
git init
|
||||||
|
git remote add origin ${PAHOLE_ORIGIN}
|
||||||
|
git fetch origin
|
||||||
|
git checkout master
|
||||||
|
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -D__LIB=lib ..
|
||||||
|
make -j$((4*$(nproc))) all
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/usr/local/lib
|
||||||
|
ldd $(which pahole)
|
||||||
|
pahole --version
|
||||||
|
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
LLVM_VER=11
|
||||||
LIBBPF_PATH="${REPO_ROOT}"
|
LIBBPF_PATH="${REPO_ROOT}"
|
||||||
REPO_PATH="travis-ci/vmtest/bpf-next"
|
REPO_PATH="travis-ci/vmtest/bpf-next"
|
||||||
|
|
||||||
|
# temporary work-around for failing tests
|
||||||
|
rm "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c"
|
||||||
|
|
||||||
make \
|
make \
|
||||||
CLANG=clang-10 \
|
CLANG=clang-${LLVM_VER} \
|
||||||
LLC=llc-10 \
|
LLC=llc-${LLVM_VER} \
|
||||||
LLVM_STRIP=llvm-strip-10 \
|
LLVM_STRIP=llvm-strip-${LLVM_VER} \
|
||||||
VMLINUX_BTF="${VMLINUX_BTF}" \
|
VMLINUX_BTF="${VMLINUX_BTF}" \
|
||||||
-C "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
|
-C "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
|
||||||
-j $((4*$(nproc)))
|
-j $((4*$(nproc)))
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ bpf_verif_scale
|
|||||||
cgroup_attach
|
cgroup_attach
|
||||||
cubic
|
cubic
|
||||||
dctcp
|
dctcp
|
||||||
fentry
|
|
||||||
fexit_stress
|
|
||||||
fexit_test
|
|
||||||
kfree_skb
|
|
||||||
mmap
|
mmap
|
||||||
pinning
|
pinning
|
||||||
select_reuseport
|
select_reuseport
|
||||||
@@ -20,7 +16,6 @@ stacktrace_map
|
|||||||
strobemeta_nounroll2
|
strobemeta_nounroll2
|
||||||
task_fd_query_tp
|
task_fd_query_tp
|
||||||
tcp_rtt
|
tcp_rtt
|
||||||
test_overhead
|
|
||||||
test_syncookie
|
test_syncookie
|
||||||
tp_attach_query
|
tp_attach_query
|
||||||
trampoline_count
|
trampoline_count
|
||||||
|
|||||||
@@ -6,13 +6,14 @@ VMTEST_SETUPCMD="PROJECT_NAME=${PROJECT_NAME} ./${PROJECT_NAME}/travis-ci/vmtest
|
|||||||
|
|
||||||
echo "KERNEL: $KERNEL"
|
echo "KERNEL: $KERNEL"
|
||||||
|
|
||||||
|
# Build latest pahole
|
||||||
|
${VMTEST_ROOT}/build_pahole.sh travis-ci/vmtest/pahole
|
||||||
|
|
||||||
# Install required packages
|
# Install required packages
|
||||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||||
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" | sudo tee -a /etc/apt/sources.list
|
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" | sudo tee -a /etc/apt/sources.list
|
||||||
echo "deb http://archive.ubuntu.com/ubuntu eoan main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
|
|
||||||
sudo apt-get -qq update
|
sudo apt-get -qq update
|
||||||
sudo apt-get -y install dwarves=1.15-1
|
sudo apt-get -qq -y install clang lld llvm
|
||||||
sudo apt-get -qq -y install clang-10 lld-10 llvm-10
|
|
||||||
|
|
||||||
# Build selftests (and latest kernel, if necessary)
|
# Build selftests (and latest kernel, if necessary)
|
||||||
KERNEL="${KERNEL}" ${VMTEST_ROOT}/prepare_selftests.sh travis-ci/vmtest/bpf-next
|
KERNEL="${KERNEL}" ${VMTEST_ROOT}/prepare_selftests.sh travis-ci/vmtest/bpf-next
|
||||||
@@ -20,6 +21,8 @@ KERNEL="${KERNEL}" ${VMTEST_ROOT}/prepare_selftests.sh travis-ci/vmtest/bpf-next
|
|||||||
# Escape whitespace characters.
|
# Escape whitespace characters.
|
||||||
setup_cmd=$(sed 's/\([[:space:]]\)/\\\1/g' <<< "${VMTEST_SETUPCMD}")
|
setup_cmd=$(sed 's/\([[:space:]]\)/\\\1/g' <<< "${VMTEST_SETUPCMD}")
|
||||||
|
|
||||||
|
sudo adduser "${USER}" kvm
|
||||||
|
|
||||||
if [[ "${KERNEL}" = 'LATEST' ]]; then
|
if [[ "${KERNEL}" = 'LATEST' ]]; then
|
||||||
sudo -E sudo -E -u "${USER}" "${VMTEST_ROOT}/run.sh" -b travis-ci/vmtest/bpf-next -o -d ~ -s "${setup_cmd}" ~/root.img;
|
sudo -E sudo -E -u "${USER}" "${VMTEST_ROOT}/run.sh" -b travis-ci/vmtest/bpf-next -o -d ~ -s "${setup_cmd}" ~/root.img;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user