Skip to content

Commit

Permalink
Merge branch 'master' into new_code_style
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
  • Loading branch information
Andreagit97 authored Aug 27, 2024
2 parents f1ff3ae + eb374bc commit 135cc56
Show file tree
Hide file tree
Showing 1,410 changed files with 735,412 additions and 93,418 deletions.
30 changes: 29 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@
> /kind feature
<!--
Please remove the leading whitespace before the `/kind <>` you uncommented.
-->

**Any specific area of the project related to this PR?**

> Uncomment one (or more) `/area <>` lines:
> /area API-version
> /area build
> /area CI
> /area driver-kmod
> /area driver-bpf
Expand All @@ -48,10 +56,12 @@
> /area libscap-engine-source-plugin
> /area libscap-engine-udig
> /area libscap-engine-savefile
> /area libscap
> /area libpman
> /area libsinsp
> /area tests
Expand All @@ -62,6 +72,24 @@
Please remove the leading whitespace before the `/area <>` you uncommented.
-->

**Does this PR require a change in the driver versions?**

> /version driver-API-version-major
> /version driver-API-version-minor
> /version driver-API-version-patch
> /version driver-SCHEMA-version-major
> /version driver-SCHEMA-version-minor
> /version driver-SCHEMA-version-patch
<!--
Please remove the leading whitespace before the `/version <>` you uncommented.
-->

**What this PR does / why we need it**:

**Which issue(s) this PR fixes**:
Expand Down
81 changes: 81 additions & 0 deletions .github/actions/composite-perf/action.yml
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
68 changes: 68 additions & 0 deletions .github/install-deps.sh
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"
Loading

0 comments on commit 135cc56

Please sign in to comment.