-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into new_code_style
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
- Loading branch information
Showing
1,410 changed files
with
735,412 additions
and
93,418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: 'libs-perf' | ||
description: 'Run multiple perf tests on libs.' | ||
|
||
outputs: | ||
perf_tests: | ||
description: "Unit tests perf.data" | ||
value: ${{ steps.store-outputs.outputs.perf_tests }} | ||
perf_scap: | ||
description: "Scap file perf.data" | ||
value: ${{ steps.store-outputs.outputs.perf_scap }} | ||
heaptrack_tests: | ||
description: "Unit tests heaptrack data" | ||
value: ${{ steps.store-outputs.outputs.heaptrack_tests }} | ||
heaptrack_scap: | ||
description: "Scap file heaptrack data" | ||
value: ${{ steps.store-outputs.outputs.heaptrack_scap }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install deps ⛓️ | ||
shell: bash | ||
run: | | ||
sudo apt update && sudo apt install -y --no-install-recommends ca-certificates cmake build-essential git clang llvm pkg-config autoconf automake libtool libelf-dev wget libc-ares-dev libcurl4-openssl-dev libssl-dev libtbb-dev libjq-dev libjsoncpp-dev libgrpc++-dev protobuf-compiler-grpc libgtest-dev libprotobuf-dev linux-tools-common linux-tools-generic linux-tools-`uname -r` heaptrack coreutils util-linux | ||
sudo .github/install-deps.sh | ||
- name: Build | ||
shell: bash | ||
run: | | ||
mkdir -p build | ||
cd build && cmake -DUSE_BUNDLED_DEPS=False -DCMAKE_BUILD_TYPE=Debug ../ | ||
make unit-test-libsinsp -j4 | ||
make sinsp-example -j4 | ||
- name: Download scap file | ||
shell: bash | ||
run: | | ||
cd build | ||
wget https://download.falco.org/fixtures/trace-files/traces-positive.zip | ||
unzip traces-positive.zip | ||
- name: Run - perf unit tests | ||
shell: bash | ||
run: | | ||
cd build | ||
sudo perf record --call-graph dwarf -o perf_tests.data -q libsinsp/test/unit-test-libsinsp | ||
# First empty run to stabilize disk IO (scap file read) perf | ||
- name: Run - load scap file | ||
shell: bash | ||
run: | | ||
cd build | ||
sudo ./libsinsp/examples/sinsp-example -s traces-positive/falco-event-generator.scap &> /dev/null | ||
- name: Run - perf scap file | ||
shell: bash | ||
run: | | ||
cd build | ||
sudo perf record --call-graph dwarf -o perf_scap.data -q ./libsinsp/examples/sinsp-example -s traces-positive/falco-event-generator.scap | ||
- name: Run - heaptrack unit tests | ||
shell: bash | ||
run: | | ||
cd build | ||
sudo heaptrack -o heaptrack_tests.data libsinsp/test/unit-test-libsinsp | ||
- name: Run - heaptrack scap file | ||
shell: bash | ||
run: | | ||
cd build | ||
sudo heaptrack -o heaptrack_scap.data ./libsinsp/examples/sinsp-example -s traces-positive/falco-event-generator.scap | ||
- name: Set Outputs | ||
id: store-outputs | ||
shell: bash | ||
run: | | ||
cd build | ||
echo "perf_tests=$(realpath perf_tests.data)" >> $GITHUB_OUTPUT | ||
echo "perf_scap=$(realpath perf_scap.data)" >> $GITHUB_OUTPUT | ||
echo "heaptrack_tests=$(realpath heaptrack_tests.data.zst)" >> $GITHUB_OUTPUT | ||
echo "heaptrack_scap=$(realpath heaptrack_scap.data.zst)" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright (C) 2023 The Falco Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set -e | ||
|
||
mkdir -p third_party | ||
cd third_party | ||
|
||
# === Valijson === | ||
echo "=== Building and installing valijson v0.6 ===" | ||
|
||
wget "https://github.com/tristanpenman/valijson/archive/refs/tags/v0.6.tar.gz" | ||
|
||
tar xzf v0.6.tar.gz | ||
pushd valijson-0.6 | ||
|
||
mkdir -p build | ||
cd build | ||
|
||
cmake \ | ||
-Dvalijson_INSTALL_HEADERS=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-Dvalijson_BUILD_TESTS=OFF \ | ||
../ | ||
|
||
make install -j | ||
popd | ||
|
||
|
||
# === RE2 === | ||
echo "=== Building and installing re2 (v2022-06-01) ===" | ||
|
||
wget "https://github.com/google/re2/archive/refs/tags/2022-06-01.tar.gz" | ||
tar xzf 2022-06-01.tar.gz | ||
pushd re2-2022-06-01 | ||
|
||
# see: https://github.com/google/re2/wiki/Install | ||
mkdir -p build-re2 | ||
cd build-re2 | ||
cmake \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DRE2_BUILD_TESTING=OFF \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
.. | ||
make -j | ||
make install -j | ||
popd | ||
|
||
# === uthash === | ||
echo "=== Downloading uthash.h (1.9.8) ===" | ||
|
||
wget -P "/usr/include" "https://raw.githubusercontent.com/troydhanson/uthash/v1.9.8/src/uthash.h" |
Oops, something went wrong.