Skip to content

Commit

Permalink
Remove PRINT_CUMULATIVE_TIMES, PRINT_PER_THREAD_STATS, and PRINT_QPTP…
Browse files Browse the repository at this point in the history
…OOL_QUEUE_SIZE

use perf + flamegraphs for performance
PRINT_QPTPOOL_QUEUE_SIZE never really worked correctly
  • Loading branch information
calccrypto committed Dec 19, 2024
1 parent e51e132 commit ad1ae93
Show file tree
Hide file tree
Showing 95 changed files with 103 additions and 9,395 deletions.
55 changes: 4 additions & 51 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ jobs:

- name: Install Extra Python Packages
run: |
sudo apt -y install python3-pip python3-matplotlib
sudo apt -y install python3-pip
sudo pip3 install pylint
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} -DCMAKE_BUILD_TYPE=Debug -DPRINT_CUMULATIVE_TIMES=On
run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }}

- name: Run Python3 Pylint
working-directory: ${{ github.workspace }}/build
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
run: ctest --output-on-failure

- name: Configure CMake For Performance Package Tests
run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} -DPYTHON_INTERPRETER=python2 -DCMAKE_BUILD_TYPE=Debug -DPRINT_CUMULATIVE_TIMES=On
run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} -DPYTHON_INTERPRETER=python2

- name: Build
run: cmake --build ${{ github.workspace }}/build -j
Expand Down Expand Up @@ -224,53 +224,6 @@ jobs:
working-directory: ${{ github.workspace }}/build
run: ctest --output-on-failure

DebugPrints:
needs: [ShellCheck, Pylint]
runs-on: ubuntu-latest
strategy:
matrix:
PRINT_CUMULATIVE_TIMES: [ "On", "Off" ]
PRINT_PER_THREAD_STATS: [ "On", "Off" ]
PRINT_QPTPOOL_QUEUE_SIZE: [ "On", "Off" ]
steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: ${{ env.DEP_INSTALL_PREFIX }}
key: ${{ runner.os }}-debug-prints

- name: Ubuntu Prerequisites
run: sudo contrib/CI/ubuntu.sh

- name: Install matplotlib
if: matrix.PRINT_CUMULATIVE_TIMES == 'On'
run: |
sudo apt -y install python3-pip
python3 -m pip install matplotlib
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} -DCMAKE_BUILD_TYPE=Debug -DPRINT_CUMULATIVE_TIMES=${{ matrix.PRINT_CUMULATIVE_TIMES }} -DPRINT_PER_THREAD_STATS=${{ matrix.PRINT_PER_THREAD_STATS }} -DPRINT_QPTPOOL_QUEUE_SIZE=${{ matrix.PRINT_QPTPOOL_QUEUE_SIZE }}

- name: Build
run: cmake --build ${{ github.workspace }}/build -j

- name: Test
working-directory: ${{ github.workspace }}/build
if: |
matrix.PRINT_CUMULATIVE_TIMES == 'On' ||
matrix.PRINT_PER_THREAD_STATS == 'On' ||
matrix.PRINT_QPTPOOL_QUEUE_SIZE == 'On'
run: ctest --output-on-failure -L unit

- name: Test
working-directory: ${{ github.workspace }}/build
if: |
matrix.PRINT_CUMULATIVE_TIMES == 'Off' &&
matrix.PRINT_PER_THREAD_STATS == 'Off' &&
matrix.PRINT_QPTPOOL_QUEUE_SIZE == 'Off'
run: ctest --output-on-failure

Memcheck:
needs: [ShellCheck, Pylint]
runs-on: ubuntu-latest
Expand All @@ -291,7 +244,7 @@ jobs:
run: apt -y install valgrind

- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} -DCMAKE_BUILD_TYPE=Debug -DPRINT_CUMULATIVE_TIMES=On -DPRINT_PER_THREAD_STATS=On -DPRINT_QPTPOOL_QUEUE_SIZE=On
run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }}

- name: Build
run: cmake --build ${{ github.workspace }}/build -j
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ env:
CC: gcc
CXX: g++
DEP_INSTALL_PREFIX: ~/.local
COMMON_CONFIG: -DCMAKE_C_FLAGS="-Wall -Wextra -Werror -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -pedantic -std=c++11" -DDEP_INSTALL_PREFIX="${DEP_INSTALL_PREFIX}" -DDEP_BUILD_THREADS=2 -DENABLE_SUDO_TESTS=On -DGCOV=On -DCMAKE_BUILD_TYPE=Debug -DPRINT_CUMULATIVE_TIMES=On -DPRINT_PER_THREAD_STATS=On -DPRINT_QPTPOOL_QUEUE_SIZE=On
COMMON_CONFIG: -DCMAKE_C_FLAGS="-Wall -Wextra -Werror -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -pedantic -std=c++11" -DDEP_INSTALL_PREFIX="${DEP_INSTALL_PREFIX}" -DDEP_BUILD_THREADS=2 -DENABLE_SUDO_TESTS=On -DGCOV=On -DCMAKE_BUILD_TYPE=Debug

jobs:
CodeCoverage:
Expand All @@ -84,11 +84,6 @@ jobs:
- name: Ubuntu Prerequisites
run: sudo contrib/CI/ubuntu.sh

- name: Install matplotlib
run: |
sudo apt -y install python3-pip
python3 -m pip install matplotlib
- name: Coverage Prerequisites
run: |
sudo apt install gcovr
Expand All @@ -107,18 +102,13 @@ jobs:
run: ctest || true

- name: Delete files not reported for coverage
run: find -name "*.gc*" -a \( -name "gendir.*" -o -name "make_testindex.*" -o -name "bffuse.*" -o -name "bfresultfuse.*" -o -name "dfw.*" -o -name "tsmepoch2time.*" -o -name "tsmtime2epoch.*" -o -path "*/test/*" \) -delete
run: find -name "*.gc*" -a \( -name "gendir.*" -o -name "make_testindex.*" -o -name "bfwreaddirplus2db.*" -o -name "bffuse.*" -o -name "bfresultfuse.*" -o -name "dfw.*" -o -name "tsmepoch2time.*" -o -name "tsmtime2epoch.*" -o -path "*/test/*" \) -delete

- name: Generate Python Coverage Report
run: |
export PYTHONPATH="${{ github.workspace }}/build/contrib:${{ github.workspace }}/build/contrib/performance:${{ github.workspace }}/build/scripts:${PYTHONPATH}"
export PYTHONPATH="${{ github.workspace }}/build/contrib::${{ github.workspace }}/build/scripts:${PYTHONPATH}"
coverage run -m pytest \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/extraction.py \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/graph.py \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/hash.py \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/stats.py \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/utils.py \
${{ github.workspace }}/build/test/unit/python/test_gufi_common.py \
${{ github.workspace }}/build/test/unit/python/test_gufi_config.py
Expand All @@ -130,7 +120,7 @@ jobs:
(${{ github.workspace }}/build/test/regression/gufi_stats.sh || true) > /dev/null 2>&1
(${{ github.workspace }}/build/test/regression/longitudinal_snapshot.sh || true) > /dev/null 2>&1
coverage xml --omit="${{ github.workspace }}/build/contrib/hashes.py,${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/*,${{ github.workspace }}/build/test/*,${{ github.workspace }}/build/test/regression/*,${{ github.workspace }}/build/test/unit/python/*"
coverage xml --omit="${{ github.workspace }}/build/contrib/hashes.py,,${{ github.workspace }}/build/test/*,${{ github.workspace }}/build/test/regression/*,${{ github.workspace }}/build/test/unit/python/*"
rm .coverage # If not removed, codecov will attempt to run coverage xml which will not account for our omissions
- name: Upload coverage to Codecov
Expand Down
22 changes: 0 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -417,28 +417,6 @@ list(APPEND COMMON_LIBRARIES
dl
)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# ##########################################
# Debug prints
# ##########################################

# Cumulative times shown at end of run
option(PRINT_CUMULATIVE_TIMES "Sum the durations of events across all threads and print them at the end" Off)
if (PRINT_CUMULATIVE_TIMES)
add_definitions(-DCUMULATIVE_TIMES=1)
endif()

option(PRINT_PER_THREAD_STATS "Print individual events of each thread" Off)
if (PRINT_PER_THREAD_STATS)
add_definitions(-DPER_THREAD_STATS=1)
endif()

option(PRINT_QPTPOOL_QUEUE_SIZE "Print the un-pulled work queue size of each thread" Off)
if (PRINT_QPTPOOL_QUEUE_SIZE)
add_definitions(-DQPTPOOL_QUEUE_SIZE=1)
endif()
endif()

# enable "make test"
enable_testing()

Expand Down
31 changes: 0 additions & 31 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,35 +133,4 @@ foreach(file ${USEFUL})
configure_file("${file}" "${file}" @ONLY)
endforeach()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_subdirectory(debug)
endif()

add_subdirectory(CI)
if (GIT_FOUND)
# git -C <path>
set(GIT_PERFORMANCE_VERSION "1.8.5")

if (CMAKE_VERSION GREATER "3.14")
set(GIT_VERSION "${GIT_VERSION_STRING}")
else()
execute_process(COMMAND ${GIT_EXECUTABLE} --version
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH "[0-9]+\.[0-9]+(\.[0-9]+)?" GIT_VERSION "${GIT_VERSION_STRING}")
endif()
message(STATUS "git version: ${GIT_VERSION}")

# VERSION_GREATER_EQUAL was introduced in CMake 3.7
if (GIT_VERSION VERSION_LESS GIT_PERFORMANCE_VERSION)
message(STATUS "Not adding performance history framework (need git 1.8.5+)")
else()
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND PRINT_CUMULATIVE_TIMES)
message(STATUS "Adding performance history framework")
add_subdirectory(performance)
else()
message(STATUS "Not adding performance history framework (need PRINT_CUMULATIVE_TIMES enabled)")
endif()
endif()
endif()
74 changes: 0 additions & 74 deletions contrib/debug/CMakeLists.txt

This file was deleted.

100 changes: 0 additions & 100 deletions contrib/debug/gufi_query.sh

This file was deleted.

Loading

0 comments on commit ad1ae93

Please sign in to comment.