Skip to content

Commit

Permalink
Sync master to 6.0/stage for 6.0.8.0 release (#16) (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcd1193182 authored Apr 20, 2021
1 parent 8835e30 commit 39560a5
Show file tree
Hide file tree
Showing 392 changed files with 22,183 additions and 10,101 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ recent version yet. Please make sure the bug reproduces on the latest release
or master.
-->

### bpftrace --info
<!--
Place output here.
-->

### What reproduces the bug?
<!--
Enter details about your bug, preferably with a small code snippet.
Also describe what you expect to happen.
-->

### bpftrace --info
<!--
Place output here.
-->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Community Support
url: https://bpftrace.discourse.group/
about: Please ask and answer questions here
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Then please complete the checklist.

- [ ] Language changes are updated in `docs/reference_guide.md`
- [ ] User-visible and non-trivial changes updated in `CHANGELOG.md`
- [ ] The new behaviour is covered by tests
65 changes: 53 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,80 +31,121 @@ jobs:
TYPE: Debug
LLVM_VERSION: "6.0"
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 6 Release
TYPE: Release
LLVM_VERSION: "6.0"
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 7 Debug
TYPE: Debug
LLVM_VERSION: 7
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 7 Release
TYPE: Release
LLVM_VERSION: 7
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 8 Debug
TYPE: Debug
LLVM_VERSION: 8
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 8 Release
TYPE: Release
LLVM_VERSION: 8
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 9 Debug
TYPE: Debug
LLVM_VERSION: 9
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 9 Release
TYPE: Release
LLVM_VERSION: 9
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 10 Debug
TYPE: Debug
LLVM_VERSION: 10
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 10 Release
TYPE: Release
LLVM_VERSION: 10
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 10 Clang Debug
TYPE: Debug
LLVM_VERSION: 10
CC: clang-10
CXX: clang++-10
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 11 Debug
TYPE: Debug
LLVM_VERSION: 11
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 11 Release
TYPE: Release
LLVM_VERSION: 11
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
- NAME: LLVM 12 Release
TYPE: Release
LLVM_VERSION: 12
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size
BASE: bionic
steps:
- uses: actions/checkout@v2
- name: Get date
id: get-date
run: echo "::set-output name=date::$(/bin/date -u "+%Y.week%g")"
shell: bash
- name: Cache docker image
env: ${{matrix.env}}
id: docker-cache
uses: actions/cache@v2
with:
path: /tmp/docker-save
# Key the cache entry by:
# * the operating system
# * the week (so cache gets invalidated every week)
# * the image configuration (ie llvm version & distro)
# * the hash of all the files in docker/
key: ${{ runner.os }}-docker-cache-${{ steps.get-date.outputs.date }}-${{ env.NAME }}-${{ hashFiles('docker/**') }}
- name: Build docker container
if: steps.docker-cache.outputs.cache-hit != 'true'
env: ${{matrix.env}}
run: >
docker build
--build-arg LLVM_VERSION=$LLVM_VERSION
-t bpftrace-builder-$BASE-llvm-$LLVM_VERSION
-f docker/Dockerfile.$BASE
docker/
docker/ &&
mkdir -p /tmp/docker-save &&
docker save bpftrace-builder-$BASE-llvm-$LLVM_VERSION -o /tmp/docker-save/i.tar
- name: Load the cached docker image (if available)
if: steps.docker-cache.outputs.cache-hit == 'true'
run: >
docker load --input /tmp/docker-save/i.tar
- name: Build and test
env: ${{matrix.env}}
run: >
Expand Down
141 changes: 110 additions & 31 deletions .github/workflows/embedded.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Embedded Builds

on: push
on: [push, pull_request]
jobs:
llvm_clang:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -52,23 +52,6 @@ jobs:
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
BASE: bionic
DISTRO: ubuntu-glibc
- TYPE: Release
NAME: vanilla_llvm+clang+glibc2.27_edge
EDGE: ON
BCC_REF: master
LLVM_VERSION: 9
STATIC_LINKING: ON
STATIC_LIBC: OFF
EMBED_LLVM: ON
EMBED_CLANG: ON
EMBED_LIBCLANG_ONLY: OFF
EMBED_BCC: OFF
EMBED_LIBELF: OFF
EMBED_BINUTILS: OFF
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: builtin.cgroup,probe.kprobe_offset_fail_size
BASE: bionic
DISTRO: ubuntu-glibc
- TYPE: Release
NAME: vanilla_llvm+clang+glibc2.23
LLVM_VERSION: 8
Expand Down Expand Up @@ -98,7 +81,7 @@ jobs:
EMBED_BINUTILS: OFF
RUN_ALL_TESTS: 1
TEST_GROUPS_DISABLE: "tools-parsing-test"
RUNTIME_TEST_DISABLE: json-output.join_delim,other.string compare map lookup,probe.kprobe_offset_fail_size,usdt."usdt probes - attach to fully specified probe of child",usdt."usdt probes - all probes by wildcard and file with child",usdt."usdt probes - attach to probe by wildcard and file with child",usdt."usdt probes - attach to probes by wildcard file with child",usdt."usdt probes - attach to probe with probe builtin and args by file with child",usdt."usdt probes - list probes by pid in separate mountns",usdt."usdt sized arguments",uprobe."uprobes - list probes by pid; uprobes only",uprobe."uprobes - list probes by pid in separate mount namespace"
RUNTIME_TEST_DISABLE: json-output.join_delim,other.string compare map lookup,probe.kprobe_offset_fail_size,usdt."usdt probes - attach to fully specified probe of child",usdt."usdt probes - all probes by wildcard and file with child",usdt."usdt probes - attach to probe by wildcard and file with child",usdt."usdt probes - attach to probes by wildcard file with child",usdt."usdt probes - attach to probe on multiple files by wildcard",usdt."usdt probes - attach to probe with probe builtin and args by file with child",usdt."usdt probes - list probes by pid in separate mountns",usdt."usdt sized arguments",usdt."usdt - list probes by file with wildcarded probe type",uprobe."uprobes - list probes by pid; uprobes only",uprobe."uprobes - list probes by pid in separate mount namespace",other.positional pointer arithmetics
BASE: alpine
DISTRO: alpine
ALPINE_VERSION: 3.11
Expand All @@ -114,28 +97,112 @@ jobs:
EMBED_LIBELF: OFF
EMBED_BINUTILS: OFF
RUN_ALL_TESTS: 1
RUNTIME_TEST_DISABLE: other.string compare map lookup,probe.kprobe_offset_fail_size,usdt."usdt probes - attach to fully specified probe of child",usdt."usdt probes - all probes by wildcard and file with child",usdt."usdt probes - attach to probe by wildcard and file with child",usdt."usdt probes - attach to probes by wildcard file with child",usdt."usdt probes - attach to probe with probe builtin and args by file with child",usdt."usdt probes - list probes by pid in separate mountns",usdt."usdt sized arguments",uprobe."uprobes - list probes by pid; uprobes only",uprobe."uprobes - list probes by pid in separate mount namespace"
RUNTIME_TEST_DISABLE: other.string compare map lookup,probe.kprobe_offset_fail_size,usdt."usdt probes - attach to fully specified probe of child",usdt."usdt probes - all probes by wildcard and file with child",usdt."usdt probes - attach to probe by wildcard and file with child",usdt."usdt probes - attach to probes by wildcard file with child",usdt."usdt probes - attach to probe on multiple files by wildcard",usdt."usdt probes - attach to probe with probe builtin and args by file with child",usdt."usdt probes - list probes by pid in separate mountns",usdt."usdt sized arguments",usdt."usdt - list probes by file with wildcarded probe type",uprobe."uprobes - list probes by pid; uprobes only",uprobe."uprobes - list probes by pid in separate mount namespace",other.positional pointer arithmetics
BASE: alpine
DISTRO: alpine
ALPINE_VERSION: 3.11
steps:
- uses: actions/checkout@v2
- name: Get date
id: get-date
run: echo "::set-output name=date::$(/bin/date -u "+%Y.week%g")"
shell: bash
- name: Cache docker image
env: ${{matrix.env}}
id: docker-cache
uses: actions/cache@v2
with:
path: /tmp/docker-save
# Key the cache entry by:
# * the operating system
# * the week (so cache gets invalidated every week)
# * the image configuration (ie config + build type)
# * the hash of all the files in docker/
key: ${{ runner.os }}-docker-cache-${{ steps.get-date.outputs.date }}-${{ env.NAME }}-${{ env.TYPE }}-${{ hashFiles('docker/**') }}
- name: Build docker container
run: |
docker build -t bpftrace-embedded-${{ matrix.env['BASE'] }} -f docker/Dockerfile.${{ matrix.env['DISTRO'] }} --build-arg bcc_ref=${{ matrix.env['BCC_REF'] }} --build-arg BASE=${{ matrix.env['BASE'] }} --build-arg ALPINE_VERSION=${{ matrix.env['ALPINE_VERSION'] }} docker/
if: steps.docker-cache.outputs.cache-hit != 'true'
run: >
docker build
-t bpftrace-embedded-${{ matrix.env['BASE'] }}
-f docker/Dockerfile.${{ matrix.env['DISTRO'] }}
--build-arg bcc_ref=${{ matrix.env['BCC_REF'] }}
--build-arg BASE=${{ matrix.env['BASE'] }}
--build-arg ALPINE_VERSION=${{ matrix.env['ALPINE_VERSION'] }}
docker/ &&
mkdir -p /tmp/docker-save &&
docker save bpftrace-embedded-${{ matrix.env['BASE'] }} -o /tmp/docker-save/i.tar
- name: Load the cached docker image (if available)
if: steps.docker-cache.outputs.cache-hit == 'true'
run: >
docker load --input /tmp/docker-save/i.tar
- name: bpftrace embedded build
env: ${{ matrix.env }}
run: |
docker run --privileged -v $(pwd):$(pwd) -w $(pwd) -v /sys/kernel/debug:/sys/kernel/debug:rw -v /lib/modules:/lib/modules:ro -v /usr/src:/usr/src:ro -e STATIC_LINKING=${STATIC_LINKING} -e STATIC_LIBC=${STATIC_LIBC} -e EMBED_LLVM=${EMBED_LLVM} -e EMBED_CLANG=${EMBED_CLANG} -e EMBED_BCC=${EMBED_BCC} -e EMBED_LIBELF=${EMBED_LIBELF} -e EMBED_LIBCLANG_ONLY=${EMBED_LIBCLANG_ONLY} -e EMBED_BINUTILS=${EMBED_BINUTILS} -e RUN_ALL_TESTS=${RUN_ALL_TESTS} -e CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" -e TEST_GROUPS_DISABLE="${TEST_GROUPS_DISABLE}" -e RUNTIME_TEST_DISABLE="${RUNTIME_TEST_DISABLE}" bpftrace-embedded-${{ matrix.env['BASE'] }} $(pwd)/build-embedded ${TYPE} -j`nproc`
run: >
docker run --privileged
-v $(pwd):$(pwd)
-w $(pwd)
-v /sys/kernel/debug:/sys/kernel/debug:rw
-v /lib/modules:/lib/modules:ro
-v /usr/src:/usr/src:ro
-e LLVM_VERSION=${LLVM_VERSION}
-e STATIC_LINKING=${STATIC_LINKING}
-e STATIC_LIBC=${STATIC_LIBC}
-e EMBED_LLVM=${EMBED_LLVM}
-e EMBED_CLANG=${EMBED_CLANG}
-e EMBED_BCC=${EMBED_BCC}
-e EMBED_LIBELF=${EMBED_LIBELF}
-e EMBED_LIBCLANG_ONLY=${EMBED_LIBCLANG_ONLY}
-e EMBED_BINUTILS=${EMBED_BINUTILS}
-e RUN_ALL_TESTS=${RUN_ALL_TESTS}
-e CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}"
-e TEST_GROUPS_DISABLE="${TEST_GROUPS_DISABLE}"
-e RUNTIME_TEST_DISABLE="${RUNTIME_TEST_DISABLE}"
bpftrace-embedded-${{ matrix.env['BASE'] }}
$(pwd)/build-embedded ${TYPE}
-j`nproc`
- name: Check linked libs
env: ${{ matrix.env }}
run: |
docker run --privileged -v $(pwd):$(pwd) -w $(pwd) -v /sys/kernel/debug:/sys/kernel/debug:rw -v /lib/modules:/lib/modules:ro -v /usr/src:/usr/src:ro -e STATIC_LINKING=${STATIC_LINKING} -e STATIC_LIBC=${STATIC_LIBC} -e EMBED_LLVM=${EMBED_LLVM} -e EMBED_CLANG=${EMBED_CLANG} -e EMBED_BCC=${EMBED_BCC} -e EMBED_LIBELF=${EMBED_LIBELF} -e EMBED_LIBCLANG_ONLY=${EMBED_LIBCLANG_ONLY} -e EMBED_BINUTILS=${EMBED_BINUTILS} --entrypoint /bin/bash bpftrace-embedded-${{ matrix.env['BASE'] }} -c "[[ -f $(pwd)/build-embedded/src/bpftrace ]] && ! readelf --dynamic $(pwd)/build-embedded/src/bpftrace | grep NEEDED | grep -v 'libm\|libc\|ld-linux\|libpthread\|libdl'"
run: >
docker run --privileged
-v $(pwd):$(pwd)
-w $(pwd)
-v /sys/kernel/debug:/sys/kernel/debug:rw
-v /lib/modules:/lib/modules:ro
-v /usr/src:/usr/src:ro
-e LLVM_VERSION=${LLVM_VERSION}
-e STATIC_LINKING=${STATIC_LINKING}
-e STATIC_LIBC=${STATIC_LIBC}
-e EMBED_LLVM=${EMBED_LLVM}
-e EMBED_CLANG=${EMBED_CLANG}
-e EMBED_BCC=${EMBED_BCC}
-e EMBED_LIBELF=${EMBED_LIBELF}
-e EMBED_LIBCLANG_ONLY=${EMBED_LIBCLANG_ONLY}
-e EMBED_BINUTILS=${EMBED_BINUTILS}
--entrypoint /bin/bash
bpftrace-embedded-${{ matrix.env['BASE'] }}
-c "[[ -f $(pwd)/build-embedded/src/bpftrace ]] && ! readelf --dynamic $(pwd)/build-embedded/src/bpftrace | grep NEEDED | grep -v 'libm\|libc\|ld-linux\|libpthread\|libdl'"
- name: Strip artifacts
env: ${{ matrix.env }}
if: matrix.env['TYPE'] == 'Release'
run: |
docker run --privileged -v $(pwd):$(pwd) -w $(pwd) -v /sys/kernel/debug:/sys/kernel/debug:rw -v /lib/modules:/lib/modules:ro -v /usr/src:/usr/src:ro -e STATIC_LINKING=${STATIC_LINKING} -e STATIC_LIBC=${STATIC_LIBC} -e EMBED_LLVM=${EMBED_LLVM} -e EMBED_CLANG=${EMBED_CLANG} -e EMBED_BCC=${EMBED_BCC} -e EMBED_LIBELF=${EMBED_LIBELF} -e EMBED_LIBCLANG_ONLY=${EMBED_LIBCLANG_ONLY} -e EMBED_BINUTILS=${EMBED_BINUTILS} --entrypoint /bin/bash bpftrace-embedded-${{ matrix.env['BASE'] }} -c "strip --keep-symbol BEGIN_trigger $(pwd)/build-embedded/src/bpftrace"
run: >
docker run --privileged
-v $(pwd):$(pwd)
-w $(pwd)
-v /sys/kernel/debug:/sys/kernel/debug:rw
-v /lib/modules:/lib/modules:ro
-v /usr/src:/usr/src:ro
-e LLVM_VERSION=${LLVM_VERSION}
-e STATIC_LINKING=${STATIC_LINKING}
-e STATIC_LIBC=${STATIC_LIBC}
-e EMBED_LLVM=${EMBED_LLVM}
-e EMBED_CLANG=${EMBED_CLANG}
-e EMBED_BCC=${EMBED_BCC}
-e EMBED_LIBELF=${EMBED_LIBELF}
-e EMBED_LIBCLANG_ONLY=${EMBED_LIBCLANG_ONLY}
-e EMBED_BINUTILS=${EMBED_BINUTILS}
--entrypoint /bin/bash
bpftrace-embedded-${{ matrix.env['BASE'] }}
-c "strip --keep-symbol BEGIN_trigger --keep-symbol END_trigger $(pwd)/build-embedded/src/bpftrace"
- uses: actions/upload-artifact@v1
with:
Expand All @@ -147,11 +214,23 @@ jobs:
path: build-embedded/tests/bpftrace_test

- name: Authenticate with docker registry
if: matrix.env['TYPE'] == 'Release' && github.ref == 'refs/heads/master' && github.repository == 'iovisor/bpftrace'
if: >
matrix.env['TYPE'] == 'Release' &&
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) &&
github.repository == 'iovisor/bpftrace'
env:
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
run: ./docker/scripts/auth.sh ${{ github.repository }}

- name: Package docker image and push to quay.io
if: matrix.env['TYPE'] == 'Release' && github.ref == 'refs/heads/master' && github.repository == 'iovisor/bpftrace'
run: ./docker/scripts/push.sh ${{ github.repository }} ${{ github.ref }} ${{ github.sha }} ${{ matrix.env['NAME'] }} ${{ matrix.env['EDGE'] }}
if: >
matrix.env['TYPE'] == 'Release' &&
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) &&
github.repository == 'iovisor/bpftrace'
run: >
./docker/scripts/push.sh
${{ github.repository }}
${{ github.ref }}
${{ github.sha }}
${{ matrix.env['NAME'] }}
${{ matrix.env['EDGE'] }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build/
build-*/
tests/runtime/*.pyc
.vagrant
tests/**/*.bc
Loading

0 comments on commit 39560a5

Please sign in to comment.