From 080053cb7228c871ee975ecb41d4f2c9c1c398fa Mon Sep 17 00:00:00 2001 From: zachferguson Date: Fri, 7 Feb 2025 17:01:15 -0500 Subject: [PATCH 1/4] Add -fprofile-update=atomic --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3d1140db..c20204b9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,8 +258,12 @@ if(IPC_TOOLKIT_WITH_CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") target_compile_options(ipc_toolkit PUBLIC -g # generate debug info --coverage # sets all required flags + -fprofile-update=atomic + ) + target_link_options(ipc_toolkit PUBLIC + --coverage + -fprofile-update=atomic ) - target_link_options(ipc_toolkit PUBLIC --coverage) endif() ################################################################################ From d12e82b6dcc19566f3e3483f6d57dcc1f85161f8 Mon Sep 17 00:00:00 2001 From: zachferguson Date: Fri, 7 Feb 2025 18:59:45 -0500 Subject: [PATCH 2/4] Update actions/cache version to v4 in workflow files --- .github/workflows/continuous.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/cuda.yml | 4 ++-- .github/workflows/docs.yml | 2 +- .github/workflows/python.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 335f12c3f..ec98e3e01 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -66,7 +66,7 @@ jobs: - name: Cache Build id: cache-build - uses: actions/cache@v4.0.2 + uses: actions/cache@v4 with: path: ${{ env.CACHE_PATH }} key: ${{ runner.os }}-${{ matrix.config }}-cache diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 303121df6..e17ce3266 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -35,7 +35,7 @@ jobs: - name: Cache Build id: cache-build - uses: actions/cache@v4.0.2 + uses: actions/cache@v4 with: path: ${{ env.CACHE_PATH }} key: coverage-cache diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 1eaeeda06..8b742d3dd 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -36,7 +36,7 @@ jobs: run: | sudo apt-get install ccache echo 'CACHE_PATH=~/.cache/ccache' >> "$GITHUB_ENV" - + - name: cuda-toolkit uses: Jimver/cuda-toolkit@v0.2.21 with: @@ -49,7 +49,7 @@ jobs: - name: Cache Build id: cache-build - uses: actions/cache@v4.0.2 + uses: actions/cache@v4 with: path: ${{ env.CACHE_PATH }} key: ${{ runner.os }}-${{ matrix.config }}-cache diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0ed570de7..15e4f5408 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,7 +31,7 @@ jobs: - name: Cache Build id: cache-build - uses: actions/cache@v4.0.2 + uses: actions/cache@v4 with: path: ${{ env.CACHE_PATH }} key: docs-cache diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index cea6f5a12..946e544be 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -62,7 +62,7 @@ jobs: - name: Cache Build id: cache-build - uses: actions/cache@v4.0.2 + uses: actions/cache@v4 with: path: ${{ env.CACHE_PATH }} key: ${{ runner.os }}-Python${{ matrix.python-version }}-cache From 3b2ed057ad8d40fc30c20505e76bb098953ca805 Mon Sep 17 00:00:00 2001 From: zachferguson Date: Fri, 7 Feb 2025 19:38:59 -0500 Subject: [PATCH 3/4] Ignore lcov errors --- .github/workflows/coverage.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e17ce3266..dfbcfbb77 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -64,7 +64,7 @@ jobs: run: | cd build ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} - lcov --directory . --capture --output-file coverage.info + lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent,format lcov --remove coverage.info '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info - name: Upload coverage reports to Codecov diff --git a/CMakeLists.txt b/CMakeLists.txt index c20204b9e..755d7a030 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,7 @@ endif() if(IPC_TOOLKIT_WITH_CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") # Add required flags (GCC & LLVM/Clang) - target_compile_options(ipc_toolkit PUBLIC + target_compile_options(ipc_toolkit PRIVATE -g # generate debug info --coverage # sets all required flags -fprofile-update=atomic From 36f2e00d86b9ac8edaa4de362b41be728c56f335 Mon Sep 17 00:00:00 2001 From: zachferguson Date: Fri, 7 Feb 2025 20:32:08 -0500 Subject: [PATCH 4/4] Improve lcov command to ignore gcov errors and unused data in coverage reports --- .github/workflows/coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index dfbcfbb77..a51ee5255 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -64,8 +64,8 @@ jobs: run: | cd build ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} - lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent,format - lcov --remove coverage.info '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info + lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent,format,gcov + lcov --remove coverage.info --ignore-errors unused '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3.1.6