-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new(ci): move perf CI to a composite action.
It will be ran by perf CI on PRs and pages CI on master. Also, add a new gh pages section with flamegraphs built from master. Signed-off-by: Federico Di Pierro <[email protected]>
- Loading branch information
Showing
7 changed files
with
154 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: 'libs-perf' | ||
description: 'Run multiple perf tests on libs.' | ||
|
||
outputs: | ||
perf_tests: | ||
description: "Unit tests perf.data" | ||
value: ${{ steps.store-outputs.outputs.tests }} | ||
perf_scap: | ||
description: "Scap file perf.data" | ||
value: ${{ steps.store-outputs.outputs.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 | ||
sudo .github/install-deps.sh | ||
- name: Build | ||
shell: bash | ||
run: | | ||
mkdir -p build | ||
cd build && cmake -DUSE_BUNDLED_DEPS=False ../ | ||
make unit-test-libsinsp -j4 | ||
make sinsp-example -j4 | ||
- 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 | ||
- name: Run Perf - scap file | ||
shell: bash | ||
run: | | ||
cd build | ||
wget https://download.falco.org/fixtures/trace-files/traces-positive.zip | ||
unzip traces-positive.zip | ||
sudo perf record --call-graph dwarf -o perf_scap.data -q ./libsinsp/examples/sinsp-example -s traces-positive/falco-event-generator.scap | ||
- name: Set Outputs | ||
id: store-outputs | ||
shell: bash | ||
run: | | ||
echo "tests=${{ github.action_path }}/build/perf_tests.data" >> $GITHUB_OUTPUT | ||
echo "scap=${{ github.action_path }}/build/perf_scap.data" >> $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,20 @@ | ||
# Small script used by pages workflow | ||
# to generate markdown pages with inlined svgs. | ||
|
||
import sys | ||
import base64 | ||
|
||
def generate_md(svg): | ||
b64 = base64.b64encode(svg.encode('utf-8')).decode("utf-8") | ||
html = r'<img src="data:image/svg+xml;base64,%s"/>' % b64 | ||
with open("out.md", "w") as f: | ||
f.write(html) | ||
|
||
def inline_svg_to_md(svg_file): | ||
with open(svg_file, "r") as f: | ||
lines = f.readlines() | ||
svg=''.join(lines) | ||
generate_md(svg) | ||
|
||
if __name__ == '__main__': | ||
inline_svg_to_md(sys.argv[1]) |
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
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,8 @@ | ||
# Home of Falco Perf Monitoring | ||
|
||
Our CI is capable of continuosuly benchmarking performance of our userspace code. | ||
Every PR will have a comment with the perf diff from master for multiple aspects, while on master the flamegraph are pushed to this github pages. | ||
|
||
Navigate to the perf reports on the left, or click these links: | ||
* [unit tests perf](unit_tests.md) | ||
* [scap file reading perf](scap_file.md) |
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