Skip to content

runtime: support map type perf_event_array #13

runtime: support map type perf_event_array

runtime: support map type perf_event_array #13

name: Test whether ringbuf and opensnoop works properly
on:
push:
branches: "master"
pull_request:
branches: "master"
jobs:
build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install dependencies
run: |
sudo apt-get install binutils-dev libboost1.74-all-dev libelf-dev zlib1g-dev libyaml-cpp-dev gcc-12 g++-12
- name: Build and install runtime
run: |
CC=gcc-12 CXX=g++-12 make release
- name: Build and install CLI
run: |
cd tools/cli-rs
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target x86_64-unknown-linux-gnu
mkdir -p ~/.bpftime
cp ./target/x86_64-unknown-linux-gnu/release/bpftime ~/.bpftime
- name: Build test assets
run: |
cd example/opensnoop
make -j
- name: Test CLI - show help
run: |
export PATH=$PATH:~/.bpftime
bpftime --help
- name: Test CLI - attach by running
shell: "sudo /bin/bash -e {0}"
run: |
cd example/opensnoop
timeout -s 2 30s sudo -E /home/runner/.bpftime/bpftime -i /home/runner/.bpftime load ./opensnoop || if [ $? = 124 ]; then exit 0; else exit $?; fi &
sleep 3s
ID1=$!
timeout -s 2 15s /home/runner/.bpftime/bpftime -i /home/runner/.bpftime start -s ./victim || if [ $? = 124 ]; then exit 0; else exit $?; fi
fg $ID1 || true