Skip to content

new: add setre*id syscall family #63

new: add setre*id syscall family

new: add setre*id syscall family #63

Workflow file for this run

name: Perf CI
on:
pull_request:
workflow_dispatch:
# Checks if any concurrent jobs under the same pull request or branch are being executed
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-perf
cancel-in-progress: true
jobs:
perf-libs-linux-amd64:
runs-on: [ "self-hosted", "linux", "X64" ]
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run perf
id: perf
uses: ./.github/actions/composite-perf
- name: Download latest master report
uses: dawidd6/action-download-artifact@v6
with:
search_artifacts: true
branch: master
event: push
name: perf_report
- name: Diff from master - unit tests
run: |
sudo perf diff perf_tests.data ${{ steps.perf.outputs.perf_tests }} -d unit-test-libsinsp -b -o 1 --percentage relative -q &> perf_tests_diff.txt
- name: Diff from master - scap file
run: |
sudo perf diff perf_scap.data ${{ steps.perf.outputs.perf_scap }} -d sinsp-example -b -o 1 --percentage relative -q &> perf_scap_diff.txt
- name: Archive perf diff
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: perf_diff
path: perf_*_diff.txt
if-no-files-found: error
- name: Save PR info
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
touch ./pr/COMMENT
echo "# Perf diff from master - unit tests" >> ./pr/COMMENT
echo "\`\`\`" >> ./pr/COMMENT
head -n10 "perf_tests_diff.txt" >> ./pr/COMMENT
echo "\`\`\`" >> ./pr/COMMENT
echo "" >> ./pr/COMMENT
echo "# Perf diff from master - scap file" >> ./pr/COMMENT
echo "\`\`\`" >> ./pr/COMMENT
head -n10 "perf_scap_diff.txt" >> ./pr/COMMENT
echo "\`\`\`" >> ./pr/COMMENT
echo Uploading PR info...
cat ./pr/COMMENT
echo ""
- name: Upload PR info as artifact
uses: actions/upload-artifact@v4
with:
name: pr
path: pr/
retention-days: 1
if-no-files-found: warn
# Check will fail if there is any function slowed down >=3% (relative).
# But we will always comment with the perf diff from master
- name: Check >= 3% threshold - unit tests
run: |
awk '{if (substr($2,RSTART+RLENGTH)+0 >= 3) print }' perf_tests_diff.txt &> perf_diff_above_thresh.txt
if [ -s perf_diff_above_thresh.txt ]; then
exit 1
fi
# Check will fail if there is any function slowed down >=10% (relative).
# Larger threshold since scap file perf seems much more unstable.
# But we will always comment with the perf diff from master
- name: Check >= 10% threshold - scap file
if: always() # Even if unit tests threshold check failed
run: |
awk '{if (substr($2,RSTART+RLENGTH)+0 >= 10) print }' perf_scap_diff.txt &> perf_diff_above_thresh.txt
if [ -s perf_diff_above_thresh.txt ]; then
exit 1
fi