From d62bb9036e9a9372d3421ef46b7457a49d018612 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Thu, 19 Feb 2026 21:32:46 +0000 Subject: [PATCH 1/8] Add Perfetto profiling support to CI workflow This commit adds Perfetto profiling as a matrix item in the cmake-build GitHub workflow, enabling performance profiling of the C++ codebase. Changes: - Add FindPerfetto.cmake module that searches standard locations (/opt/perfetto, /usr/local/include, /usr/include) and creates a Perfetto::Perfetto imported target following CMake best practices - Add ENABLE_PERFETTO CMake option and integrate Perfetto SDK linking to the phlex executable when profiling is enabled - Install Perfetto SDK (perfetto.h and perfetto.cc) in CI Docker image at /opt/perfetto for use during CI builds - Add gcc/perfetto and clang/perfetto to available build matrix combinations in generate_matrix.py - Add dedicated workflow step for Perfetto profiling runs that executes tests with profiling enabled, following the pattern established by the Valgrind step - Add weekly scheduled trigger (Saturdays at 18:00 UTC) that runs gcc/perfetto by default for regular performance profiling The implementation follows existing workflow conventions for modularity, naming, and reusable actions. Users can trigger Perfetto builds via workflow_dispatch, issue comments (@phlexbot build gcc/perfetto), or wait for the weekly scheduled run. --- .../generate-build-matrix/generate_matrix.py | 10 +++---- .github/workflows/cmake-build.yaml | 23 ++++++++++++++- .gitignore | 1 + CMakeLists.txt | 13 +++++++++ Modules/FindPerfetto.cmake | 29 +++++++++++++++++++ ci/Dockerfile | 20 +++++++++++++ 6 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 Modules/FindPerfetto.cmake diff --git a/.github/actions/generate-build-matrix/generate_matrix.py b/.github/actions/generate-build-matrix/generate_matrix.py index a7d7e9f7d..c559463de 100644 --- a/.github/actions/generate-build-matrix/generate_matrix.py +++ b/.github/actions/generate-build-matrix/generate_matrix.py @@ -7,12 +7,10 @@ def get_default_combinations(event_name, all_combinations): """Gets the default build combinations based on the GitHub event type.""" - if event_name in ("push", "pull_request", "pull_request_target"): + if event_name in ("push", "pull_request", "pull_request_target", "issue_comment", "workflow_dispatch"): return ["gcc/none"] - elif event_name == "issue_comment": - return ["gcc/none", "clang/none"] - elif event_name == "workflow_dispatch": - return all_combinations + elif event_name == "schedule": + return ["gcc/perfetto"] else: # Default to a minimal safe configuration for unknown events return ["gcc/none"] @@ -25,10 +23,12 @@ def main(): "gcc/asan", "gcc/tsan", "gcc/valgrind", + "gcc/perfetto", "clang/none", "clang/asan", "clang/tsan", "clang/valgrind", + "clang/perfetto", ] user_input = os.getenv("USER_INPUT", "") comment_body = os.getenv("COMMENT_BODY", "") diff --git a/.github/workflows/cmake-build.yaml b/.github/workflows/cmake-build.yaml index 310f79a41..debc101ba 100644 --- a/.github/workflows/cmake-build.yaml +++ b/.github/workflows/cmake-build.yaml @@ -7,6 +7,8 @@ on: types: [created] push: branches: [ main, develop ] + schedule: + - cron: '07 18 * * 6' workflow_dispatch: inputs: ref: @@ -76,6 +78,7 @@ jobs: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' || github.event_name == 'push' || + github.event_name == 'schedule' || github.event_name == 'workflow_call' || ( github.event_name == 'issue_comment' && @@ -224,6 +227,7 @@ jobs: extra-options: | ${{ matrix.sanitizer == 'asan' && format('-D{0}_ENABLE_ASAN=ON', steps.repo_name.outputs.name) || '' }} ${{ matrix.sanitizer == 'tsan' && format('-D{0}_ENABLE_TSAN=ON', steps.repo_name.outputs.name) || '' }} + ${{ matrix.sanitizer == 'perfetto' && format('-D{0}_ENABLE_PERFETTO=ON', steps.repo_name.outputs.name) || '' }} - name: Build id: build @@ -232,7 +236,7 @@ jobs: build-path: ${{ env.local_build_path }} - name: Run tests - if: matrix.sanitizer != 'valgrind' + if: matrix.sanitizer != 'valgrind' && matrix.sanitizer != 'perfetto' run: | . /entrypoint.sh cd "$GITHUB_WORKSPACE/${{ env.local_build_path }}" @@ -264,6 +268,23 @@ jobs: echo "⚠️ Valgrind tests failed, but the workflow will continue." fi + - name: Run Perfetto profiling + if: matrix.sanitizer == 'perfetto' + run: | + . /entrypoint.sh + cd "$GITHUB_WORKSPACE/${{ env.local_build_path }}" + + echo "➡️ Running tests with Perfetto profiling..." + echo "::group::Running ctest with Perfetto" + if ctest --progress --output-on-failure -j "$(nproc)"; then + echo "::endgroup::" + echo "✅ Perfetto profiling completed." + else + echo "::endgroup::" + echo "::error:: Perfetto profiling failed." + exit 1 + fi + cmake-build-skipped: needs: [pre-check, detect-changes] if: > diff --git a/.gitignore b/.gitignore index 931fc4922..23bce7796 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /_deps/ /build-*/ /build/ +/out/ /phlex-build/ /phlex-src/ CMakeFiles/ diff --git a/CMakeLists.txt b/CMakeLists.txt index a5547316f..0a1f21d83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,7 @@ include(Modules/private/CreateCoverageTargets.cmake) option(ENABLE_TSAN "Enable Thread Sanitizer" OFF) option(ENABLE_ASAN "Enable Address Sanitizer" OFF) +option(ENABLE_PERFETTO "Enable Perfetto profiling" OFF) option(PHLEX_USE_FORM "Enable experimental integration with FORM" OFF) option(ENABLE_COVERAGE "Enable code coverage instrumentation" OFF) option(ENABLE_CLANG_TIDY "Enable clang-tidy checks during build" OFF) @@ -145,6 +146,12 @@ if(ENABLE_ASAN) endif() endif() +# Configure Perfetto profiling if enabled +if(ENABLE_PERFETTO) + message(STATUS "Enabling Perfetto profiling") + find_package(Perfetto REQUIRED) +endif() + # Configure code coverage if enabled if(ENABLE_COVERAGE) # Check if the compiler supports code coverage @@ -187,6 +194,12 @@ endif() add_subdirectory(phlex) add_subdirectory(plugins) +# Link Perfetto to phlex executable if enabled +if(ENABLE_PERFETTO AND TARGET phlex) + target_link_libraries(phlex PRIVATE Perfetto::Perfetto) + target_compile_definitions(phlex PRIVATE PERFETTO_ENABLE_TRACING=1) +endif() + if(PHLEX_USE_FORM) set(BUILD_SHARED_LIBS OFF) # Temporary add_subdirectory(form) diff --git a/Modules/FindPerfetto.cmake b/Modules/FindPerfetto.cmake new file mode 100644 index 000000000..ca472a603 --- /dev/null +++ b/Modules/FindPerfetto.cmake @@ -0,0 +1,29 @@ +# FindPerfetto.cmake +# Finds the Perfetto SDK (single-header implementation) + +include(FindPackageHandleStandardArgs) + +find_path( + Perfetto_INCLUDE_DIR + NAMES perfetto.h + PATHS /opt/perfetto /usr/local/include /usr/include + DOC "Perfetto SDK header location" +) + +find_file( + Perfetto_SOURCE + NAMES perfetto.cc + PATHS /opt/perfetto /usr/local/include /usr/include + DOC "Perfetto SDK implementation file" +) + +find_package_handle_standard_args(Perfetto REQUIRED_VARS Perfetto_INCLUDE_DIR Perfetto_SOURCE) + +if(Perfetto_FOUND AND NOT TARGET Perfetto::Perfetto) + add_library(perfetto_impl STATIC "${Perfetto_SOURCE}") + target_include_directories(perfetto_impl PUBLIC "${Perfetto_INCLUDE_DIR}") + target_compile_definitions(perfetto_impl PUBLIC PERFETTO_ENABLE_TRACING=1) + add_library(Perfetto::Perfetto ALIAS perfetto_impl) +endif() + +mark_as_advanced(Perfetto_INCLUDE_DIR Perfetto_SOURCE) diff --git a/ci/Dockerfile b/ci/Dockerfile index 3b6087e7c..16c9421b1 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -280,6 +280,26 @@ set -euo pipefail rm -f /tmp/spack.yaml CLEAN_TEMP_FILES +######################################################################## +# Install Perfetto SDK for profiling + +RUN <<'INSTALL_PERFETTO' +set -euo pipefail + +# Install Perfetto SDK +apt-get update +apt-get install -y --no-install-recommends \ + wget +apt-get clean +rm -rf /var/lib/apt/lists/* + +mkdir -p /opt/perfetto +cd /opt/perfetto +wget -O perfetto.h https://raw.githubusercontent.com/google/perfetto/main/sdk/perfetto.h +wget -O perfetto.cc https://raw.githubusercontent.com/google/perfetto/main/sdk/perfetto.cc +chmod 644 perfetto.h perfetto.cc +INSTALL_PERFETTO + ######################################################################## # Finalize CI image stage From daf121484d1717c278d98d273070fd021ae4827f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 22:17:40 +0000 Subject: [PATCH 2/8] Apply ruff fixes --- .github/actions/generate-build-matrix/generate_matrix.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/generate-build-matrix/generate_matrix.py b/.github/actions/generate-build-matrix/generate_matrix.py index c559463de..4b8db62af 100644 --- a/.github/actions/generate-build-matrix/generate_matrix.py +++ b/.github/actions/generate-build-matrix/generate_matrix.py @@ -7,7 +7,13 @@ def get_default_combinations(event_name, all_combinations): """Gets the default build combinations based on the GitHub event type.""" - if event_name in ("push", "pull_request", "pull_request_target", "issue_comment", "workflow_dispatch"): + if event_name in ( + "push", + "pull_request", + "pull_request_target", + "issue_comment", + "workflow_dispatch", + ): return ["gcc/none"] elif event_name == "schedule": return ["gcc/perfetto"] From 7139789cf1cb46dd75215006debabce436815660 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Thu, 19 Feb 2026 16:47:33 -0600 Subject: [PATCH 3/8] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/cmake-build.yaml | 2 +- CMakeLists.txt | 2 +- Modules/FindPerfetto.cmake | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-build.yaml b/.github/workflows/cmake-build.yaml index debc101ba..853770cc0 100644 --- a/.github/workflows/cmake-build.yaml +++ b/.github/workflows/cmake-build.yaml @@ -8,7 +8,7 @@ on: push: branches: [ main, develop ] schedule: - - cron: '07 18 * * 6' + - cron: '7 18 * * 6' workflow_dispatch: inputs: ref: diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a1f21d83..ea43beb18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,7 +197,7 @@ add_subdirectory(plugins) # Link Perfetto to phlex executable if enabled if(ENABLE_PERFETTO AND TARGET phlex) target_link_libraries(phlex PRIVATE Perfetto::Perfetto) - target_compile_definitions(phlex PRIVATE PERFETTO_ENABLE_TRACING=1) + endif() if(PHLEX_USE_FORM) diff --git a/Modules/FindPerfetto.cmake b/Modules/FindPerfetto.cmake index ca472a603..093f7a2b1 100644 --- a/Modules/FindPerfetto.cmake +++ b/Modules/FindPerfetto.cmake @@ -20,9 +20,11 @@ find_file( find_package_handle_standard_args(Perfetto REQUIRED_VARS Perfetto_INCLUDE_DIR Perfetto_SOURCE) if(Perfetto_FOUND AND NOT TARGET Perfetto::Perfetto) + find_package(Threads REQUIRED) add_library(perfetto_impl STATIC "${Perfetto_SOURCE}") target_include_directories(perfetto_impl PUBLIC "${Perfetto_INCLUDE_DIR}") target_compile_definitions(perfetto_impl PUBLIC PERFETTO_ENABLE_TRACING=1) + target_link_libraries(perfetto_impl PUBLIC Threads::Threads) add_library(Perfetto::Perfetto ALIAS perfetto_impl) endif() From 1d6b32838fa2519a49165ff74b8de7762d79aa2d Mon Sep 17 00:00:00 2001 From: Chris Green Date: Fri, 20 Feb 2026 08:31:09 -0600 Subject: [PATCH 4/8] Change default matrix for `workflow_dispatch` --- .github/workflows/cmake-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-build.yaml b/.github/workflows/cmake-build.yaml index 853770cc0..2c6a95b2d 100644 --- a/.github/workflows/cmake-build.yaml +++ b/.github/workflows/cmake-build.yaml @@ -23,7 +23,7 @@ on: - `all` (run all combinations) - `all -clang/none -clang/valgrind` (run all except specified) - `+clang/none +clang/valgrind` (run default matrix plus specified) - Default (if empty): Run all except clang/none and clang/valgrind. + Default (if empty): Run `gcc/none` required: false default: '' workflow_call: From 9721944d166b82241cb9e771fc8ca19304326a94 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 03:28:24 +0000 Subject: [PATCH 5/8] Apply cmake-format fixes --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea43beb18..44802b385 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,7 +197,6 @@ add_subdirectory(plugins) # Link Perfetto to phlex executable if enabled if(ENABLE_PERFETTO AND TARGET phlex) target_link_libraries(phlex PRIVATE Perfetto::Perfetto) - endif() if(PHLEX_USE_FORM) From 5cb38ed4e1849c9363c64ebca66ea4b81ab18c38 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Thu, 19 Feb 2026 22:14:56 +0000 Subject: [PATCH 6/8] Upload Perfetto trace files as workflow artifacts Add artifact upload step to the Perfetto profiling workflow to capture trace files generated during test execution, enabling offline analysis via the Perfetto UI. Changes: - Add upload-artifact step after Perfetto profiling runs that collects all .pftrace files from the build directory - Name artifacts by compiler (perfetto-traces-gcc, perfetto-traces-clang) to distinguish between different compiler runs - Set 30-day retention period for trace files to allow sufficient time for analysis while managing storage costs - Configure if-no-files-found: warn to alert if profiling did not generate expected trace output Users can download the trace artifacts from the workflow run and analyze them at https://ui.perfetto.dev/ for detailed performance profiling and visualization of the test execution. --- .github/workflows/cmake-build.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cmake-build.yaml b/.github/workflows/cmake-build.yaml index 2c6a95b2d..97838cfb9 100644 --- a/.github/workflows/cmake-build.yaml +++ b/.github/workflows/cmake-build.yaml @@ -285,6 +285,15 @@ jobs: exit 1 fi + - name: Upload Perfetto traces + if: matrix.sanitizer == 'perfetto' + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: perfetto-traces-${{ matrix.compiler }} + path: '**/*.pftrace' + retention-days: 30 + if-no-files-found: warn + cmake-build-skipped: needs: [pre-check, detect-changes] if: > From acc241375bc1ee2805437e45a408cefdebbcffbd Mon Sep 17 00:00:00 2001 From: Chris Green Date: Fri, 20 Feb 2026 14:28:23 +0000 Subject: [PATCH 7/8] Add tracebox and advanced profiling support to Perfetto workflow Enable heap profiling, CPU profiling, and system-wide tracing via Perfetto's tracebox tool for comprehensive performance analysis. Changes: - Install tracebox binary in CI Docker image from get.perfetto.dev for system-wide profiling capabilities - Add workflow_dispatch inputs for perfetto-heap-profile and perfetto-cpu-profile to control profiling modes (CPU profiling enabled by default, heap profiling opt-in) - Add SYS_PTRACE capability and disable seccomp in container options to enable perf_event access required for CPU profiling - Configure perf_event_paranoid=-1 at runtime when CPU profiling is enabled to allow non-root access to performance counters - Update Perfetto profiling step to conditionally wrap ctest execution with tracebox when heap or CPU profiling is enabled, passing appropriate flags (--heapprofd for heap, --cpu-freq/--cpu-idle/ --cpu-sched for CPU) - Fall back to SDK-only tracing when no system profiling is requested Users can now enable heap profiling and CPU counter profiling via workflow_dispatch inputs to capture detailed memory allocation patterns and CPU performance metrics alongside application traces. --- .github/workflows/cmake-build.yaml | 47 +++++++++++++++++++++++++++--- ci/Dockerfile | 7 ++++- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake-build.yaml b/.github/workflows/cmake-build.yaml index 97838cfb9..cd8d46675 100644 --- a/.github/workflows/cmake-build.yaml +++ b/.github/workflows/cmake-build.yaml @@ -26,6 +26,16 @@ on: Default (if empty): Run `gcc/none` required: false default: '' + perfetto-heap-profile: + description: "Enable heap profiling for Perfetto runs" + required: false + type: boolean + default: false + perfetto-cpu-profile: + description: "Enable CPU profiling for Perfetto runs" + required: false + type: boolean + default: true workflow_call: inputs: checkout-path: @@ -193,6 +203,7 @@ jobs: container: image: ghcr.io/framework-r-d/phlex-ci:latest + options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined steps: - name: Check out code @@ -270,17 +281,45 @@ jobs: - name: Run Perfetto profiling if: matrix.sanitizer == 'perfetto' + env: + PERFETTO_HEAP_PROFILE: ${{ github.event.inputs.perfetto-heap-profile || 'false' }} + PERFETTO_CPU_PROFILE: ${{ github.event.inputs.perfetto-cpu-profile || 'true' }} run: | . /entrypoint.sh cd "$GITHUB_WORKSPACE/${{ env.local_build_path }}" echo "➡️ Running tests with Perfetto profiling..." - echo "::group::Running ctest with Perfetto" - if ctest --progress --output-on-failure -j "$(nproc)"; then - echo "::endgroup::" + + # Set perf_event_paranoid for CPU profiling + if [ "$PERFETTO_CPU_PROFILE" = "true" ]; then + echo "Configuring perf_event_paranoid for CPU profiling" + echo -1 | tee /proc/sys/kernel/perf_event_paranoid 2>/dev/null || echo "Warning: Could not set perf_event_paranoid" + fi + + # Configure profiling based on environment + TRACEBOX_ARGS="" + if [ "$PERFETTO_HEAP_PROFILE" = "true" ]; then + echo "Enabling heap profiling" + TRACEBOX_ARGS="$TRACEBOX_ARGS --app '*' --heapprofd" + fi + if [ "$PERFETTO_CPU_PROFILE" = "true" ]; then + echo "Enabling CPU profiling" + TRACEBOX_ARGS="$TRACEBOX_ARGS --cpu-freq --cpu-idle --cpu-sched" + fi + + # Run tests with or without tracebox wrapper + if [ -n "$TRACEBOX_ARGS" ]; then + echo "::group::Running ctest with tracebox" + tracebox $TRACEBOX_ARGS -o perfetto-trace.pftrace -- ctest --progress --output-on-failure -j "$(nproc)" || TEST_RESULT=$? + else + echo "::group::Running ctest with Perfetto SDK tracing" + ctest --progress --output-on-failure -j "$(nproc)" || TEST_RESULT=$? + fi + + echo "::endgroup::" + if [ "${TEST_RESULT:-0}" -eq 0 ]; then echo "✅ Perfetto profiling completed." else - echo "::endgroup::" echo "::error:: Perfetto profiling failed." exit 1 fi diff --git a/ci/Dockerfile b/ci/Dockerfile index 16c9421b1..95608900c 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -286,7 +286,7 @@ CLEAN_TEMP_FILES RUN <<'INSTALL_PERFETTO' set -euo pipefail -# Install Perfetto SDK +# Install Perfetto SDK and tools apt-get update apt-get install -y --no-install-recommends \ wget @@ -298,6 +298,11 @@ cd /opt/perfetto wget -O perfetto.h https://raw.githubusercontent.com/google/perfetto/main/sdk/perfetto.h wget -O perfetto.cc https://raw.githubusercontent.com/google/perfetto/main/sdk/perfetto.cc chmod 644 perfetto.h perfetto.cc + +# Install tracebox for system-wide profiling +wget -O tracebox https://get.perfetto.dev/tracebox +chmod +x tracebox +mv tracebox /usr/local/bin/ INSTALL_PERFETTO ######################################################################## From 66f454210eecc6ac00813b5d56900b04c1137643 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Fri, 20 Feb 2026 15:05:30 +0000 Subject: [PATCH 8/8] Minor tweaks, and improvements per Copilot review - Restrict artifact upload path to build directory only to avoid collecting unintended files from source tree - Use absolute path for tracebox output file to ensure trace is written to expected location within build directory - Move Perfetto linking to phlex/app/CMakeLists.txt immediately after cet_make_exec() to localize it to the executable creation - Use specific Perfetto SDK version (v51.0) instead of main branch for reproducible container builds --- .github/workflows/cmake-build.yaml | 8 +++++--- CMakeLists.txt | 5 ----- ci/Dockerfile | 5 +++-- phlex/app/CMakeLists.txt | 4 ++++ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake-build.yaml b/.github/workflows/cmake-build.yaml index cd8d46675..25cc989cf 100644 --- a/.github/workflows/cmake-build.yaml +++ b/.github/workflows/cmake-build.yaml @@ -8,7 +8,7 @@ on: push: branches: [ main, develop ] schedule: - - cron: '7 18 * * 6' + - cron: '0 18 * * 6' workflow_dispatch: inputs: ref: @@ -310,7 +310,7 @@ jobs: # Run tests with or without tracebox wrapper if [ -n "$TRACEBOX_ARGS" ]; then echo "::group::Running ctest with tracebox" - tracebox $TRACEBOX_ARGS -o perfetto-trace.pftrace -- ctest --progress --output-on-failure -j "$(nproc)" || TEST_RESULT=$? + tracebox $TRACEBOX_ARGS -o "$GITHUB_WORKSPACE/${{ env.local_build_path }}/perfetto-trace.pftrace" -- ctest --progress --output-on-failure -j "$(nproc)" || TEST_RESULT=$? else echo "::group::Running ctest with Perfetto SDK tracing" ctest --progress --output-on-failure -j "$(nproc)" || TEST_RESULT=$? @@ -329,7 +329,9 @@ jobs: uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: perfetto-traces-${{ matrix.compiler }} - path: '**/*.pftrace' + path: | + ${{ env.local_build_path }}/**/*.pftrace + ${{ env.local_build_path }}/**/perfetto-trace.pftrace retention-days: 30 if-no-files-found: warn diff --git a/CMakeLists.txt b/CMakeLists.txt index 44802b385..008824b6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,11 +194,6 @@ endif() add_subdirectory(phlex) add_subdirectory(plugins) -# Link Perfetto to phlex executable if enabled -if(ENABLE_PERFETTO AND TARGET phlex) - target_link_libraries(phlex PRIVATE Perfetto::Perfetto) -endif() - if(PHLEX_USE_FORM) set(BUILD_SHARED_LIBS OFF) # Temporary add_subdirectory(form) diff --git a/ci/Dockerfile b/ci/Dockerfile index 95608900c..ba201b5d9 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -295,8 +295,9 @@ rm -rf /var/lib/apt/lists/* mkdir -p /opt/perfetto cd /opt/perfetto -wget -O perfetto.h https://raw.githubusercontent.com/google/perfetto/main/sdk/perfetto.h -wget -O perfetto.cc https://raw.githubusercontent.com/google/perfetto/main/sdk/perfetto.cc +PERFETTO_VERSION=v51.0 +wget -O perfetto.h https://raw.githubusercontent.com/google/perfetto/${PERFETTO_VERSION}/sdk/perfetto.h +wget -O perfetto.cc https://raw.githubusercontent.com/google/perfetto/${PERFETTO_VERSION}/sdk/perfetto.cc chmod 644 perfetto.h perfetto.cc # Install tracebox for system-wide profiling diff --git a/phlex/app/CMakeLists.txt b/phlex/app/CMakeLists.txt index 3c0a57af0..3f1fd76c1 100644 --- a/phlex/app/CMakeLists.txt +++ b/phlex/app/CMakeLists.txt @@ -33,4 +33,8 @@ cet_make_exec( jsonnet::lib ) +if(ENABLE_PERFETTO) + target_link_libraries(phlex PRIVATE Perfetto::Perfetto) +endif() + set_target_properties(phlex PROPERTIES INSTALL_RPATH "$ORIGIN/../lib")