Rename Omnitrace to ROCm Systems Profiler (#4)

The Omnitrace program is being renamed. 

Full name: "ROCm Systems Profiler"
Package name: "rocprofiler-systems"
Binary / Library names: "rocprof-sys-*"

---------
Co-authored-by: Xuan Chen <xuchen@amd.com>
Signed-off-by: David Galiffi <David.Galiffi@amd.com>

[ROCm/rocprofiler-systems commit: d07bf508a9]
Šī revīzija ir iekļauta:
David Galiffi
2024-10-15 11:20:40 -04:00
revīziju iesūtīja GitHub
vecāks c444ba6131
revīzija 489eda995d
420 mainīti faili ar 10418 papildinājumiem un 9914 dzēšanām
@@ -1,6 +1,6 @@
parse:
additional_commands:
omnitrace_checkout_git_submodule:
rocprofiler_systems_checkout_git_submodule:
flags:
- RECURSIVE
kwargs:
@@ -10,15 +10,15 @@ parse:
REPO_URL: '*'
REPO_BRANCH: '*'
ADDITIONAL_COMMANDS: '*'
omnitrace_save_variables:
rocprofiler_systems_save_variables:
kwargs:
VARIABLES: '*'
CONDITION: '*'
omnitrace_restore_variables:
rocprofiler_systems_restore_variables:
kwargs:
VARIABLES: '*'
CONDITION: '*'
omnitrace_add_test:
rocprofiler_systems_add_test:
flags:
- SKIP_BASELINE
- SKIP_SAMPLING
@@ -50,7 +50,7 @@ parse:
BASELINE_FAIL_REGEX: '*'
REWRITE_RUN_PASS_REGEX: '*'
REWRITE_RUN_FAIL_REGEX: '*'
omnitrace_add_causal_test:
rocprofiler_systems_add_causal_test:
flags:
- SKIP_BASELINE
kwargs:
@@ -72,12 +72,12 @@ parse:
BASELINE_FAIL_REGEX: '*'
CAUSAL_VALIDATE_PASS_REGEX: '*'
CAUSAL_VALIDATE_FAIL_REGEX: '*'
omnitrace_target_compile_definitions:
rocprofiler_systems_target_compile_definitions:
kwargs:
PUBLIC: '*'
PRIVATE: '*'
INTERFACE: '*'
omnitrace_add_bin_test:
rocprofiler_systems_add_bin_test:
flags:
- WILL_FAIL
kwargs:
@@ -94,7 +94,7 @@ parse:
PASS_REGEX: '*'
FAIL_REGEX: '*'
SKIP_REGEX: '*'
omnitrace_add_python_test:
rocprofiler_systems_add_python_test:
flags:
- STANDALONE
kwargs:
@@ -113,7 +113,7 @@ parse:
PASS_REGEX: '*'
FAIL_REGEX: '*'
SKIP_REGEX: '*'
omnitrace_add_python_validation_test:
rocprofiler_systems_add_python_validation_test:
kwargs:
NAME: '*'
ARGS: '*'
@@ -128,7 +128,7 @@ parse:
- SEND_ERROR
- FATAL_ERROR
- AUTHOR_WARNING
omnitrace_find_python:
rocprofiler_systems_find_python:
flags:
- REQUIRED
- QUIET
@@ -136,11 +136,11 @@ parse:
VERSION: '*'
ROOT_DIR: '*'
COMPONENTS: '*'
omnitrace_python_console_script:
rocprofiler_systems_python_console_script:
kwargs:
VERSION: '*'
ROOT_DIR: '*'
omnitrace_pybind11_add_module:
rocprofiler_systems_pybind11_add_module:
flags:
- MODULE
- SHARED
@@ -153,7 +153,7 @@ parse:
PYTHON_VERSION: '*'
CXX_STANDARD: '*'
VISIBILITY: '*'
omnitrace_directory:
rocprofiler_systems_directory:
flags:
- MKDIR
- FAIL
@@ -162,14 +162,14 @@ parse:
OUTPUT_VARIABLE: '*'
WORKING_DIRECTORY: '*'
PATHS: '*'
omnitrace_check_python_dirs_and_versions:
rocprofiler_systems_check_python_dirs_and_versions:
flags:
- UNSET
- FAIL
kwargs:
RESULT_VARIABLE: '*'
OUTPUT_VARIABLE: '*'
omnitrace_find_static_library:
rocprofiler_systems_find_static_library:
flags:
- NO_CACHE
- REQUIRED
@@ -188,7 +188,7 @@ parse:
PATHS: '*'
PATH_SUFFIXES: '*'
DOC: '*'
omnitrace_find_shared_library:
rocprofiler_systems_find_shared_library:
flags:
- NO_CACHE
- REQUIRED
@@ -207,14 +207,14 @@ parse:
PATHS: '*'
PATH_SUFFIXES: '*'
DOC: '*'
omnitrace_causal_example_executable:
rocprofiler_systems_causal_example_executable:
kwargs:
TAG: '*'
SOURCES: '*'
DEFINITIONS: '*'
LINK_LIBRARIES: '*'
INCLUDE_DIRECTORIES: '*'
omnitrace_add_validation_test:
rocprofiler_systems_add_validation_test:
kwargs:
NAME: '*'
ARGS: '*'
@@ -20,7 +20,7 @@ env:
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
jobs:
omnitrace-ci:
rocprofiler-systemss-ci:
if: github.repository == 'ROCm/omnitrace'
runs-on: ubuntu-20.04
@@ -73,7 +73,7 @@ jobs:
./build-docker-ci.sh --distro ${{ matrix.distro }} --versions ${{ matrix.version }} --user ${{ secrets.DOCKERHUB_USERNAME }} --push --jobs 2 --elfutils-version 0.186 --boost-version 1.79.0
popd
omnitrace-release:
rocprofiler-systems-release:
if: github.repository == 'ROCm/omnitrace'
runs-on: ubuntu-20.04
@@ -286,7 +286,7 @@ jobs:
timeout-minutes: 10
uses: actions/upload-artifact@v4
with:
name: omnitrace-stgz-${{ matrix.os-distro }}-${{ matrix.os-version }}-rocm-${{ matrix.rocm-version }}-installer
name: rocprofiler-systems-stgz-${{ matrix.os-distro }}-${{ matrix.os-version }}-rocm-${{ matrix.rocm-version }}-installer
path: |
build-release/stgz/*.sh
@@ -297,13 +297,13 @@ jobs:
shopt -s nullglob
for i in $(find build-release -type f | egrep '/(stgz|deb|rpm)/.*\.(sh|deb|rpm)$'); do mv ${i} ./; done
sudo rm -rf build-release
sudo rm -rf /opt/omnitrace
sudo rm -rf /opt/rocprofiler-systems
- name: Test STGZ Install
timeout-minutes: 20
run: |
set -v
for i in omnitrace-*.sh
for i in rocprofiler-systems-*.sh
do
./docker/test-docker-release.sh --distro ${{ matrix.os-distro }} --versions ${{ matrix.os-version }} --rocm-versions ${{ matrix.rocm-version }} -- --stgz ${i}
done
@@ -314,4 +314,4 @@ jobs:
with:
fail_on_unmatched_files: True
files: |
omnitrace-*.sh
rocprofiler-systems-*.sh
@@ -32,8 +32,8 @@ concurrency:
cancel-in-progress: true
env:
OMNITRACE_CI: ON
OMNITRACE_TMPDIR: "%env{PWD}%/testing-tmp"
ROCPROFSYS_CI: ON
ROCPROFSYS_TMPDIR: "%env{PWD}%/testing-tmp"
jobs:
opensuse:
@@ -69,8 +69,8 @@ jobs:
run:
echo "CC=$(echo '${{ matrix.compiler }}' | sed 's/+/c/g')" >> $GITHUB_ENV &&
echo "CXX=${{ matrix.compiler }}" >> $GITHUB_ENV &&
echo "/opt/omnitrace/bin:${HOME}/.local/bin" >> $GITHUB_PATH &&
echo "LD_LIBRARY_PATH=/opt/omnitrace/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
echo "/opt/rocprofiler-systems/bin:${HOME}/.local/bin" >> $GITHUB_PATH &&
echo "LD_LIBRARY_PATH=/opt/rocprofiler-systems/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Configure, Build, and Test
timeout-minutes: 115
@@ -86,20 +86,20 @@ jobs:
-DCMAKE_C_COMPILER=$(echo '${{ matrix.compiler }}' | sed 's/+/c/g')
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
-DCMAKE_INSTALL_PREFIX=/opt/omnitrace
-DOMNITRACE_BUILD_TESTING=ON
-DOMNITRACE_USE_MPI=OFF
-DOMNITRACE_USE_HIP=OFF
-DOMNITRACE_USE_OMPT=OFF
-DOMNITRACE_USE_PYTHON=ON
-DOMNITRACE_INSTALL_PERFETTO_TOOLS=OFF
-DOMNITRACE_USE_MPI_HEADERS=ON
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10;py3.11"
-DOMNITRACE_CI_MPI_RUN_AS_ROOT=ON
-DOMNITRACE_MAX_THREADS=64
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
-DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems
-DROCPROFSYS_BUILD_TESTING=ON
-DROCPROFSYS_USE_MPI=OFF
-DROCPROFSYS_USE_HIP=OFF
-DROCPROFSYS_USE_OMPT=OFF
-DROCPROFSYS_USE_PYTHON=ON
-DROCPROFSYS_INSTALL_PERFETTO_TOOLS=OFF
-DROCPROFSYS_USE_MPI_HEADERS=ON
-DROCPROFSYS_PYTHON_PREFIX=/opt/conda/envs
-DROCPROFSYS_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10;py3.11"
-DROCPROFSYS_CI_MPI_RUN_AS_ROOT=ON
-DROCPROFSYS_MAX_THREADS=64
-DROCPROFSYS_DISABLE_EXAMPLES="transpose;rccl"
-DROCPROFSYS_BUILD_NUMBER=${{ github.run_attempt }}
- name: Install
timeout-minutes: 10
@@ -110,27 +110,27 @@ jobs:
timeout-minutes: 10
run: |
set -v
export OMNITRACE_DEBUG=ON
which omnitrace-avail
ldd $(which omnitrace-avail)
omnitrace-avail --help
omnitrace-avail -a
which omnitrace
ldd $(which omnitrace)
omnitrace-instrument --help
omnitrace-instrument -e -v 1 -o ls.inst --simulate -- ls
for i in $(find omnitrace-ls.inst-output -type f); do echo -e "\n\n --> ${i} \n\n"; cat ${i}; done
omnitrace-instrument -e -v 1 -o ls.inst -- ls
omnitrace-run -- ./ls.inst
omnitrace-instrument -e -v 1 --simulate -- ls
for i in $(find omnitrace-ls-output -type f); do echo -e "\n\n --> ${i} \n\n"; cat ${i}; done
omnitrace-instrument -e -v 1 -- ls
export ROCPROFSYS_DEBUG=ON
which rocprof-sys-avail
ldd $(which rocprof-sys-avail)
rocprof-sys-avail --help
rocprof-sys-avail -a
which rocprof-sys-instrument
ldd $(which rocprof-sys-instrument)
rocprof-sys-instrument --help
rocprof-sys-instrument -e -v 1 -o ls.inst --simulate -- ls
for i in $(find rocprofsys-ls.inst-output -type f); do echo -e "\n\n --> ${i} \n\n"; cat ${i}; done
rocprof-sys-instrument -e -v 1 -o ls.inst -- ls
rocprof-sys-run -- ./ls.inst
rocprof-sys-instrument -e -v 1 --simulate -- ls
for i in $(find rocprofsys-ls-output -type f); do echo -e "\n\n --> ${i} \n\n"; cat ${i}; done
rocprof-sys-instrument -e -v 1 -- ls
- name: Test User API
timeout-minutes: 10
run: |
set -v
./scripts/test-find-package.sh --install-dir /opt/omnitrace
./scripts/test-find-package.sh --install-dir /opt/rocprofiler-systems
- name: CTest Artifacts
if: failure()
@@ -148,9 +148,9 @@ jobs:
with:
name: data-${{ github.job }}-${{ strategy.job-index }}-files
path: |
build/omnitrace-tests-config/*.cfg
build/omnitrace-tests-output/**/*.txt
build/omnitrace-tests-output/**/*-instr*.json
build/rocprofsys-tests-config/*.cfg
build/rocprofsys-tests-output/**/*.txt
build/rocprofsys-tests-output/**/*-instr*.json
- name: Kill Perfetto
if: success() || failure()
@@ -32,8 +32,8 @@ concurrency:
cancel-in-progress: true
env:
OMNITRACE_CI: ON
OMNITRACE_TMPDIR: "%env{PWD}%/testing-tmp"
ROCPROFSYS_CI: ON
ROCPROFSYS_TMPDIR: "%env{PWD}%/testing-tmp"
jobs:
rhel:
@@ -110,20 +110,20 @@ jobs:
-DCMAKE_C_COMPILER=$(echo '${{ matrix.compiler }}' | sed 's/+/c/g')
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
-DCMAKE_INSTALL_PREFIX=/opt/omnitrace
-DOMNITRACE_BUILD_TESTING=ON
-DOMNITRACE_USE_MPI=OFF
-DOMNITRACE_USE_HIP=${USE_HIP}
-DOMNITRACE_USE_OMPT=OFF
-DOMNITRACE_USE_PYTHON=ON
-DOMNITRACE_USE_MPI_HEADERS=ON
-DOMNITRACE_CI_MPI_RUN_AS_ROOT=ON
-DOMNITRACE_MAX_THREADS=64
-DOMNITRACE_INSTALL_PERFETTO_TOOLS=OFF
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10;py3.11"
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
-DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems
-DROCPROFSYS_BUILD_TESTING=ON
-DROCPROFSYS_USE_MPI=OFF
-DROCPROFSYS_USE_HIP=${USE_HIP}
-DROCPROFSYS_USE_OMPT=OFF
-DROCPROFSYS_USE_PYTHON=ON
-DROCPROFSYS_USE_MPI_HEADERS=ON
-DROCPROFSYS_CI_MPI_RUN_AS_ROOT=ON
-DROCPROFSYS_MAX_THREADS=64
-DROCPROFSYS_INSTALL_PERFETTO_TOOLS=OFF
-DROCPROFSYS_PYTHON_PREFIX=/opt/conda/envs
-DROCPROFSYS_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10;py3.11"
-DROCPROFSYS_DISABLE_EXAMPLES="transpose;rccl"
-DROCPROFSYS_BUILD_NUMBER=${{ github.run_attempt }}
--
-LE "transpose|rccl"
@@ -137,14 +137,14 @@ jobs:
shell: bash
run: |
set -v
source /opt/omnitrace/share/omnitrace/setup-env.sh
./scripts/test-install.sh --test-omnitrace-{instrument,avail,sample,rewrite,runtime,python}=1
source /opt/rocprofiler-systems/share/rocprofiler-systems/setup-env.sh
./scripts/test-install.sh --test-rocprof-sys-{instrument,avail,sample,rewrite,runtime,python}=1
- name: Test User API
timeout-minutes: 10
run: |
set -v
./scripts/test-find-package.sh --install-dir /opt/omnitrace
./scripts/test-find-package.sh --install-dir /opt/rocprofiler-systems
- name: CTest Artifacts
if: failure()
@@ -162,9 +162,9 @@ jobs:
with:
name: data-${{ github.job }}-${{ strategy.job-index }}-files
path: |
build/omnitrace-tests-config/*.cfg
build/omnitrace-tests-output/**/*.txt
build/omnitrace-tests-output/**/*-instr*.json
build/rocprofsys-tests-config/*.cfg
build/rocprofsys-tests-output/**/*.txt
build/rocprofsys-tests-output/**/*-instr*.json
- name: Kill Perfetto
if: success() || failure()
@@ -28,7 +28,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y cmake
cmake -D OUTPUT_DIR=${PWD} -P scripts/write-omnitrace-install.cmake
cmake -D OUTPUT_DIR=${PWD} -P scripts/write-rocprof-sys-install.cmake
- name: Generate Release
uses: softprops/action-gh-release@v1
with:
@@ -36,4 +36,4 @@ jobs:
generate_release_notes: True
fail_on_unmatched_files: True
files: |
omnitrace-install.py
rocprofiler-systems-install.py
@@ -32,8 +32,8 @@ concurrency:
cancel-in-progress: true
env:
OMNITRACE_CI: ON
OMNITRACE_TMPDIR: "%env{PWD}%/testing-tmp"
ROCPROFSYS_CI: ON
ROCPROFSYS_TMPDIR: "%env{PWD}%/testing-tmp"
jobs:
ubuntu-focal-external:
@@ -140,23 +140,23 @@ jobs:
-DCMAKE_C_COMPILER=$(echo '${{ matrix.compiler }}' | sed 's/+/c/g')
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
-DCMAKE_INSTALL_PREFIX=/opt/omnitrace
-DOMNITRACE_BUILD_TESTING=ON
-DOMNITRACE_USE_MPI=OFF
-DOMNITRACE_USE_HIP=OFF
-DOMNITRACE_USE_OMPT=OFF
-DOMNITRACE_USE_PAPI=OFF
-DOMNITRACE_USE_PYTHON=${{ matrix.python }}
-DOMNITRACE_USE_MPI_HEADERS=${{ matrix.mpi-headers }}
-DOMNITRACE_STRIP_LIBRARIES=${{ matrix.strip }}
-DOMNITRACE_BUILD_LTO=${{ matrix.lto }}
-DOMNITRACE_BUILD_STATIC_LIBGCC=${{ matrix.static-libgcc }}
-DOMNITRACE_BUILD_STATIC_LIBSTDCXX=${{ matrix.static-libstdcxx }}
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10;py3.11"
-DOMNITRACE_MAX_THREADS=64
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
-DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems
-DROCPROFSYS_BUILD_TESTING=ON
-DROCPROFSYS_USE_MPI=OFF
-DROCPROFSYS_USE_HIP=OFF
-DROCPROFSYS_USE_OMPT=OFF
-DROCPROFSYS_USE_PAPI=OFF
-DROCPROFSYS_USE_PYTHON=${{ matrix.python }}
-DROCPROFSYS_USE_MPI_HEADERS=${{ matrix.mpi-headers }}
-DROCPROFSYS_STRIP_LIBRARIES=${{ matrix.strip }}
-DROCPROFSYS_BUILD_LTO=${{ matrix.lto }}
-DROCPROFSYS_BUILD_STATIC_LIBGCC=${{ matrix.static-libgcc }}
-DROCPROFSYS_BUILD_STATIC_LIBSTDCXX=${{ matrix.static-libstdcxx }}
-DROCPROFSYS_PYTHON_PREFIX=/opt/conda/envs
-DROCPROFSYS_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10;py3.11"
-DROCPROFSYS_MAX_THREADS=64
-DROCPROFSYS_DISABLE_EXAMPLES="transpose;rccl"
-DROCPROFSYS_BUILD_NUMBER=${{ github.run_attempt }}
-DMPI_HEADERS_ALLOW_MPICH=OFF
- name: Test Build-Tree Module
@@ -167,24 +167,24 @@ jobs:
source /usr/share/modules/init/$(basename ${SHELL})
module use ./share/modulefiles
module avail
module load omnitrace
echo $(which omnitrace)
ldd $(which omnitrace)
omnitrace-instrument --help
omnitrace-avail --help
omnitrace-sample --help
module load rocprofiler-systems
echo $(which rocprof-sys-instrument)
ldd $(which rocprof-sys-instrument)
rocprof-sys-instrument --help
rocprof-sys-avail --help
rocprof-sys-sample --help
- name: Test Build-Tree Source Script
timeout-minutes: 45
shell: bash
run: |
cd build
source ./share/omnitrace/setup-env.sh
echo $(which omnitrace)
ldd $(which omnitrace)
omnitrace-instrument --help
omnitrace-avail --help
omnitrace-sample --help
source ./share/rocprofiler-systems/setup-env.sh
echo $(which rocprof-sys-instrument)
ldd $(which rocprof-sys-instrument)
rocprof-sys-instrument --help
rocprof-sys-avail --help
rocprof-sys-sample --help
- name: Install
timeout-minutes: 10
@@ -196,16 +196,16 @@ jobs:
shell: bash
run: |
source /usr/share/modules/init/$(basename ${SHELL})
module use /opt/omnitrace/share/modulefiles
module use /opt/rocprofiler-systems/share/modulefiles
module avail
module load omnitrace
./scripts/test-install.sh --test-omnitrace-{instrument,avail,sample,rewrite,runtime}=1 --test-omnitrace-python=${{ matrix.python }}
module load rocprofiler-systems
./scripts/test-install.sh --test-rocprof-sys-{instrument,avail,sample,rewrite,runtime}=1 --test-rocprof-sys-python=${{ matrix.python }}
- name: Test User API
timeout-minutes: 10
run: |
set -v
./scripts/test-find-package.sh --install-dir /opt/omnitrace
./scripts/test-find-package.sh --install-dir /opt/rocprofiler-systems
- name: CTest Artifacts
if: failure()
@@ -223,9 +223,9 @@ jobs:
with:
name: data-${{ github.job }}-${{ strategy.job-index }}-files
path: |
build/omnitrace-tests-config/*.cfg
build/omnitrace-tests-output/**/*.txt
build/omnitrace-tests-output/**/*-instr*.json
build/rocprofsys-tests-config/*.cfg
build/rocprofsys-tests-output/**/*.txt
build/rocprofsys-tests-output/**/*-instr*.json
- name: Kill Perfetto
if: success() || failure()
@@ -294,20 +294,20 @@ jobs:
echo "CMAKE_PREFIX_PATH=/opt/dyninst:${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/rocm/lib:/usr/local/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
cat << EOF > test-install.cfg
OMNITRACE_PROFILE = ON
OMNITRACE_TRACE = ON
OMNITRACE_USE_PID = OFF
OMNITRACE_USE_SAMPLING = OFF
OMNITRACE_USE_PROCESS_SAMPLING = OFF
OMNITRACE_COUT_OUTPUT = ON
OMNITRACE_TIME_OUTPUT = OFF
OMNITRACE_TIMEMORY_COMPONENTS = cpu_clock cpu_util current_peak_rss kernel_mode_time monotonic_clock monotonic_raw_clock network_stats num_io_in num_io_out num_major_page_faults num_minor_page_faults page_rss peak_rss priority_context_switch process_cpu_clock process_cpu_util read_bytes read_char system_clock thread_cpu_clock thread_cpu_util timestamp trip_count user_clock user_mode_time virtual_memory voluntary_context_switch wall_clock written_bytes written_char
OMNITRACE_OUTPUT_PATH = omnitrace-tests-output
OMNITRACE_OUTPUT_PREFIX = %tag%/
OMNITRACE_DEBUG = OFF
OMNITRACE_VERBOSE = 3
OMNITRACE_DL_VERBOSE = 3
OMNITRACE_PERFETTO_BACKEND = system
ROCPROFSYS_PROFILE = ON
ROCPROFSYS_TRACE = ON
ROCPROFSYS_USE_PID = OFF
ROCPROFSYS_USE_SAMPLING = OFF
ROCPROFSYS_USE_PROCESS_SAMPLING = OFF
ROCPROFSYS_COUT_OUTPUT = ON
ROCPROFSYS_TIME_OUTPUT = OFF
ROCPROFSYS_TIMEMORY_COMPONENTS = cpu_clock cpu_util current_peak_rss kernel_mode_time monotonic_clock monotonic_raw_clock network_stats num_io_in num_io_out num_major_page_faults num_minor_page_faults page_rss peak_rss priority_context_switch process_cpu_clock process_cpu_util read_bytes read_char system_clock thread_cpu_clock thread_cpu_util timestamp trip_count user_clock user_mode_time virtual_memory voluntary_context_switch wall_clock written_bytes written_char
ROCPROFSYS_OUTPUT_PATH = rocprofsys-tests-output
ROCPROFSYS_OUTPUT_PREFIX = %tag%/
ROCPROFSYS_DEBUG = OFF
ROCPROFSYS_VERBOSE = 3
ROCPROFSYS_DL_VERBOSE = 3
ROCPROFSYS_PERFETTO_BACKEND = system
EOF
realpath test-install.cfg
cat test-install.cfg
@@ -328,25 +328,25 @@ jobs:
-DCMAKE_C_COMPILER=$(echo '${{ matrix.compiler }}' | sed 's/+/c/g')
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
-DCMAKE_INSTALL_PREFIX=/opt/omnitrace
-DOMNITRACE_BUILD_TESTING=ON
-DOMNITRACE_BUILD_DEVELOPER=ON
-DOMNITRACE_BUILD_EXTRA_OPTIMIZATIONS=OFF
-DOMNITRACE_BUILD_LTO=OFF
-DOMNITRACE_USE_MPI=OFF
-DOMNITRACE_USE_HIP=ON
-DOMNITRACE_MAX_THREADS=64
-DOMNITRACE_USE_PAPI=OFF
-DOMNITRACE_USE_OMPT=OFF
-DOMNITRACE_USE_PYTHON=ON
-DOMNITRACE_USE_MPI_HEADERS=${{ matrix.mpi-headers }}
-DOMNITRACE_USE_SANITIZER=OFF
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10;py3.11"
-DOMNITRACE_CI_MPI_RUN_AS_ROOT=${{ matrix.mpi-headers }}
-DOMNITRACE_CI_GPU=OFF
-DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems
-DROCPROFSYS_BUILD_TESTING=ON
-DROCPROFSYS_BUILD_DEVELOPER=ON
-DROCPROFSYS_BUILD_EXTRA_OPTIMIZATIONS=OFF
-DROCPROFSYS_BUILD_LTO=OFF
-DROCPROFSYS_USE_MPI=OFF
-DROCPROFSYS_USE_HIP=ON
-DROCPROFSYS_MAX_THREADS=64
-DROCPROFSYS_USE_PAPI=OFF
-DROCPROFSYS_USE_OMPT=OFF
-DROCPROFSYS_USE_PYTHON=ON
-DROCPROFSYS_USE_MPI_HEADERS=${{ matrix.mpi-headers }}
-DROCPROFSYS_USE_SANITIZER=OFF
-DROCPROFSYS_PYTHON_PREFIX=/opt/conda/envs
-DROCPROFSYS_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10;py3.11"
-DROCPROFSYS_CI_MPI_RUN_AS_ROOT=${{ matrix.mpi-headers }}
-DROCPROFSYS_CI_GPU=OFF
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
-DROCPROFSYS_BUILD_NUMBER=${{ github.run_attempt }}
--
${{ matrix.ctest-exclude }}
@@ -358,14 +358,14 @@ jobs:
timeout-minutes: 15
shell: bash
run: |
source /opt/omnitrace/share/omnitrace/setup-env.sh
./scripts/test-install.sh --test-omnitrace-{instrument,avail,sample,python,rewrite,runtime}=1
source /opt/rocprofiler-systems/share/rocprofiler-systems/setup-env.sh
./scripts/test-install.sh --test-rocprof-sys-{instrument,avail,sample,python,rewrite,runtime}=1
- name: Test User API
timeout-minutes: 10
run: |
set -v
./scripts/test-find-package.sh --install-dir /opt/omnitrace
./scripts/test-find-package.sh --install-dir /opt/rocprofiler-systems
- name: CTest Artifacts
if: failure()
@@ -383,10 +383,10 @@ jobs:
with:
name: data-${{ github.job }}-${{ strategy.job-index }}-files
path: |
omnitrace-tests-output/**/*.txt
build/omnitrace-tests-config/*.cfg
build/omnitrace-tests-output/**/*.txt
build/omnitrace-tests-output/**/*-instr*.json
rocprofsys-tests-output/**/*.txt
build/rocprofsys-tests-config/*.cfg
build/rocprofsys-tests-output/**/*.txt
build/rocprofsys-tests-output/**/*-instr*.json
- name: Kill Perfetto
if: success() || failure()
@@ -476,14 +476,14 @@ jobs:
-DCMAKE_C_COMPILER=$(echo '${{ matrix.compiler }}' | sed 's/+/c/g')
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
-DCMAKE_INSTALL_PREFIX=/opt/omnitrace
-DOMNITRACE_BUILD_TESTING=ON
-DOMNITRACE_BUILD_DYNINST=ON
-DOMNITRACE_USE_MPI=${USE_MPI}
-DOMNITRACE_USE_HIP=OFF
-DOMNITRACE_USE_PYTHON=${{ matrix.python }}
-DOMNITRACE_USE_OMPT=${{ matrix.ompt }}
-DOMNITRACE_USE_PAPI=${{ matrix.papi }}
-DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems
-DROCPROFSYS_BUILD_TESTING=ON
-DROCPROFSYS_BUILD_DYNINST=ON
-DROCPROFSYS_USE_MPI=${USE_MPI}
-DROCPROFSYS_USE_HIP=OFF
-DROCPROFSYS_USE_PYTHON=${{ matrix.python }}
-DROCPROFSYS_USE_OMPT=${{ matrix.ompt }}
-DROCPROFSYS_USE_PAPI=${{ matrix.papi }}
-DDYNINST_BUILD_ELFUTILS=ON
-DDYNINST_BUILD_LIBIBERTY=ON
-DDYNINST_BUILD_TBB=${{ matrix.tbb }}
@@ -491,9 +491,9 @@ jobs:
-DDYNINST_BUILD_SHARED_LIBS=ON
-DDYNINST_BUILD_STATIC_LIBS=OFF
-DDYNINST_ELFUTILS_DOWNLOAD_VERSION=${{ env.ELFUTILS_DOWNLOAD_VERSION }}
-DOMNITRACE_MAX_THREADS=64
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
-DROCPROFSYS_MAX_THREADS=64
-DROCPROFSYS_DISABLE_EXAMPLES="transpose;rccl"
-DROCPROFSYS_BUILD_NUMBER=${{ github.run_attempt }}
-DMPI_HEADERS_ALLOW_MPICH=ON
- name: Test Build-Tree Env
@@ -502,43 +502,43 @@ jobs:
source /usr/share/modules/init/$(basename ${SHELL})
module use ${{ github.workspace }}/build/share/modulefiles
module avail
module load omnitrace
module load rocprofiler-systems
module list
env
module unload omnitrace
module unload rocprofiler-systems
module list
env
source ${{ github.workspace }}/build/share/omnitrace/setup-env.sh
source ${{ github.workspace }}/build/share/rocprofiler-systems/setup-env.sh
env
- name: Install
working-directory: ${{ github.workspace }}/build
run: |
cpack -G STGZ
mkdir -p /opt/omnitrace
./omnitrace-*.sh --prefix=/opt/omnitrace --exclude-subdir --skip-license
mkdir -p /opt/rocprofiler-systems
./rocprofiler-systems-*.sh --prefix=/opt/rocprofiler-systems --exclude-subdir --skip-license
- name: Test Install with setup-env.sh
timeout-minutes: 15
run: |
set -v
source /opt/omnitrace/share/omnitrace/setup-env.sh
${{ github.workspace }}/scripts/test-install.sh --test-omnitrace-{instrument,avail,sample,python,rewrite,runtime}=1
source /opt/rocprofiler-systems/share/rocprofiler-systems/setup-env.sh
${{ github.workspace }}/scripts/test-install.sh --test-rocprof-sys-{instrument,avail,sample,python,rewrite,runtime}=1
- name: Test Install with Modulefile
timeout-minutes: 15
run: |
set -v
source /usr/share/modules/init/$(basename ${SHELL})
module use /opt/omnitrace/share/modulefiles
module load omnitrace
${{ github.workspace }}/scripts/test-install.sh --test-omnitrace-{instrument,avail,sample,python,rewrite,runtime}=1
module use /opt/rocprofiler-systems/share/modulefiles
module load rocprofiler-systems
${{ github.workspace }}/scripts/test-install.sh --test-rocprof-sys-{instrument,avail,sample,python,rewrite,runtime}=1
- name: Test User API
timeout-minutes: 10
run: |
set -v
${{ github.workspace }}/scripts/test-find-package.sh --install-dir /opt/omnitrace
${{ github.workspace }}/scripts/test-find-package.sh --install-dir /opt/rocprofiler-systems
- name: CTest Artifacts
if: failure()
@@ -556,9 +556,9 @@ jobs:
with:
name: data-${{ github.job }}-${{ strategy.job-index }}-files
path: |
${{ github.workspace }}/build/omnitrace-tests-config/*.cfg
${{ github.workspace }}/build/omnitrace-tests-output/**/*.txt
${{ github.workspace }}/build/omnitrace-tests-output/**/*-instr*.json
${{ github.workspace }}/build/rocprof-sys-tests-config/*.cfg
${{ github.workspace }}/build/rocprof-sys-tests-output/**/*.txt
${{ github.workspace }}/build/rocprof-sys-tests-output/**/*-instr*.json
- name: Kill Perfetto
if: success() || failure()
@@ -576,8 +576,8 @@ jobs:
options: --cap-add CAP_SYS_ADMIN
env:
OMNITRACE_VERBOSE: 2
OMNITRACE_CAUSAL_BACKEND: perf
ROCPROFSYS_VERBOSE: 2
ROCPROFSYS_CAUSAL_BACKEND: perf
steps:
- uses: actions/checkout@v4
@@ -618,18 +618,18 @@ jobs:
--site GitHub
--coverage
--
-DCMAKE_INSTALL_PREFIX=/opt/omnitrace
-DOMNITRACE_BUILD_CI=OFF
-DOMNITRACE_BUILD_TESTING=ON
-DOMNITRACE_BUILD_DYNINST=OFF
-DOMNITRACE_BUILD_DEBUG=OFF
-DOMNITRACE_BUILD_HIDDEN_VISIBILITY=OFF
-DOMNITRACE_USE_MPI=ON
-DOMNITRACE_USE_PYTHON=ON
-DOMNITRACE_USE_OMPT=ON
-DOMNITRACE_USE_PAPI=ON
-DOMNITRACE_USE_HIP=OFF
-DOMNITRACE_USE_RCCL=OFF
-DOMNITRACE_MAX_THREADS=64
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
-DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems
-DROCPROFSYS_BUILD_CI=OFF
-DROCPROFSYS_BUILD_TESTING=ON
-DROCPROFSYS_BUILD_DYNINST=OFF
-DROCPROFSYS_BUILD_DEBUG=OFF
-DROCPROFSYS_BUILD_HIDDEN_VISIBILITY=OFF
-DROCPROFSYS_USE_MPI=ON
-DROCPROFSYS_USE_PYTHON=ON
-DROCPROFSYS_USE_OMPT=ON
-DROCPROFSYS_USE_PAPI=ON
-DROCPROFSYS_USE_HIP=OFF
-DROCPROFSYS_USE_RCCL=OFF
-DROCPROFSYS_MAX_THREADS=64
-DROCPROFSYS_DISABLE_EXAMPLES="transpose;rccl"
-DROCPROFSYS_BUILD_NUMBER=${{ github.run_attempt }}
@@ -32,8 +32,8 @@ concurrency:
cancel-in-progress: true
env:
OMNITRACE_CI: ON
OMNITRACE_TMPDIR: "%env{PWD}%/testing-tmp"
ROCPROFSYS_CI: ON
ROCPROFSYS_TMPDIR: "%env{PWD}%/testing-tmp"
jobs:
ubuntu-jammy-external:
@@ -93,7 +93,7 @@ jobs:
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMNITRACE_CI: 'ON'
ROCPROFSYS_CI: 'ON'
steps:
- uses: actions/checkout@v4
@@ -178,25 +178,25 @@ jobs:
-DCMAKE_C_COMPILER=$(echo '${{ matrix.compiler }}' | sed 's/+/c/g')
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
-DCMAKE_INSTALL_PREFIX=/opt/omnitrace-dev
-DOMNITRACE_BUILD_TESTING=ON
-DOMNITRACE_USE_MPI=${{ matrix.mpi }}
-DOMNITRACE_USE_HIP=${{ matrix.hip }}
-DOMNITRACE_USE_OMPT=${{ matrix.ompt }}
-DOMNITRACE_USE_PAPI=${{ matrix.papi }}
-DOMNITRACE_USE_PYTHON=${{ matrix.python }}
-DOMNITRACE_USE_MPI_HEADERS=${{ matrix.mpi-headers }}
-DOMNITRACE_BUILD_LTO=${{ matrix.lto }}
-DOMNITRACE_BUILD_DYNINST=${{ matrix.build-dyninst }}
-DOMNITRACE_BUILD_HIDDEN_VISIBILITY=${{ matrix.hidden }}
-DOMNITRACE_BUILD_STATIC_LIBGCC=${{ matrix.static-libgcc }}
-DOMNITRACE_BUILD_STATIC_LIBSTDCXX=${{ matrix.static-libstdcxx }}
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
-DOMNITRACE_PYTHON_ENVS="py3.7;py3.8;py3.9;py3.10;py3.11"
-DOMNITRACE_STRIP_LIBRARIES=${{ matrix.strip }}
-DOMNITRACE_MAX_THREADS=64
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
-DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems-dev
-DROCPROFSYS_BUILD_TESTING=ON
-DROCPROFSYS_USE_MPI=${{ matrix.mpi }}
-DROCPROFSYS_USE_HIP=${{ matrix.hip }}
-DROCPROFSYS_USE_OMPT=${{ matrix.ompt }}
-DROCPROFSYS_USE_PAPI=${{ matrix.papi }}
-DROCPROFSYS_USE_PYTHON=${{ matrix.python }}
-DROCPROFSYS_USE_MPI_HEADERS=${{ matrix.mpi-headers }}
-DROCPROFSYS_BUILD_LTO=${{ matrix.lto }}
-DROCPROFSYS_BUILD_DYNINST=${{ matrix.build-dyninst }}
-DROCPROFSYS_BUILD_HIDDEN_VISIBILITY=${{ matrix.hidden }}
-DROCPROFSYS_BUILD_STATIC_LIBGCC=${{ matrix.static-libgcc }}
-DROCPROFSYS_BUILD_STATIC_LIBSTDCXX=${{ matrix.static-libstdcxx }}
-DROCPROFSYS_PYTHON_PREFIX=/opt/conda/envs
-DROCPROFSYS_PYTHON_ENVS="py3.7;py3.8;py3.9;py3.10;py3.11"
-DROCPROFSYS_STRIP_LIBRARIES=${{ matrix.strip }}
-DROCPROFSYS_MAX_THREADS=64
-DROCPROFSYS_DISABLE_EXAMPLES="transpose;rccl"
-DROCPROFSYS_BUILD_NUMBER=${{ github.run_attempt }}
-DUSE_CLANG_OMP=OFF
- name: Install
@@ -208,8 +208,8 @@ jobs:
run: |
cd build
cpack -G STGZ
mkdir -p /opt/omnitrace
./omnitrace-*.sh --prefix=/opt/omnitrace --exclude-subdir --skip-license
mkdir -p /opt/rocprofiler-systems
./rocprofiler-systems-*.sh --prefix=/opt/rocprofiler-systems --exclude-subdir --skip-license
- name: Test Install with Modulefile
timeout-minutes: 15
@@ -217,16 +217,16 @@ jobs:
run: |
set -v
source /usr/share/modules/init/$(basename ${SHELL})
module use /opt/omnitrace/share/modulefiles
module use /opt/rocprofiler-systems/share/modulefiles
module avail
module load omnitrace
./scripts/test-install.sh --test-omnitrace-{instrument,avail,sample,python,rewrite,runtime}=1
module load rocprofiler-systems
./scripts/test-install.sh --test-rocprof-sys-{instrument,avail,sample,python,rewrite,runtime}=1
- name: Test User API
timeout-minutes: 10
run: |
set -v
./scripts/test-find-package.sh --install-dir /opt/omnitrace
./scripts/test-find-package.sh --install-dir /opt/rocprofiler-systems
- name: CTest Artifacts
if: failure()
@@ -244,6 +244,6 @@ jobs:
with:
name: data-${{ github.job }}-${{ strategy.job-index }}-files
path: |
build/omnitrace-tests-config/*.cfg
build/omnitrace-tests-output/**/*.txt
build/omnitrace-tests-output/**/*-instr*.json
build/rocprofsys-tests-config/*.cfg
build/rocprofsys-tests-output/**/*.txt
build/rocprofsys-tests-output/**/*-instr*.json
@@ -46,5 +46,5 @@ _toc.yml
/.cache
/.clangd
/compile_commands.json
/omnitrace-install.py
/scripts/omnitrace-install.py
/rocprof-sys-install.py
/scripts/rocprof-sys-install.py
+158 -136
Parādīt failu
@@ -12,53 +12,57 @@ endif()
if(NOT UNIX OR APPLE)
message(
AUTHOR_WARNING
"omnitrace only supports Linux. Configure and/or build is likely to fail")
"rocprofiler-systems only supports Linux. Configure and/or build is likely to fail"
)
endif()
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" FULL_VERSION_STRING LIMIT_COUNT 1)
string(REGEX REPLACE "(\n|\r)" "" FULL_VERSION_STRING "${FULL_VERSION_STRING}")
string(REGEX REPLACE "([0-9]+)\.([0-9]+)\.([0-9]+)(.*)" "\\1.\\2.\\3" OMNITRACE_VERSION
string(REGEX REPLACE "([0-9]+)\.([0-9]+)\.([0-9]+)(.*)" "\\1.\\2.\\3" ROCPROFSYS_VERSION
"${FULL_VERSION_STRING}")
project(
omnitrace
rocprofiler-systems
LANGUAGES C CXX
VERSION ${OMNITRACE_VERSION}
VERSION ${ROCPROFSYS_VERSION}
DESCRIPTION "CPU/GPU Application tracing with static/dynamic binary instrumentation"
HOMEPAGE_URL "https://github.com/ROCm/omnitrace")
HOMEPAGE_URL "https://github.com/ROCm/rocprofiler-systems")
set(PROJECT_NAME_UNDERSCORED "rocprofiler_systems")
set(BINARY_NAME_PREFIX "rocprof-sys")
find_package(Git)
if(Git_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags
OUTPUT_VARIABLE OMNITRACE_GIT_DESCRIBE
OUTPUT_VARIABLE ROCPROFSYS_GIT_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _GIT_DESCRIBE_RESULT
ERROR_QUIET)
if(NOT _GIT_DESCRIBE_RESULT EQUAL 0)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe
OUTPUT_VARIABLE OMNITRACE_GIT_DESCRIBE
OUTPUT_VARIABLE ROCPROFSYS_GIT_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _GIT_DESCRIBE_RESULT
ERROR_QUIET)
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE OMNITRACE_GIT_REVISION
OUTPUT_VARIABLE ROCPROFSYS_GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
else()
set(OMNITRACE_GIT_DESCRIBE "v${OMNITRACE_VERSION}")
set(OMNITRACE_GIT_REVISION "")
set(ROCPROFSYS_GIT_DESCRIBE "v${ROCPROFSYS_VERSION}")
set(ROCPROFSYS_GIT_REVISION "")
endif()
message(
STATUS
"[${PROJECT_NAME}] version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} (${FULL_VERSION_STRING})"
)
message(STATUS "[${PROJECT_NAME}] git revision: ${OMNITRACE_GIT_REVISION}")
message(STATUS "[${PROJECT_NAME}] git describe: ${OMNITRACE_GIT_DESCRIBE}")
message(STATUS "[${PROJECT_NAME}] git revision: ${ROCPROFSYS_GIT_REVISION}")
message(STATUS "[${PROJECT_NAME}] git describe: ${ROCPROFSYS_GIT_DESCRIBE}")
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/cmake/Modules
${PROJECT_SOURCE_DIR}/source/python/cmake ${CMAKE_MODULE_PATH})
set(BUILD_SHARED_LIBS
@@ -104,8 +108,8 @@ if(DEFINED CMAKE_INSTALL_LIBDIR AND NOT DEFINED CMAKE_DEFAULT_INSTALL_LIBDIR)
CACHE STRING "Object code libraries" FORCE)
endif()
if(NOT "$ENV{OMNITRACE_CI}" STREQUAL "")
set(CI_BUILD $ENV{OMNITRACE_CI})
if(NOT "$ENV{ROCPROFSYS_CI}" STREQUAL "")
set(CI_BUILD $ENV{ROCPROFSYS_CI})
else()
set(CI_BUILD OFF)
endif()
@@ -114,30 +118,33 @@ include(GNUInstallDirs) # install directories
include(MacroUtilities) # various functions and macros
if(CI_BUILD)
omnitrace_add_option(OMNITRACE_BUILD_CI "Enable internal asserts, etc." ON ADVANCED
NO_FEATURE)
omnitrace_add_option(OMNITRACE_BUILD_TESTING "Enable building the testing suite" ON
ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_DEBUG
"Enable building with extensive debug symbols" OFF ADVANCED)
omnitrace_add_option(
OMNITRACE_BUILD_HIDDEN_VISIBILITY
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_CI "Enable internal asserts, etc." ON
ADVANCED NO_FEATURE)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_TESTING
"Enable building the testing suite" ON ADVANCED)
rocprofiler_systems_add_option(
ROCPROFSYS_BUILD_DEBUG "Enable building with extensive debug symbols" OFF
ADVANCED)
rocprofiler_systems_add_option(
ROCPROFSYS_BUILD_HIDDEN_VISIBILITY
"Build with hidden visibility (disable for Debug builds)" OFF ADVANCED)
omnitrace_add_option(OMNITRACE_STRIP_LIBRARIES "Strip the libraries" OFF ADVANCED)
rocprofiler_systems_add_option(ROCPROFSYS_STRIP_LIBRARIES "Strip the libraries" OFF
ADVANCED)
else()
omnitrace_add_option(OMNITRACE_BUILD_CI "Enable internal asserts, etc." OFF ADVANCED
NO_FEATURE)
omnitrace_add_option(OMNITRACE_BUILD_EXAMPLES "Enable building the examples" OFF
ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_TESTING "Enable building the testing suite" OFF
ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_DEBUG
"Enable building with extensive debug symbols" OFF ADVANCED)
omnitrace_add_option(
OMNITRACE_BUILD_HIDDEN_VISIBILITY
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_CI "Enable internal asserts, etc."
OFF ADVANCED NO_FEATURE)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_EXAMPLES
"Enable building the examples" OFF ADVANCED)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_TESTING
"Enable building the testing suite" OFF ADVANCED)
rocprofiler_systems_add_option(
ROCPROFSYS_BUILD_DEBUG "Enable building with extensive debug symbols" OFF
ADVANCED)
rocprofiler_systems_add_option(
ROCPROFSYS_BUILD_HIDDEN_VISIBILITY
"Build with hidden visibility (disable for Debug builds)" ON ADVANCED)
omnitrace_add_option(OMNITRACE_STRIP_LIBRARIES "Strip the libraries"
${_STRIP_LIBRARIES_DEFAULT} ADVANCED)
rocprofiler_systems_add_option(ROCPROFSYS_STRIP_LIBRARIES "Strip the libraries"
${_STRIP_LIBRARIES_DEFAULT} ADVANCED)
endif()
include(Compilers) # compiler identification
@@ -150,139 +157,146 @@ set(CMAKE_CXX_STANDARD
17
CACHE STRING "CXX language standard")
omnitrace_add_feature(CMAKE_BUILD_TYPE "Build optimization level")
omnitrace_add_feature(CMAKE_INSTALL_PREFIX "Installation prefix")
omnitrace_add_feature(CMAKE_CXX_COMPILER "C++ compiler")
omnitrace_add_feature(CMAKE_CXX_STANDARD "CXX language standard")
omnitrace_add_option(CMAKE_CXX_STANDARD_REQUIRED "Require C++ language standard" ON)
omnitrace_add_option(CMAKE_CXX_EXTENSIONS "Compiler specific language extensions" OFF)
omnitrace_add_option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "Enable rpath to linked libraries"
ON)
rocprofiler_systems_add_feature(CMAKE_BUILD_TYPE "Build optimization level")
rocprofiler_systems_add_feature(CMAKE_INSTALL_PREFIX "Installation prefix")
rocprofiler_systems_add_feature(CMAKE_CXX_COMPILER "C++ compiler")
rocprofiler_systems_add_feature(CMAKE_CXX_STANDARD "CXX language standard")
rocprofiler_systems_add_option(CMAKE_CXX_STANDARD_REQUIRED
"Require C++ language standard" ON)
rocprofiler_systems_add_option(CMAKE_CXX_EXTENSIONS
"Compiler specific language extensions" OFF)
rocprofiler_systems_add_option(CMAKE_INSTALL_RPATH_USE_LINK_PATH
"Enable rpath to linked libraries" ON)
set(CMAKE_INSTALL_MESSAGE
"LAZY"
CACHE STRING "Installation message")
mark_as_advanced(CMAKE_INSTALL_MESSAGE)
omnitrace_add_option(OMNITRACE_USE_CLANG_TIDY "Enable clang-tidy" OFF)
omnitrace_add_option(OMNITRACE_USE_BFD
"Enable BFD support (map call-stack samples to LOC)" ON)
omnitrace_add_option(OMNITRACE_USE_MPI "Enable MPI support" OFF)
omnitrace_add_option(OMNITRACE_USE_HIP "Enable HIP support" ON)
omnitrace_add_option(OMNITRACE_USE_PAPI "Enable HW counter support via PAPI" ON)
omnitrace_add_option(OMNITRACE_USE_ROCTRACER "Enable roctracer support"
${OMNITRACE_USE_HIP})
omnitrace_add_option(OMNITRACE_USE_ROCPROFILER "Enable rocprofiler support"
${OMNITRACE_USE_HIP})
omnitrace_add_option(
OMNITRACE_USE_ROCM_SMI "Enable rocm-smi support for power/temp/etc. sampling"
${OMNITRACE_USE_HIP})
omnitrace_add_option(OMNITRACE_USE_RCCL "Enable RCCL support" ${OMNITRACE_USE_HIP})
omnitrace_add_option(OMNITRACE_USE_MPI_HEADERS
"Enable wrapping MPI functions w/o enabling MPI dependency" ON)
omnitrace_add_option(OMNITRACE_USE_OMPT "Enable OpenMP tools support" ON)
omnitrace_add_option(OMNITRACE_USE_PYTHON "Enable Python support" OFF)
omnitrace_add_option(OMNITRACE_BUILD_DYNINST "Build dyninst from submodule" OFF)
omnitrace_add_option(OMNITRACE_BUILD_LIBUNWIND "Build libunwind from submodule" ON)
omnitrace_add_option(OMNITRACE_BUILD_CODECOV "Build for code coverage" OFF)
omnitrace_add_option(OMNITRACE_INSTALL_PERFETTO_TOOLS
"Install perfetto tools (i.e. traced, perfetto, etc.)" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_USE_CLANG_TIDY "Enable clang-tidy" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_USE_BFD
"Enable BFD support (map call-stack samples to LOC)" ON)
rocprofiler_systems_add_option(ROCPROFSYS_USE_MPI "Enable MPI support" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_USE_HIP "Enable HIP support" ON)
rocprofiler_systems_add_option(ROCPROFSYS_USE_PAPI "Enable HW counter support via PAPI"
ON)
rocprofiler_systems_add_option(ROCPROFSYS_USE_ROCTRACER "Enable roctracer support"
${ROCPROFSYS_USE_HIP})
rocprofiler_systems_add_option(ROCPROFSYS_USE_ROCPROFILER "Enable rocprofiler support"
${ROCPROFSYS_USE_HIP})
rocprofiler_systems_add_option(
ROCPROFSYS_USE_ROCM_SMI "Enable rocm-smi support for power/temp/etc. sampling"
${ROCPROFSYS_USE_HIP})
rocprofiler_systems_add_option(ROCPROFSYS_USE_RCCL "Enable RCCL support"
${ROCPROFSYS_USE_HIP})
rocprofiler_systems_add_option(
ROCPROFSYS_USE_MPI_HEADERS
"Enable wrapping MPI functions w/o enabling MPI dependency" ON)
rocprofiler_systems_add_option(ROCPROFSYS_USE_OMPT "Enable OpenMP tools support" ON)
rocprofiler_systems_add_option(ROCPROFSYS_USE_PYTHON "Enable Python support" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_DYNINST "Build dyninst from submodule"
OFF)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_LIBUNWIND
"Build libunwind from submodule" ON)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_CODECOV "Build for code coverage" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_INSTALL_PERFETTO_TOOLS
"Install perfetto tools (i.e. traced, perfetto, etc.)" OFF)
if(OMNITRACE_USE_PAPI)
omnitrace_add_option(OMNITRACE_BUILD_PAPI "Build PAPI from submodule" ON)
if(ROCPROFSYS_USE_PAPI)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_PAPI "Build PAPI from submodule" ON)
endif()
if(OMNITRACE_USE_PYTHON)
omnitrace_add_option(OMNITRACE_BUILD_PYTHON
"Build python bindings with internal pybind11" ON)
elseif("$ENV{OMNITRACE_CI}")
if(ROCPROFSYS_USE_PYTHON)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_PYTHON
"Build python bindings with internal pybind11" ON)
elseif("$ENV{ROCPROFSYS_CI}")
# quiet warnings in dashboard
if(OMNITRACE_PYTHON_ENVS OR OMNITRACE_PYTHON_PREFIX)
omnitrace_message(
if(ROCPROFSYS_PYTHON_ENVS OR ROCPROFSYS_PYTHON_PREFIX)
rocprofiler_systems_message(
STATUS
"Ignoring values of OMNITRACE_PYTHON_ENVS and/or OMNITRACE_PYTHON_PREFIX")
"Ignoring values of ROCPROFSYS_PYTHON_ENVS and/or ROCPROFSYS_PYTHON_PREFIX")
endif()
endif()
if(NOT OMNITRACE_USE_HIP)
set(OMNITRACE_USE_ROCTRACER
if(NOT ROCPROFSYS_USE_HIP)
set(ROCPROFSYS_USE_ROCTRACER
OFF
CACHE BOOL "Disabled via OMNITRACE_USE_HIP=OFF" FORCE)
set(OMNITRACE_USE_ROCPROFILER
CACHE BOOL "Disabled via ROCPROFSYS_USE_HIP=OFF" FORCE)
set(ROCPROFSYS_USE_ROCPROFILER
OFF
CACHE BOOL "Disabled via OMNITRACE_USE_HIP=OFF" FORCE)
set(OMNITRACE_USE_ROCM_SMI
CACHE BOOL "Disabled via ROCPROFSYS_USE_HIP=OFF" FORCE)
set(ROCPROFSYS_USE_ROCM_SMI
OFF
CACHE BOOL "Disabled via OMNITRACE_USE_HIP=OFF" FORCE)
set(OMNITRACE_USE_RCCL
CACHE BOOL "Disabled via ROCPROFSYS_USE_HIP=OFF" FORCE)
set(ROCPROFSYS_USE_RCCL
OFF
CACHE BOOL "Disabled via OMNITRACE_USE_HIP=OFF" FORCE)
CACHE BOOL "Disabled via ROCPROFSYS_USE_HIP=OFF" FORCE)
elseif(
OMNITRACE_USE_HIP
AND NOT OMNITRACE_USE_ROCTRACER
AND NOT OMNITRACE_USE_ROCPROFILER
AND NOT OMNITRACE_USE_ROCM_SMI
AND NOT OMNITRACE_USE_RCCL)
omnitrace_message(
ROCPROFSYS_USE_HIP
AND NOT ROCPROFSYS_USE_ROCTRACER
AND NOT ROCPROFSYS_USE_ROCPROFILER
AND NOT ROCPROFSYS_USE_ROCM_SMI
AND NOT ROCPROFSYS_USE_RCCL)
rocprofiler_systems_message(
AUTHOR_WARNING
"Setting OMNITRACE_USE_HIP=OFF because roctracer, rocprofiler, rccl, and rocm-smi options are disabled"
"Setting ROCPROFSYS_USE_HIP=OFF because roctracer, rocprofiler, rccl, and rocm-smi options are disabled"
)
set(OMNITRACE_USE_HIP OFF)
set(ROCPROFSYS_USE_HIP OFF)
endif()
if(OMNITRACE_BUILD_TESTING)
set(OMNITRACE_BUILD_EXAMPLES
if(ROCPROFSYS_BUILD_TESTING)
set(ROCPROFSYS_BUILD_EXAMPLES
ON
CACHE BOOL "Enable building the examples" FORCE)
endif()
include(ProcessorCount)
processorcount(OMNITRACE_PROCESSOR_COUNT)
processorcount(ROCPROFSYS_PROCESSOR_COUNT)
if(OMNITRACE_PROCESSOR_COUNT LESS 8)
set(OMNITRACE_THREAD_COUNT 128)
if(ROCPROFSYS_PROCESSOR_COUNT LESS 8)
set(ROCPROFSYS_THREAD_COUNT 128)
else()
math(EXPR OMNITRACE_THREAD_COUNT "16 * ${OMNITRACE_PROCESSOR_COUNT}")
compute_pow2_ceil(OMNITRACE_THREAD_COUNT "16 * ${OMNITRACE_PROCESSOR_COUNT}")
math(EXPR ROCPROFSYS_THREAD_COUNT "16 * ${ROCPROFSYS_PROCESSOR_COUNT}")
compute_pow2_ceil(ROCPROFSYS_THREAD_COUNT "16 * ${ROCPROFSYS_PROCESSOR_COUNT}")
# set the default to 2048 if it could not be calculated
if(OMNITRACE_THREAD_COUNT LESS 2)
set(OMNITRACE_THREAD_COUNT 2048)
if(ROCPROFSYS_THREAD_COUNT LESS 2)
set(ROCPROFSYS_THREAD_COUNT 2048)
endif()
endif()
set(OMNITRACE_MAX_THREADS
"${OMNITRACE_THREAD_COUNT}"
set(ROCPROFSYS_MAX_THREADS
"${ROCPROFSYS_THREAD_COUNT}"
CACHE
STRING
"Maximum number of threads in the host application. Likely only needs to be increased if host app does not use thread-pool but creates many threads"
)
omnitrace_add_feature(
OMNITRACE_MAX_THREADS
rocprofiler_systems_add_feature(
ROCPROFSYS_MAX_THREADS
"Maximum number of total threads supported in the host application (default: max of 128 or 16 * nproc)"
)
compute_pow2_ceil(_MAX_THREADS "${OMNITRACE_MAX_THREADS}")
compute_pow2_ceil(_MAX_THREADS "${ROCPROFSYS_MAX_THREADS}")
if(_MAX_THREADS GREATER 0 AND NOT OMNITRACE_MAX_THREADS EQUAL _MAX_THREADS)
omnitrace_message(
if(_MAX_THREADS GREATER 0 AND NOT ROCPROFSYS_MAX_THREADS EQUAL _MAX_THREADS)
rocprofiler_systems_message(
FATAL_ERROR
"Error! OMNITRACE_MAX_THREADS must be a power of 2. Recommendation: ${_MAX_THREADS}"
"Error! ROCPROFSYS_MAX_THREADS must be a power of 2. Recommendation: ${_MAX_THREADS}"
)
elseif(NOT OMNITRACE_MAX_THREADS EQUAL _MAX_THREADS)
omnitrace_message(
elseif(NOT ROCPROFSYS_MAX_THREADS EQUAL _MAX_THREADS)
rocprofiler_systems_message(
AUTHOR_WARNING
"OMNITRACE_MAX_THREADS (=${OMNITRACE_MAX_THREADS}) must be a power of 2. We were unable to verify it so we are emitting this warning instead. Estimate resulted in: ${_MAX_THREADS}"
"ROCPROFSYS_MAX_THREADS (=${ROCPROFSYS_MAX_THREADS}) must be a power of 2. We were unable to verify it so we are emitting this warning instead. Estimate resulted in: ${_MAX_THREADS}"
)
endif()
set(OMNITRACE_MAX_UNWIND_DEPTH
set(ROCPROFSYS_MAX_UNWIND_DEPTH
"64"
CACHE
STRING
"Maximum call-stack depth to search during call-stack unwinding. Decreasing this value will result in sampling consuming less memory"
)
omnitrace_add_feature(
OMNITRACE_MAX_UNWIND_DEPTH
rocprofiler_systems_add_feature(
ROCPROFSYS_MAX_UNWIND_DEPTH
"Maximum call-stack depth to search during call-stack unwinding. Decreasing this value will result in sampling consuming less memory"
)
@@ -301,16 +315,16 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(Formatting) # format target
include(Packages) # finds third-party libraries
omnitrace_activate_clang_tidy()
rocprofiler_systems_activate_clang_tidy()
# custom visibility settings
if(OMNITRACE_BUILD_HIDDEN_VISIBILITY)
if(ROCPROFSYS_BUILD_HIDDEN_VISIBILITY)
set(CMAKE_C_VISIBILITY_PRESET "internal")
set(CMAKE_CXX_VISIBILITY_PRESET "internal")
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
endif()
if(OMNITRACE_BUILD_TESTING OR "$ENV{OMNITRACE_CI}" MATCHES "[1-9]+|ON|on|y|yes")
if(ROCPROFSYS_BUILD_TESTING OR "$ENV{ROCPROFSYS_CI}" MATCHES "[1-9]+|ON|on|y|yes")
enable_testing()
include(CTest)
endif()
@@ -323,11 +337,13 @@ endif()
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME core)
if(OMNITRACE_BUILD_CODECOV)
omnitrace_save_variables(CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
if(ROCPROFSYS_BUILD_CODECOV)
rocprofiler_systems_save_variables(CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS
CMAKE_CXX_FLAGS)
foreach(_BUILD_TYPE DEBUG MINSIZEREL RELWITHDEBINFO RELEASE)
omnitrace_save_variables(CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS_${_BUILD_TYPE}
CMAKE_CXX_FLAGS_${_BUILD_TYPE})
rocprofiler_systems_save_variables(
CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS_${_BUILD_TYPE}
CMAKE_CXX_FLAGS_${_BUILD_TYPE})
endforeach()
foreach(_BUILD_TYPE DEBUG MINSIZEREL RELWITHDEBINFO RELEASE)
@@ -345,11 +361,12 @@ endif()
add_subdirectory(source)
if(OMNITRACE_BUILD_CODECOV)
omnitrace_restore_variables(CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
if(ROCPROFSYS_BUILD_CODECOV)
rocprofiler_systems_restore_variables(CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS
CMAKE_CXX_FLAGS)
foreach(_BUILD_TYPE DEBUG MINSIZEREL RELWITHDEBINFO RELEASE)
omnitrace_restore_variables(
rocprofiler_systems_restore_variables(
CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS_${_BUILD_TYPE}
CMAKE_CXX_FLAGS_${_BUILD_TYPE})
endforeach()
@@ -361,14 +378,19 @@ endif()
#
# ------------------------------------------------------------------------------#
if(NOT OMNITRACE_USE_ROCTRACER AND NOT OMNITRACE_USE_ROCPROFILER)
set(OMNITRACE_HSA_ENV "# ")
if(NOT ROCPROFSYS_USE_ROCTRACER AND NOT ROCPROFSYS_USE_ROCPROFILER)
set(ROCPROFSYS_HSA_ENV "# ")
endif()
if(NOT OMNITRACE_USE_ROCPROFILER)
set(OMNITRACE_ROCP_ENV "# ")
if(NOT ROCPROFSYS_USE_ROCPROFILER)
set(ROCPROFSYS_ROCP_ENV "# ")
endif()
configure_file(
${PROJECT_SOURCE_DIR}/LICENSE
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}/LICENSE
COPYONLY)
configure_file(
${PROJECT_SOURCE_DIR}/perfetto.cfg
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/perfetto.cfg
@@ -380,7 +402,7 @@ configure_file(
configure_file(
${PROJECT_SOURCE_DIR}/cmake/Templates/modulefile.in
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/modulefiles/${PROJECT_NAME}/${OMNITRACE_VERSION}
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/modulefiles/${PROJECT_NAME}/${ROCPROFSYS_VERSION}
@ONLY)
install(
@@ -391,13 +413,13 @@ install(
install(
FILES
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/modulefiles/${PROJECT_NAME}/${OMNITRACE_VERSION}
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/modulefiles/${PROJECT_NAME}/${ROCPROFSYS_VERSION}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/modulefiles/${PROJECT_NAME}
COMPONENT setup)
install(
FILES ${PROJECT_SOURCE_DIR}/LICENSE
DESTINATION ${CMAKE_INSTALL_DOCDIR}
FILES ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}/LICENSE
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}
COMPONENT setup)
# ------------------------------------------------------------------------------#
@@ -415,7 +437,7 @@ include(ConfigInstall)
#
# ------------------------------------------------------------------------------#
if(OMNITRACE_BUILD_EXAMPLES)
if(ROCPROFSYS_BUILD_EXAMPLES)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME examples)
add_subdirectory(examples)
endif()
@@ -426,7 +448,7 @@ endif()
#
# ------------------------------------------------------------------------------#
if(OMNITRACE_BUILD_TESTING)
if(ROCPROFSYS_BUILD_TESTING)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME testing)
add_subdirectory(tests)
endif()
@@ -446,4 +468,4 @@ include(ConfigCPack)
#
# ------------------------------------------------------------------------------#
omnitrace_print_features()
rocprofiler_systems_print_features()
+1 -1
Parādīt failu
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+35 -35
Parādīt failu
@@ -13,7 +13,7 @@ If you are experiencing problems viewing your trace in the latest version of [Pe
## Overview
ROCm Systems Profiler (rocprof-sys), formerly Omnitrace, is a comprehensive profiling and tracing tool for parallel applications written in C, C++, Fortran, HIP, OpenCL, and Python which execute on the CPU or CPU+GPU.
ROCm Systems Profiler (rocprofiler-systems), formerly Omnitrace, is a comprehensive profiling and tracing tool for parallel applications written in C, C++, Fortran, HIP, OpenCL, and Python which execute on the CPU or CPU+GPU.
It is capable of gathering the performance information of functions through any combination of binary instrumentation, call-stack sampling, user-defined regions, and Python interpreter hooks.
ROCm Systems Profiler supports interactive visualization of comprehensive traces in the web browser in addition to high-level summary profiles with mean/min/max/stddev statistics.
In addition to runtimes, ROCm Systems Profiler supports the collection of system-level metrics such as the CPU frequency, GPU temperature, and GPU utilization, process-level metrics
@@ -94,66 +94,66 @@ The documentation source files reside in the [`/docs`](/docs) folder of this rep
- Visit [Releases](https://github.com/ROCm/rocprofiler-systems/releases) page
- Select appropriate installer (recommendation: `.sh` scripts do not require super-user priviledges unlike the DEB/RPM installers)
- If targeting a ROCm application, find the installer script with the matching ROCm version
- If you are unsure about your Linux distro, check `/etc/os-release` or use the `rocprof-sys-install.py` script
- If you are unsure about your Linux distro, check `/etc/os-release` or use the `rocprofiler-systems-install.py` script
If the above recommendation is not desired, download the `rocprof-sys-install.py` and specify `--prefix <install-directory>` when
If the above recommendation is not desired, download the `rocprofiler-systems-install.py` and specify `--prefix <install-directory>` when
executing it. This script will attempt to auto-detect a compatible OS distribution and version.
If ROCm support is desired, specify `--rocm X.Y` where `X` is the ROCm major version and `Y`
is the ROCm minor version, e.g. `--rocm 5.4`.
```console
wget https://github.com/ROCm/rocprofiler-systems/releases/latest/download/rocprof-sys-install.py
python3 ./rocprof-sys-install.py --prefix /opt/rocprof-sys/rocm-5.4 --rocm 5.4
wget https://github.com/ROCm/rocprofiler-systems/releases/latest/download/rocprofiler-systems-install.py
python3 ./rocprofiler-systems-install.py --prefix /opt/rocprofiler-systems/rocm-5.4 --rocm 5.4
```
See the [ROCm Systems Profiler installation guide](https://rocm.docs.amd.com/projects/omnitrace/en/latest/install/install.html) for detailed information.
### Setup
> NOTE: Replace `/opt/rocprof-sys` below with installation prefix as necessary.
> NOTE: Replace `/opt/rocprofiler-systems` below with installation prefix as necessary.
- Option 1: Source `setup-env.sh` script
```bash
source /opt/rocprof-sys/share/rocprof-sys/setup-env.sh
source /opt/rocprofiler-systems/share/rocprofiler-systems/setup-env.sh
```
- Option 2: Load modulefile
```bash
module use /opt/rocprof-sys/share/modulefiles
module load rocprof-sys
module use /opt/rocprofiler-systems/share/modulefiles
module load rocprofiler-systems
```
- Option 3: Manual
```bash
export PATH=/opt/rocprof-sys/bin:${PATH}
export LD_LIBRARY_PATH=/opt/rocprof-sys/lib:${LD_LIBRARY_PATH}
export PATH=/opt/rocprofiler-systems/bin:${PATH}
export LD_LIBRARY_PATH=/opt/rocprofiler-systems/lib:${LD_LIBRARY_PATH}
```
### ROCm Systems Profiler Settings
Generate a rocprof-sys configuration file using `rocprof-sys-avail -G rocprof-sys.cfg`. Optionally, use `rocprof-sys-avail -G rocprof-sys.cfg --all` for
Generate a rocprofiler-systems configuration file using `rocprof-sys-avail -G rocprof-sys.cfg`. Optionally, use `rocprof-sys-avail -G rocprof-sys.cfg --all` for
a verbose configuration file with descriptions, categories, etc. Modify the configuration file as desired, e.g. enable
[perfetto](https://perfetto.dev/), [timemory](https://github.com/NERSC/timemory), sampling, and process-level sampling by default
and tweak some sampling default values:
```console
# ...
OMNITRACE_TRACE = true
OMNITRACE_PROFILE = true
OMNITRACE_USE_SAMPLING = true
OMNITRACE_USE_PROCESS_SAMPLING = true
ROCPROFSYS_TRACE = true
ROCPROFSYS_PROFILE = true
ROCPROFSYS_USE_SAMPLING = true
ROCPROFSYS_USE_PROCESS_SAMPLING = true
# ...
OMNITRACE_SAMPLING_FREQ = 50
OMNITRACE_SAMPLING_CPUS = all
OMNITRACE_SAMPLING_GPUS = $env:HIP_VISIBLE_DEVICES
ROCPROFSYS_SAMPLING_FREQ = 50
ROCPROFSYS_SAMPLING_CPUS = all
ROCPROFSYS_SAMPLING_GPUS = $env:HIP_VISIBLE_DEVICES
```
Once the configuration file is adjusted to your preferences, either export the path to this file via `OMNITRACE_CONFIG_FILE=/path/to/rocprof-sys.cfg`
Once the configuration file is adjusted to your preferences, either export the path to this file via `ROCPROFSYS_CONFIG_FILE=/path/to/rocprof-sys.cfg`
or place this file in `${HOME}/.rocprof-sys.cfg` to ensure these values are always read as the default. If you wish to change any of these settings,
you can override them via environment variables or by specifying an alternative `OMNITRACE_CONFIG_FILE`.
you can override them via environment variables or by specifying an alternative `ROCPROFSYS_CONFIG_FILE`.
### Call-Stack Sampling
@@ -169,7 +169,7 @@ rocprof-sys-sample -f 1000 -- ls -la
### Binary Instrumentation
The `rocprof-sys-instrument` executable is used to instrument an existing binary. Call-stack sampling can be enabled alongside
the execution an instrumented binary, to help "fill in the gaps" between the instrumentation via setting the `OMNITRACE_USE_SAMPLING`
the execution an instrumented binary, to help "fill in the gaps" between the instrumentation via setting the `ROCPROFSYS_USE_SAMPLING`
configuration variable to `ON`.
Similar to `rocprof-sys-sample`, use a double-hypen (`--`) to separate the command-line arguments for `rocprof-sys-instrument` from the target application and it's arguments.
@@ -206,7 +206,7 @@ rocprof-sys-run -- ./app.inst
```
If you want to re-define certain settings to new default in a binary rewrite, use the `--env` option. This `rocprof-sys` option
will set the environment variable to the given value but will not override it. E.g. the default value of `OMNITRACE_PERFETTO_BUFFER_SIZE_KB`
will set the environment variable to the given value but will not override it. E.g. the default value of `ROCPROFSYS_PERFETTO_BUFFER_SIZE_KB`
is 1024000 KB (1 GiB):
```shell
@@ -215,11 +215,11 @@ rocprof-sys-instrument -o app.inst -- /path/to/app
rocprof-sys-run -- ./app.inst
```
Passing `--env OMNITRACE_PERFETTO_BUFFER_SIZE_KB=5120000` will change the default value in `app.inst` to 5120000 KiB (5 GiB):
Passing `--env ROCPROFSYS_PERFETTO_BUFFER_SIZE_KB=5120000` will change the default value in `app.inst` to 5120000 KiB (5 GiB):
```shell
# defaults to 5 GiB buffer size
rocprof-sys-instrument -o app.inst --env OMNITRACE_PERFETTO_BUFFER_SIZE_KB=5120000 -- /path/to/app
rocprof-sys-instrument -o app.inst --env ROCPROFSYS_PERFETTO_BUFFER_SIZE_KB=5120000 -- /path/to/app
rocprof-sys-run -- ./app.inst
```
@@ -227,7 +227,7 @@ rocprof-sys-run -- ./app.inst
# override default 5 GiB buffer size to 200 MB via command-line
rocprof-sys-run --trace-buffer-size=200000 -- ./app.inst
# override default 5 GiB buffer size to 200 MB via environment
export OMNITRACE_PERFETTO_BUFFER_SIZE_KB=200000
export ROCPROFSYS_PERFETTO_BUFFER_SIZE_KB=200000
rocprof-sys-run -- ./app.inst
```
@@ -293,7 +293,7 @@ for `foo` via the direct call within `spam`. There will be no entries for `bar`
- Visit [ui.perfetto.dev](https://ui.perfetto.dev) in the web-browser
- Select "Open trace file" from panel on the left
- Locate the rocprof-sys perfetto output (extension: `.proto`)
- Locate the rocprofiler-systems perfetto output (extension: `.proto`)
![rocprof-sys-perfetto](docs/data/omnitrace-perfetto.png)
@@ -306,27 +306,27 @@ for `foo` via the direct call within `spam`. There will be no entries for `bar`
## Using Perfetto tracing with System Backend
Perfetto tracing with the system backend supports multiple processes writing to the same
output file. Thus, it is a useful technique if rocprof-sys is built with partial MPI support
output file. Thus, it is a useful technique if rocprofiler-systems is built with partial MPI support
because all the perfetto output will be coalesced into a single file. The
installation docs for perfetto can be found [here](https://perfetto.dev/docs/contributing/build-instructions).
If you are building rocprof-sys from source, you can configure CMake with `OMNITRACE_INSTALL_PERFETTO_TOOLS=ON`
If you are building rocprofiler-systems from source, you can configure CMake with `ROCPROFSYS_INSTALL_PERFETTO_TOOLS=ON`
and the `perfetto` and `traced` applications will be installed as part of the build process. However,
it should be noted that to prevent this option from accidentally overwriting an existing perfetto install,
all the perfetto executables installed by omnitrace are prefixed with `rocprof-sys-perfetto-`, except for the `perfetto`
executable, which is just renamed `rocprof-sys-perfetto`.
all the perfetto executables installed by ROCm Systems Profiler are prefixed with `rocprof-sys-perfetto-`, except
for the `perfetto` executable, which is just renamed `rocprof-sys-perfetto`.
Enable `traced` and `perfetto` in the background:
```shell
pkill traced
traced --background
perfetto --out ./rocprof-sys-perfetto.proto --txt -c ${OMNITRACE_ROOT}/share/perfetto.cfg --background
perfetto --out ./rocprof-sys-perfetto.proto --txt -c ${ROCPROFSYS_ROOT}/share/perfetto.cfg --background
```
> ***NOTE: if the perfetto tools were installed by rocprof-sys, replace `traced` with `rocprof-sys-perfetto-traced` and***
> ***NOTE: if the perfetto tools were installed by rocprofiler-systems, replace `traced` with `rocprof-sys-perfetto-traced` and***
> ***`perfetto` with `rocprof-sys-perfetto`.***
Configure rocprof-sys to use the perfetto system backend via the `--perfetto-backend` option of `rocprof-sys-run`:
Configure rocprofiler-systems to use the perfetto system backend via the `--perfetto-backend` option of `rocprof-sys-run`:
```shell
# enable sampling on the uninstrumented binary
@@ -339,5 +339,5 @@ rocprof-sys-run --trace --perfetto-backend=system -- ./myapp.inst
or via the `--env` option of `rocprof-sys-instrument` + runtime instrumentation:
```shell
rocprof-sys-instrument --env OMNITRACE_PERFETTO_BACKEND=system -- ./myapp
rocprof-sys-instrument --env ROCPROFSYS_PERFETTO_BACKEND=system -- ./myapp
```
@@ -12,49 +12,55 @@ include(Compilers)
include(FindPackageHandleStandardArgs)
include(MacroUtilities)
omnitrace_add_option(
OMNITRACE_BUILD_DEVELOPER "Extra build flags for development like -Werror"
${OMNITRACE_BUILD_CI})
omnitrace_add_option(OMNITRACE_BUILD_RELEASE "Build with minimal debug line info" OFF)
omnitrace_add_option(OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS "Extra optimization flags" OFF)
omnitrace_add_option(OMNITRACE_BUILD_LTO "Build with link-time optimization" OFF)
omnitrace_add_option(OMNITRACE_USE_COMPILE_TIMING
"Build with timing metrics for compilation" OFF)
omnitrace_add_option(OMNITRACE_USE_SANITIZER
"Build with -fsanitze=\${OMNITRACE_SANITIZER_TYPE}" OFF)
omnitrace_add_option(OMNITRACE_BUILD_STATIC_LIBGCC
"Build with -static-libgcc if possible" OFF)
omnitrace_add_option(OMNITRACE_BUILD_STATIC_LIBSTDCXX
"Build with -static-libstdc++ if possible" OFF)
omnitrace_add_option(OMNITRACE_BUILD_STACK_PROTECTOR "Build with -fstack-protector" ON)
omnitrace_add_cache_option(
OMNITRACE_BUILD_LINKER
"If set to a non-empty value, pass -fuse-ld=\${OMNITRACE_BUILD_LINKER}" STRING "bfd")
omnitrace_add_cache_option(OMNITRACE_BUILD_NUMBER "Internal CI use" STRING "0" ADVANCED
NO_FEATURE)
rocprofiler_systems_add_option(
ROCPROFSYS_BUILD_DEVELOPER "Extra build flags for development like -Werror"
${ROCPROFSYS_BUILD_CI})
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_RELEASE
"Build with minimal debug line info" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_EXTRA_OPTIMIZATIONS
"Extra optimization flags" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_LTO "Build with link-time optimization"
OFF)
rocprofiler_systems_add_option(ROCPROFSYS_USE_COMPILE_TIMING
"Build with timing metrics for compilation" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_USE_SANITIZER
"Build with -fsanitze=\${ROCPROFSYS_SANITIZER_TYPE}" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_STATIC_LIBGCC
"Build with -static-libgcc if possible" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_STATIC_LIBSTDCXX
"Build with -static-libstdc++ if possible" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_BUILD_STACK_PROTECTOR
"Build with -fstack-protector" ON)
rocprofiler_systems_add_cache_option(
ROCPROFSYS_BUILD_LINKER
"If set to a non-empty value, pass -fuse-ld=\${ROCPROFSYS_BUILD_LINKER}" STRING "bfd")
rocprofiler_systems_add_cache_option(ROCPROFSYS_BUILD_NUMBER "Internal CI use" STRING "0"
ADVANCED NO_FEATURE)
omnitrace_add_interface_library(omnitrace-static-libgcc
"Link to static version of libgcc")
omnitrace_add_interface_library(omnitrace-static-libstdcxx
"Link to static version of libstdc++")
omnitrace_add_interface_library(omnitrace-static-libgcc-optional
"Link to static version of libgcc")
omnitrace_add_interface_library(omnitrace-static-libstdcxx-optional
"Link to static version of libstdc++")
rocprofiler_systems_add_interface_library(rocprofiler-systems-static-libgcc
"Link to static version of libgcc")
rocprofiler_systems_add_interface_library(rocprofiler-systems-static-libstdcxx
"Link to static version of libstdc++")
rocprofiler_systems_add_interface_library(rocprofiler-systems-static-libgcc-optional
"Link to static version of libgcc")
rocprofiler_systems_add_interface_library(rocprofiler-systems-static-libstdcxx-optional
"Link to static version of libstdc++")
target_compile_definitions(omnitrace-compile-options INTERFACE $<$<CONFIG:DEBUG>:DEBUG>)
target_compile_definitions(rocprofiler-systems-compile-options
INTERFACE $<$<CONFIG:DEBUG>:DEBUG>)
set(OMNITRACE_SANITIZER_TYPE
set(ROCPROFSYS_SANITIZER_TYPE
"leak"
CACHE STRING "Sanitizer type")
if(OMNITRACE_USE_SANITIZER)
omnitrace_add_feature(OMNITRACE_SANITIZER_TYPE
"Sanitizer type, e.g. leak, thread, address, memory, etc.")
if(ROCPROFSYS_USE_SANITIZER)
rocprofiler_systems_add_feature(
ROCPROFSYS_SANITIZER_TYPE
"Sanitizer type, e.g. leak, thread, address, memory, etc.")
endif()
if(OMNITRACE_BUILD_CI)
omnitrace_target_compile_definitions(${LIBNAME}-compile-options
INTERFACE OMNITRACE_CI)
if(ROCPROFSYS_BUILD_CI)
rocprofiler_systems_target_compile_definitions(${LIBNAME}-compile-options
INTERFACE ROCPROFSYS_CI)
endif()
# ----------------------------------------------------------------------------------------#
@@ -78,7 +84,7 @@ find_package_handle_standard_args(rt-library REQUIRED_VARS rt_LIBRARY)
# find_package_handle_standard_args(dw-library REQUIRED_VARS dw_LIBRARY)
if(dl_LIBRARY)
target_link_libraries(omnitrace-compile-options INTERFACE ${dl_LIBRARY})
target_link_libraries(rocprofiler-systems-compile-options INTERFACE ${dl_LIBRARY})
endif()
# ----------------------------------------------------------------------------------------#
@@ -88,7 +94,7 @@ add_flag_if_avail(
"-W" "-Wall" "-Wno-unknown-pragmas" "-Wno-unused-function" "-Wno-ignored-attributes"
"-Wno-attributes" "-Wno-missing-field-initializers" "-Wno-interference-size")
if(OMNITRACE_BUILD_DEBUG)
if(ROCPROFSYS_BUILD_DEBUG)
add_flag_if_avail("-g3" "-fno-omit-frame-pointer")
endif()
@@ -104,58 +110,59 @@ endif()
# ----------------------------------------------------------------------------------------#
# extra flags for debug information in debug or optimized binaries
#
omnitrace_add_interface_library(
omnitrace-compile-debuginfo
rocprofiler_systems_add_interface_library(
rocprofiler-systems-compile-debuginfo
"Attempts to set best flags for more expressive profiling information in debug or optimized binaries"
)
add_target_flag_if_avail(omnitrace-compile-debuginfo "-g3" "-fno-omit-frame-pointer"
"-fno-optimize-sibling-calls")
add_target_flag_if_avail(rocprofiler-systems-compile-debuginfo "-g3"
"-fno-omit-frame-pointer" "-fno-optimize-sibling-calls")
if(CMAKE_CUDA_COMPILER_IS_NVIDIA)
add_target_cuda_flag(omnitrace-compile-debuginfo "-lineinfo")
add_target_cuda_flag(rocprofiler-systems-compile-debuginfo "-lineinfo")
endif()
target_compile_options(
omnitrace-compile-debuginfo
rocprofiler-systems-compile-debuginfo
INTERFACE $<$<COMPILE_LANGUAGE:C>:$<$<C_COMPILER_ID:GNU>:-rdynamic>>
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU>:-rdynamic>>)
if(NOT APPLE)
target_link_options(omnitrace-compile-debuginfo INTERFACE
target_link_options(rocprofiler-systems-compile-debuginfo INTERFACE
$<$<CXX_COMPILER_ID:GNU>:-rdynamic>)
endif()
if(CMAKE_CUDA_COMPILER_IS_NVIDIA)
target_compile_options(
omnitrace-compile-debuginfo
rocprofiler-systems-compile-debuginfo
INTERFACE
$<$<COMPILE_LANGUAGE:CUDA>:$<$<CXX_COMPILER_ID:GNU>:-Xcompiler=-rdynamic>>)
endif()
if(dl_LIBRARY)
target_link_libraries(omnitrace-compile-debuginfo INTERFACE ${dl_LIBRARY})
target_link_libraries(rocprofiler-systems-compile-debuginfo INTERFACE ${dl_LIBRARY})
endif()
if(rt_LIBRARY)
target_link_libraries(omnitrace-compile-debuginfo INTERFACE ${rt_LIBRARY})
target_link_libraries(rocprofiler-systems-compile-debuginfo INTERFACE ${rt_LIBRARY})
endif()
# ----------------------------------------------------------------------------------------#
# non-debug optimizations
#
omnitrace_add_interface_library(omnitrace-compile-extra "Extra optimization flags")
if(NOT OMNITRACE_BUILD_CODECOV AND OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS)
rocprofiler_systems_add_interface_library(rocprofiler-systems-compile-extra
"Extra optimization flags")
if(NOT ROCPROFSYS_BUILD_CODECOV AND ROCPROFSYS_BUILD_EXTRA_OPTIMIZATIONS)
add_target_flag_if_avail(
omnitrace-compile-extra "-finline-functions" "-funroll-loops" "-ftree-vectorize"
"-ftree-loop-optimize" "-ftree-loop-vectorize")
rocprofiler-systems-compile-extra "-finline-functions" "-funroll-loops"
"-ftree-vectorize" "-ftree-loop-optimize" "-ftree-loop-vectorize")
endif()
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug"
AND OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS
AND NOT OMNITRACE_BUILD_CODECOV)
target_link_libraries(omnitrace-compile-options
INTERFACE $<BUILD_INTERFACE:omnitrace-compile-extra>)
AND ROCPROFSYS_BUILD_EXTRA_OPTIMIZATIONS
AND NOT ROCPROFSYS_BUILD_CODECOV)
target_link_libraries(rocprofiler-systems-compile-options
INTERFACE $<BUILD_INTERFACE:rocprofiler-systems-compile-extra>)
add_flag_if_avail(
"-fno-signaling-nans" "-fno-trapping-math" "-fno-signed-zeros"
"-ffinite-math-only" "-fno-math-errno" "-fpredictive-commoning"
@@ -168,103 +175,106 @@ endif()
#
add_cxx_flag_if_avail("-faligned-new")
omnitrace_add_interface_library(omnitrace-lto "Adds link-time-optimization flags")
rocprofiler_systems_add_interface_library(rocprofiler-systems-lto
"Adds link-time-optimization flags")
if(NOT OMNITRACE_BUILD_CODECOV)
omnitrace_save_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
if(NOT ROCPROFSYS_BUILD_CODECOV)
rocprofiler_systems_save_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
set(_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-flto=thin ${_CXX_FLAGS}")
add_target_flag_if_avail(omnitrace-lto "-flto=thin")
if(NOT cxx_omnitrace_lto_flto_thin)
add_target_flag_if_avail(rocprofiler-systems-lto "-flto=thin")
if(NOT cxx_rocprofiler_systems_lto_flto_thin)
set(CMAKE_CXX_FLAGS "-flto ${_CXX_FLAGS}")
add_target_flag_if_avail(omnitrace-lto "-flto")
if(NOT cxx_omnitrace_lto_flto)
set(OMNITRACE_BUILD_LTO OFF)
add_target_flag_if_avail(rocprofiler-systems-lto "-flto")
if(NOT cxx_rocprofiler_systems_lto_flto)
set(ROCPROFSYS_BUILD_LTO OFF)
else()
target_link_options(omnitrace-lto INTERFACE -flto)
target_link_options(rocprofiler-systems-lto INTERFACE -flto)
endif()
add_target_flag_if_avail(omnitrace-lto "-fno-fat-lto-objects")
if(cxx_omnitrace_lto_fno_fat_lto_objects)
target_link_options(omnitrace-lto INTERFACE -fno-fat-lto-objects)
add_target_flag_if_avail(rocprofiler-systems-lto "-fno-fat-lto-objects")
if(cxx_rocprofiler_systems_lto_fno_fat_lto_objects)
target_link_options(rocprofiler-systems-lto INTERFACE -fno-fat-lto-objects)
endif()
else()
target_link_options(omnitrace-lto INTERFACE -flto=thin)
target_link_options(rocprofiler-systems-lto INTERFACE -flto=thin)
endif()
omnitrace_restore_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
rocprofiler_systems_restore_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
endif()
# ----------------------------------------------------------------------------------------#
# print compilation timing reports (Clang compiler)
#
omnitrace_add_interface_library(
omnitrace-compile-timing
rocprofiler_systems_add_interface_library(
rocprofiler-systems-compile-timing
"Adds compiler flags which report compilation timing metrics")
if(CMAKE_CXX_COMPILER_IS_CLANG)
add_target_flag_if_avail(omnitrace-compile-timing "-ftime-trace")
if(NOT cxx_omnitrace_compile_timing_ftime_trace)
add_target_flag_if_avail(omnitrace-compile-timing "-ftime-report")
add_target_flag_if_avail(rocprofiler-systems-compile-timing "-ftime-trace")
if(NOT cxx_rocprofiler_systems_compile_timing_ftime_trace)
add_target_flag_if_avail(rocprofiler-systems-compile-timing "-ftime-report")
endif()
else()
add_target_flag_if_avail(omnitrace-compile-timing "-ftime-report")
add_target_flag_if_avail(rocprofiler-systems-compile-timing "-ftime-report")
endif()
if(OMNITRACE_USE_COMPILE_TIMING)
target_link_libraries(omnitrace-compile-options INTERFACE omnitrace-compile-timing)
if(ROCPROFSYS_USE_COMPILE_TIMING)
target_link_libraries(rocprofiler-systems-compile-options
INTERFACE rocprofiler-systems-compile-timing)
endif()
# ----------------------------------------------------------------------------------------#
# fstack-protector
#
omnitrace_add_interface_library(omnitrace-stack-protector
"Adds stack-protector compiler flags")
add_target_flag_if_avail(omnitrace-stack-protector "-fstack-protector-strong"
rocprofiler_systems_add_interface_library(rocprofiler-systems-stack-protector
"Adds stack-protector compiler flags")
add_target_flag_if_avail(rocprofiler-systems-stack-protector "-fstack-protector-strong"
"-Wstack-protector")
if(OMNITRACE_BUILD_STACK_PROTECTOR)
target_link_libraries(omnitrace-compile-options INTERFACE omnitrace-stack-protector)
if(ROCPROFSYS_BUILD_STACK_PROTECTOR)
target_link_libraries(rocprofiler-systems-compile-options
INTERFACE rocprofiler-systems-stack-protector)
endif()
# ----------------------------------------------------------------------------------------#
# developer build flags
#
if(OMNITRACE_BUILD_DEVELOPER)
if(ROCPROFSYS_BUILD_DEVELOPER)
add_target_flag_if_avail(
omnitrace-compile-options "-Werror" "-Wdouble-promotion" "-Wshadow" "-Wextra"
"-Wpedantic" "-Wstack-usage=524288" # 512 KB
rocprofiler-systems-compile-options "-Werror" "-Wdouble-promotion" "-Wshadow"
"-Wextra" "-Wpedantic" "-Wstack-usage=524288" # 512 KB
"/showIncludes")
if(OMNITRACE_BUILD_NUMBER GREATER 2)
add_target_flag_if_avail(omnitrace-compile-options "-gsplit-dwarf")
if(ROCPROFSYS_BUILD_NUMBER GREATER 2)
add_target_flag_if_avail(rocprofiler-systems-compile-options "-gsplit-dwarf")
endif()
endif()
if(OMNITRACE_BUILD_LINKER)
if(ROCPROFSYS_BUILD_LINKER)
target_link_options(
omnitrace-compile-options INTERFACE
$<$<C_COMPILER_ID:GNU>:-fuse-ld=${OMNITRACE_BUILD_LINKER}>
$<$<CXX_COMPILER_ID:GNU>:-fuse-ld=${OMNITRACE_BUILD_LINKER}>)
rocprofiler-systems-compile-options INTERFACE
$<$<C_COMPILER_ID:GNU>:-fuse-ld=${ROCPROFSYS_BUILD_LINKER}>
$<$<CXX_COMPILER_ID:GNU>:-fuse-ld=${ROCPROFSYS_BUILD_LINKER}>)
endif()
# ----------------------------------------------------------------------------------------#
# release build flags
#
if(OMNITRACE_BUILD_RELEASE AND NOT OMNITRACE_BUILD_DEBUG)
if(ROCPROFSYS_BUILD_RELEASE AND NOT ROCPROFSYS_BUILD_DEBUG)
add_target_flag_if_avail(
omnitrace-compile-options "-g1" "-feliminate-unused-debug-symbols"
rocprofiler-systems-compile-options "-g1" "-feliminate-unused-debug-symbols"
"-gno-column-info" "-gno-variable-location-views" "-gline-tables-only")
endif()
# ----------------------------------------------------------------------------------------#
# visibility build flags
#
omnitrace_add_interface_library(omnitrace-default-visibility
"Adds -fvisibility=default compiler flag")
omnitrace_add_interface_library(omnitrace-hidden-visibility
"Adds -fvisibility=hidden compiler flag")
rocprofiler_systems_add_interface_library(rocprofiler-systems-default-visibility
"Adds -fvisibility=default compiler flag")
rocprofiler_systems_add_interface_library(rocprofiler-systems-hidden-visibility
"Adds -fvisibility=hidden compiler flag")
add_target_flag_if_avail(omnitrace-default-visibility "-fvisibility=default")
add_target_flag_if_avail(omnitrace-hidden-visibility "-fvisibility=hidden"
add_target_flag_if_avail(rocprofiler-systems-default-visibility "-fvisibility=default")
add_target_flag_if_avail(rocprofiler-systems-hidden-visibility "-fvisibility=hidden"
"-fvisibility-inlines-hidden")
# ----------------------------------------------------------------------------------------#
@@ -280,7 +290,7 @@ endif()
# ----------------------------------------------------------------------------------------#
# sanitizer
#
set(OMNITRACE_SANITIZER_TYPES
set(ROCPROFSYS_SANITIZER_TYPES
address
memory
thread
@@ -290,76 +300,77 @@ set(OMNITRACE_SANITIZER_TYPES
null
bounds
alignment)
set_property(CACHE OMNITRACE_SANITIZER_TYPE PROPERTY STRINGS
"${OMNITRACE_SANITIZER_TYPES}")
omnitrace_add_interface_library(omnitrace-sanitizer-compile-options
"Adds compiler flags for sanitizers")
omnitrace_add_interface_library(
omnitrace-sanitizer
"Adds compiler flags to enable ${OMNITRACE_SANITIZER_TYPE} sanitizer (-fsanitizer=${OMNITRACE_SANITIZER_TYPE})"
set_property(CACHE ROCPROFSYS_SANITIZER_TYPE PROPERTY STRINGS
"${ROCPROFSYS_SANITIZER_TYPES}")
rocprofiler_systems_add_interface_library(rocprofiler-systems-sanitizer-compile-options
"Adds compiler flags for sanitizers")
rocprofiler_systems_add_interface_library(
rocprofiler-systems-sanitizer
"Adds compiler flags to enable ${ROCPROFSYS_SANITIZER_TYPE} sanitizer (-fsanitizer=${ROCPROFSYS_SANITIZER_TYPE})"
)
set(COMMON_SANITIZER_FLAGS "-fno-optimize-sibling-calls" "-fno-omit-frame-pointer"
"-fno-inline-functions")
add_target_flag(omnitrace-sanitizer-compile-options ${COMMON_SANITIZER_FLAGS})
add_target_flag(rocprofiler-systems-sanitizer-compile-options ${COMMON_SANITIZER_FLAGS})
foreach(_TYPE ${OMNITRACE_SANITIZER_TYPES})
foreach(_TYPE ${ROCPROFSYS_SANITIZER_TYPES})
set(_FLAG "-fsanitize=${_TYPE}")
omnitrace_add_interface_library(
omnitrace-${_TYPE}-sanitizer
rocprofiler_systems_add_interface_library(
rocprofiler-systems-${_TYPE}-sanitizer
"Adds compiler flags to enable ${_TYPE} sanitizer (${_FLAG})")
add_target_flag(omnitrace-${_TYPE}-sanitizer ${_FLAG})
target_link_libraries(omnitrace-${_TYPE}-sanitizer
INTERFACE omnitrace-sanitizer-compile-options)
set_property(TARGET omnitrace-${_TYPE}-sanitizer
add_target_flag(rocprofiler-systems-${_TYPE}-sanitizer ${_FLAG})
target_link_libraries(rocprofiler-systems-${_TYPE}-sanitizer
INTERFACE rocprofiler-systems-sanitizer-compile-options)
set_property(TARGET rocprofiler-systems-${_TYPE}-sanitizer
PROPERTY INTERFACE_LINK_OPTIONS ${_FLAG} ${COMMON_SANITIZER_FLAGS})
endforeach()
unset(_FLAG)
unset(COMMON_SANITIZER_FLAGS)
if(OMNITRACE_USE_SANITIZER)
foreach(_TYPE ${OMNITRACE_SANITIZER_TYPE})
if(TARGET omnitrace-${_TYPE}-sanitizer)
target_link_libraries(omnitrace-sanitizer
INTERFACE omnitrace-${_TYPE}-sanitizer)
if(ROCPROFSYS_USE_SANITIZER)
foreach(_TYPE ${ROCPROFSYS_SANITIZER_TYPE})
if(TARGET rocprofiler-systems-${_TYPE}-sanitizer)
target_link_libraries(rocprofiler-systems-sanitizer
INTERFACE rocprofiler-systems-${_TYPE}-sanitizer)
else()
message(
FATAL_ERROR "Error! Target 'omnitrace-${_TYPE}-sanitizer' does not exist!"
FATAL_ERROR
"Error! Target 'rocprofiler-systems-${_TYPE}-sanitizer' does not exist!"
)
endif()
endforeach()
else()
set(OMNITRACE_USE_SANITIZER OFF)
set(ROCPROFSYS_USE_SANITIZER OFF)
endif()
# ----------------------------------------------------------------------------------------#
# static lib flags
#
target_compile_options(
omnitrace-static-libgcc
rocprofiler-systems-static-libgcc
INTERFACE $<$<COMPILE_LANGUAGE:C>:$<$<C_COMPILER_ID:GNU>:-static-libgcc>>
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU>:-static-libgcc>>)
target_link_options(
omnitrace-static-libgcc INTERFACE
rocprofiler-systems-static-libgcc INTERFACE
$<$<COMPILE_LANGUAGE:C>:$<$<C_COMPILER_ID:GNU,Clang>:-static-libgcc>>
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU,Clang>:-static-libgcc>>)
target_compile_options(
omnitrace-static-libstdcxx
rocprofiler-systems-static-libstdcxx
INTERFACE $<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU>:-static-libstdc++>>)
target_link_options(
omnitrace-static-libstdcxx INTERFACE
rocprofiler-systems-static-libstdcxx INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU,Clang>:-static-libstdc++>>)
if(OMNITRACE_BUILD_STATIC_LIBGCC)
target_link_libraries(omnitrace-static-libgcc-optional
INTERFACE omnitrace-static-libgcc)
if(ROCPROFSYS_BUILD_STATIC_LIBGCC)
target_link_libraries(rocprofiler-systems-static-libgcc-optional
INTERFACE rocprofiler-systems-static-libgcc)
endif()
if(OMNITRACE_BUILD_STATIC_LIBSTDCXX)
target_link_libraries(omnitrace-static-libstdcxx-optional
INTERFACE omnitrace-static-libstdcxx)
if(ROCPROFSYS_BUILD_STATIC_LIBSTDCXX)
target_link_libraries(rocprofiler-systems-static-libstdcxx-optional
INTERFACE rocprofiler-systems-static-libstdcxx)
endif()
# ----------------------------------------------------------------------------------------#
@@ -368,5 +379,5 @@ endif()
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
if(NOT APPLE OR "$ENV{CONDA_PYTHON_EXE}" STREQUAL "")
add_user_flags(omnitrace-compile-options "CXX")
add_user_flags(rocprofiler-systems-compile-options "CXX")
endif()
@@ -30,7 +30,7 @@ if("${LIBNAME}" STREQUAL "")
endif()
if(NOT TARGET ${LIBNAME}-compile-options)
omnitrace_add_interface_library(
rocprofiler_systems_add_interface_library(
${LIBNAME}-compile-options
"Adds the standard set of compiler flags used by timemory")
endif()
@@ -88,12 +88,12 @@ endmacro(set_no_duplicates _VAR)
# ----------------------------------------------------------------------------------------#
# call before running check_{c,cxx}_compiler_flag
# ----------------------------------------------------------------------------------------#
macro(omnitrace_begin_flag_check)
if(OMNITRACE_QUIET_CONFIG)
macro(rocprofiler_systems_begin_flag_check)
if(ROCPROFSYS_QUIET_CONFIG)
if(NOT DEFINED CMAKE_REQUIRED_QUIET)
set(CMAKE_REQUIRED_QUIET OFF)
endif()
omnitrace_save_variables(FLAG_CHECK VARIABLES CMAKE_REQUIRED_QUIET)
rocprofiler_systems_save_variables(FLAG_CHECK VARIABLES CMAKE_REQUIRED_QUIET)
set(CMAKE_REQUIRED_QUIET ON)
endif()
endmacro()
@@ -101,9 +101,9 @@ endmacro()
# ----------------------------------------------------------------------------------------#
# call after running check_{c,cxx}_compiler_flag
# ----------------------------------------------------------------------------------------#
macro(omnitrace_end_flag_check)
if(OMNITRACE_QUIET_CONFIG)
omnitrace_restore_variables(FLAG_CHECK VARIABLES CMAKE_REQUIRED_QUIET)
macro(rocprofiler_systems_end_flag_check)
if(ROCPROFSYS_QUIET_CONFIG)
rocprofiler_systems_restore_variables(FLAG_CHECK VARIABLES CMAKE_REQUIRED_QUIET)
endif()
endmacro()
@@ -125,7 +125,7 @@ macro(ADD_TARGET_C_FLAG _TARG)
endif()
string(REPLACE "-" "_" _MAKE_TARG "${_TARG}")
list(APPEND OMNITRACE_MAKE_TARGETS ${_MAKE_TARG})
list(APPEND ROCPROFSYS_MAKE_TARGETS ${_MAKE_TARG})
target_compile_options(${_TARG} ${_SCOPE} $<$<COMPILE_LANGUAGE:C>:${ARGN}>)
list(APPEND ${_MAKE_TARG}_C_FLAGS ${ARGN})
@@ -159,7 +159,7 @@ endmacro()
# ----------------------------------------------------------------------------------------#
macro(ADD_C_FLAG_IF_AVAIL FLAG)
set(_ENABLE ON)
if(DEFINED OMNITRACE_BUILD_C AND NOT OMNITRACE_BUILD_C)
if(DEFINED ROCPROFSYS_BUILD_C AND NOT ROCPROFSYS_BUILD_C)
set(_ENABLE OFF)
endif()
set(_TARG)
@@ -174,17 +174,17 @@ macro(ADD_C_FLAG_IF_AVAIL FLAG)
string(REPLACE "-" "_" FLAG_NAME "${FLAG_NAME}")
string(REPLACE " " "_" FLAG_NAME "${FLAG_NAME}")
string(REPLACE "=" "_" FLAG_NAME "${FLAG_NAME}")
if(NOT OMNITRACE_BUILD_C)
if(NOT ROCPROFSYS_BUILD_C)
set(${FLAG_NAME} ON)
else()
omnitrace_begin_flag_check()
rocprofiler_systems_begin_flag_check()
check_c_compiler_flag("-Werror" c_werror)
if(c_werror)
check_c_compiler_flag("${FLAG} -Werror" ${FLAG_NAME})
else()
check_c_compiler_flag("${FLAG}" ${FLAG_NAME})
endif()
omnitrace_end_flag_check()
rocprofiler_systems_end_flag_check()
if(${FLAG_NAME})
if("${_LTARG}" STREQUAL "")
list(APPEND ${PROJECT_NAME}_C_FLAGS "${FLAG}")
@@ -227,7 +227,7 @@ macro(ADD_TARGET_CXX_FLAG _TARG)
endif()
string(REPLACE "-" "_" _MAKE_TARG "${_TARG}")
list(APPEND OMNITRACE_MAKE_TARGETS ${_MAKE_TARG})
list(APPEND ROCPROFSYS_MAKE_TARGETS ${_MAKE_TARG})
target_compile_options(${_TARG} ${_SCOPE} $<$<COMPILE_LANGUAGE:CXX>:${ARGN}>)
list(APPEND ${_MAKE_TARG}_CXX_FLAGS ${ARGN})
@@ -282,14 +282,14 @@ macro(ADD_CXX_FLAG_IF_AVAIL FLAG)
string(REPLACE " " "_" FLAG_NAME "${FLAG_NAME}")
string(REPLACE "=" "_" FLAG_NAME "${FLAG_NAME}")
string(REPLACE "/" "_" FLAG_NAME "${FLAG_NAME}")
omnitrace_begin_flag_check()
rocprofiler_systems_begin_flag_check()
check_cxx_compiler_flag("-Werror" cxx_werror)
if(cxx_werror)
check_cxx_compiler_flag("${FLAG} -Werror" ${FLAG_NAME})
else()
check_cxx_compiler_flag("${FLAG}" ${FLAG_NAME})
endif()
omnitrace_end_flag_check()
rocprofiler_systems_end_flag_check()
if(${FLAG_NAME})
if("${_LTARG}" STREQUAL "")
list(APPEND ${PROJECT_NAME}_CXX_FLAGS "${FLAG}")
@@ -362,7 +362,7 @@ endmacro()
# ----------------------------------------------------------------------------------------#
# check flag
# ----------------------------------------------------------------------------------------#
function(OMNITRACE_TARGET_FLAG _TARG_TARGET)
function(ROCPROFILER_SYSTEMS_TARGET_FLAG _TARG_TARGET)
cmake_parse_arguments(_TARG "IF_AVAIL" "MODE" "FLAGS;LANGUAGES" ${ARGN})
if(NOT _TARG_MODE)
@@ -391,14 +391,14 @@ function(OMNITRACE_TARGET_FLAG _TARG_TARGET)
string(REPLACE "-" "_" FLAG_NAME "${FLAG_NAME}")
string(REPLACE " " "_" FLAG_NAME "${FLAG_NAME}")
string(REPLACE "=" "_" FLAG_NAME "${FLAG_NAME}")
omnitrace_begin_flag_check()
rocprofiler_systems_begin_flag_check()
check_c_compiler_flag("-Werror" c_werror)
if(c_werror)
check_c_compiler_flag("${FLAG} -Werror" ${FLAG_NAME})
else()
check_c_compiler_flag("${FLAG}" ${FLAG_NAME})
endif()
omnitrace_end_flag_check()
rocprofiler_systems_end_flag_check()
if(${FLAG_NAME})
target_compile_options(${_TARG_TARGET} ${_TARG_MODE}
$<$<COMPILE_LANGUAGE:${_LANG}>:${_FLAG}>)
@@ -409,14 +409,14 @@ function(OMNITRACE_TARGET_FLAG _TARG_TARGET)
string(REPLACE "-" "_" FLAG_NAME "${FLAG_NAME}")
string(REPLACE " " "_" FLAG_NAME "${FLAG_NAME}")
string(REPLACE "=" "_" FLAG_NAME "${FLAG_NAME}")
omnitrace_begin_flag_check()
rocprofiler_systems_begin_flag_check()
check_cxx_compiler_flag("-Werror" cxx_werror)
if(cxx_werror)
check_cxx_compiler_flag("${FLAG} -Werror" ${FLAG_NAME})
else()
check_cxx_compiler_flag("${FLAG}" ${FLAG_NAME})
endif()
omnitrace_end_flag_check()
rocprofiler_systems_end_flag_check()
if(${FLAG_NAME})
target_compile_options(${_TARG_TARGET} ${_TARG_MODE}
$<$<COMPILE_LANGUAGE:${_LANG}>:${_FLAG}>)
@@ -439,7 +439,7 @@ endfunction()
# ----------------------------------------------------------------------------------------#
macro(ADD_TARGET_CUDA_FLAG _TARG)
string(REPLACE "-" "_" _MAKE_TARG "${_TARG}")
list(APPEND OMNITRACE_MAKE_TARGETS ${_MAKE_TARG})
list(APPEND ROCPROFSYS_MAKE_TARGETS ${_MAKE_TARG})
target_compile_options(${_TARG} INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${ARGN}>)
list(APPEND ${_MAKE_TARG}_CUDA_FLAGS ${ARGN})
@@ -470,9 +470,9 @@ endfunction()
# ----------------------------------------------------------------------------------------#
# add compiler definition
# ----------------------------------------------------------------------------------------#
function(OMNITRACE_TARGET_COMPILE_DEFINITIONS _TARG _VIS)
function(ROCPROFILER_SYSTEMS_TARGET_COMPILE_DEFINITIONS _TARG _VIS)
foreach(_DEF ${ARGN})
if(NOT "${_DEF}" MATCHES "[A-Za-z_]+=.*" AND "${_DEF}" MATCHES "^OMNITRACE_")
if(NOT "${_DEF}" MATCHES "[A-Za-z_]+=.*" AND "${_DEF}" MATCHES "^ROCPROFSYS_")
set(_DEF "${_DEF}=1")
endif()
target_compile_definitions(${_TARG} ${_VIS} $<$<COMPILE_LANGUAGE:CXX>:${_DEF}>)
@@ -1,6 +1,6 @@
# configure packaging
function(omnitrace_parse_release)
function(rocprofiler_systems_parse_release)
if(EXISTS /etc/lsb-release AND NOT IS_DIRECTORY /etc/lsb-release)
file(READ /etc/lsb-release _LSB_RELEASE)
if(_LSB_RELEASE)
@@ -27,7 +27,7 @@ function(omnitrace_parse_release)
endfunction()
# parse either /etc/lsb-release or /etc/os-release
omnitrace_parse_release()
rocprofiler_systems_parse_release()
if(NOT _SYSTEM_NAME)
set(_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
@@ -42,83 +42,83 @@ set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_CONTACT "jonathan.madsen@amd.com")
set(CPACK_PACKAGE_CONTACT "https://github.com/ROCm/rocprofiler-systems")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set(OMNITRACE_CPACK_SYSTEM_NAME
set(ROCPROFSYS_CPACK_SYSTEM_NAME
"${_SYSTEM_NAME}"
CACHE STRING "System name, e.g. Linux or Ubuntu-20.04")
set(OMNITRACE_CPACK_PACKAGE_SUFFIX "")
set(ROCPROFSYS_CPACK_PACKAGE_SUFFIX "")
if(OMNITRACE_USE_HIP
OR OMNITRACE_USE_ROCTRACER
OR OMNITRACE_USE_ROCM_SMI)
set(OMNITRACE_CPACK_PACKAGE_SUFFIX
"${OMNITRACE_CPACK_PACKAGE_SUFFIX}-ROCm-${ROCmVersion_NUMERIC_VERSION}")
if(ROCPROFSYS_USE_HIP
OR ROCPROFSYS_USE_ROCTRACER
OR ROCPROFSYS_USE_ROCM_SMI)
set(ROCPROFSYS_CPACK_PACKAGE_SUFFIX
"${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}-ROCm-${ROCmVersion_NUMERIC_VERSION}")
endif()
if(OMNITRACE_USE_PAPI)
set(OMNITRACE_CPACK_PACKAGE_SUFFIX "${OMNITRACE_CPACK_PACKAGE_SUFFIX}-PAPI")
if(ROCPROFSYS_USE_PAPI)
set(ROCPROFSYS_CPACK_PACKAGE_SUFFIX "${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}-PAPI")
endif()
if(OMNITRACE_USE_OMPT)
set(OMNITRACE_CPACK_PACKAGE_SUFFIX "${OMNITRACE_CPACK_PACKAGE_SUFFIX}-OMPT")
if(ROCPROFSYS_USE_OMPT)
set(ROCPROFSYS_CPACK_PACKAGE_SUFFIX "${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}-OMPT")
endif()
if(OMNITRACE_USE_MPI)
if(ROCPROFSYS_USE_MPI)
set(VALID_MPI_IMPLS "mpich" "openmpi")
if("${MPI_C_COMPILER_INCLUDE_DIRS};${MPI_C_HEADER_DIR}" MATCHES "openmpi")
set(OMNITRACE_MPI_IMPL "openmpi")
set(ROCPROFSYS_MPI_IMPL "openmpi")
elseif("${MPI_C_COMPILER_INCLUDE_DIRS};${MPI_C_HEADER_DIR}" MATCHES "mpich")
set(OMNITRACE_MPI_IMPL "mpich")
set(ROCPROFSYS_MPI_IMPL "mpich")
else()
message(
WARNING
"MPI implementation could not be determined. Please set OMNITRACE_MPI_IMPL to one of the following for CPack: ${VALID_MPI_IMPLS}"
"MPI implementation could not be determined. Please set ROCPROFSYS_MPI_IMPL to one of the following for CPack: ${VALID_MPI_IMPLS}"
)
endif()
if(OMNITRACE_MPI_IMPL AND NOT "${OMNITRACE_MPI_IMPL}" IN_LIST VALID_MPI_IMPLS)
if(ROCPROFSYS_MPI_IMPL AND NOT "${ROCPROFSYS_MPI_IMPL}" IN_LIST VALID_MPI_IMPLS)
message(
SEND_ERROR
"Invalid OMNITRACE_MPI_IMPL (${OMNITRACE_MPI_IMPL}). Should be one of: ${VALID_MPI_IMPLS}"
"Invalid ROCPROFSYS_MPI_IMPL (${ROCPROFSYS_MPI_IMPL}). Should be one of: ${VALID_MPI_IMPLS}"
)
else()
omnitrace_add_feature(OMNITRACE_MPI_IMPL
"MPI implementation for CPack DEBIAN depends")
rocprofiler_systems_add_feature(ROCPROFSYS_MPI_IMPL
"MPI implementation for CPack DEBIAN depends")
endif()
if("${OMNITRACE_MPI_IMPL}" STREQUAL "openmpi")
set(OMNITRACE_MPI_IMPL_UPPER "OpenMPI")
elseif("${OMNITRACE_MPI_IMPL}" STREQUAL "mpich")
set(OMNITRACE_MPI_IMPL_UPPER "MPICH")
if("${ROCPROFSYS_MPI_IMPL}" STREQUAL "openmpi")
set(ROCPROFSYS_MPI_IMPL_UPPER "OpenMPI")
elseif("${ROCPROFSYS_MPI_IMPL}" STREQUAL "mpich")
set(ROCPROFSYS_MPI_IMPL_UPPER "MPICH")
else()
set(OMNITRACE_MPI_IMPL_UPPER "MPI")
set(ROCPROFSYS_MPI_IMPL_UPPER "MPI")
endif()
set(OMNITRACE_CPACK_PACKAGE_SUFFIX
"${OMNITRACE_CPACK_PACKAGE_SUFFIX}-${OMNITRACE_MPI_IMPL_UPPER}")
set(ROCPROFSYS_CPACK_PACKAGE_SUFFIX
"${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}-${ROCPROFSYS_MPI_IMPL_UPPER}")
endif()
if(OMNITRACE_USE_PYTHON)
set(_OMNITRACE_PYTHON_NAME "Python3")
foreach(_VER ${OMNITRACE_PYTHON_VERSIONS})
if(ROCPROFSYS_USE_PYTHON)
set(_ROCPROFSYS_PYTHON_NAME "Python3")
foreach(_VER ${ROCPROFSYS_PYTHON_VERSIONS})
if("${_VER}" VERSION_LESS 3.0.0)
set(_OMNITRACE_PYTHON_NAME "Python")
set(_ROCPROFSYS_PYTHON_NAME "Python")
endif()
endforeach()
set(OMNITRACE_CPACK_PACKAGE_SUFFIX "${OMNITRACE_CPACK_PACKAGE_SUFFIX}-Python3")
set(ROCPROFSYS_CPACK_PACKAGE_SUFFIX "${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}-Python3")
endif()
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${OMNITRACE_VERSION}-${OMNITRACE_CPACK_SYSTEM_NAME}${OMNITRACE_CPACK_PACKAGE_SUFFIX}"
"${CPACK_PACKAGE_NAME}-${ROCPROFSYS_VERSION}-${ROCPROFSYS_CPACK_SYSTEM_NAME}${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}"
)
if(DEFINED ENV{CPACK_PACKAGE_FILE_NAME})
set(CPACK_PACKAGE_FILE_NAME $ENV{CPACK_PACKAGE_FILE_NAME})
endif()
set(OMNITRACE_PACKAGE_FILE_NAME
${CPACK_PACKAGE_NAME}-${OMNITRACE_VERSION}-${OMNITRACE_CPACK_SYSTEM_NAME}${OMNITRACE_CPACK_PACKAGE_SUFFIX}
set(ROCPROFSYS_PACKAGE_FILE_NAME
${CPACK_PACKAGE_NAME}-${ROCPROFSYS_VERSION}-${ROCPROFSYS_CPACK_SYSTEM_NAME}${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}
)
omnitrace_add_feature(OMNITRACE_PACKAGE_FILE_NAME "CPack filename")
rocprofiler_systems_add_feature(ROCPROFSYS_PACKAGE_FILE_NAME "CPack filename")
# -------------------------------------------------------------------------------------- #
#
@@ -126,9 +126,9 @@ omnitrace_add_feature(OMNITRACE_PACKAGE_FILE_NAME "CPack filename")
#
# -------------------------------------------------------------------------------------- #
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/ROCm/omnitrace")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/ROCm/rocprofiler-systems")
set(CPACK_DEBIAN_PACKAGE_RELEASE
"${OMNITRACE_CPACK_SYSTEM_NAME}${OMNITRACE_CPACK_PACKAGE_SUFFIX}")
"${ROCPROFSYS_CPACK_SYSTEM_NAME}${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}")
string(REGEX REPLACE "([a-zA-Z])-([0-9])" "\\1\\2" CPACK_DEBIAN_PACKAGE_RELEASE
"${CPACK_DEBIAN_PACKAGE_RELEASE}")
string(REPLACE "-" "~" CPACK_DEBIAN_PACKAGE_RELEASE "${CPACK_DEBIAN_PACKAGE_RELEASE}")
@@ -137,10 +137,10 @@ set(_DEBIAN_PACKAGE_DEPENDS "")
if(DYNINST_USE_OpenMP)
list(APPEND _DEBIAN_PACKAGE_DEPENDS libgomp1)
endif()
if(OMNITRACE_USE_PAPI AND NOT OMNITRACE_BUILD_PAPI)
if(ROCPROFSYS_USE_PAPI AND NOT ROCPROFSYS_BUILD_PAPI)
list(APPEND _DEBIAN_PACKAGE_DEPENDS libpapi-dev libpfm4)
endif()
if(NOT OMNITRACE_BUILD_DYNINST)
if(NOT ROCPROFSYS_BUILD_DYNINST)
if(NOT DYNINST_BUILD_BOOST)
foreach(_BOOST_COMPONENT atomic system thread date-time filesystem timer)
list(APPEND _DEBIAN_PACKAGE_DEPENDS
@@ -160,19 +160,19 @@ if(ROCmVersion_FOUND)
set(_ROCM_SMI_SUFFIX
" (>= ${ROCmVersion_MAJOR_VERSION}.0.0.${ROCmVersion_NUMERIC_VERSION})")
endif()
if(OMNITRACE_USE_ROCM_SMI)
if(ROCPROFSYS_USE_ROCM_SMI)
list(APPEND _DEBIAN_PACKAGE_DEPENDS "rocm-smi-lib${_ROCM_SMI_SUFFIX}")
endif()
if(OMNITRACE_USE_ROCTRACER)
if(ROCPROFSYS_USE_ROCTRACER)
list(APPEND _DEBIAN_PACKAGE_DEPENDS "roctracer-dev${_ROCTRACER_SUFFIX}")
endif()
if(OMNITRACE_USE_ROCPROFILER)
if(ROCPROFSYS_USE_ROCPROFILER)
list(APPEND _DEBIAN_PACKAGE_DEPENDS "rocprofiler-dev${_ROCPROFILER_SUFFIX}")
endif()
if(OMNITRACE_USE_MPI)
if("${OMNITRACE_MPI_IMPL}" STREQUAL "openmpi")
if(ROCPROFSYS_USE_MPI)
if("${ROCPROFSYS_MPI_IMPL}" STREQUAL "openmpi")
list(APPEND _DEBIAN_PACKAGE_DEPENDS "libopenmpi-dev")
elseif("${OMNITRACE_MPI_IMPL}" STREQUAL "mpich")
elseif("${ROCPROFSYS_MPI_IMPL}" STREQUAL "mpich")
list(APPEND _DEBIAN_PACKAGE_DEPENDS "libmpich-dev")
endif()
endif()
@@ -195,14 +195,14 @@ if(DEFINED CPACK_PACKAGING_INSTALL_PREFIX)
endif()
set(CPACK_RPM_PACKAGE_RELEASE
"${OMNITRACE_CPACK_SYSTEM_NAME}${OMNITRACE_CPACK_PACKAGE_SUFFIX}")
"${ROCPROFSYS_CPACK_SYSTEM_NAME}${ROCPROFSYS_CPACK_PACKAGE_SUFFIX}")
string(REGEX REPLACE "([a-zA-Z])-([0-9])" "\\1\\2" CPACK_RPM_PACKAGE_RELEASE
"${CPACK_RPM_PACKAGE_RELEASE}")
string(REPLACE "-" "~" CPACK_RPM_PACKAGE_RELEASE "${CPACK_RPM_PACKAGE_RELEASE}")
set(_RPM_PACKAGE_PROVIDES "")
if(OMNITRACE_BUILD_LIBUNWIND)
if(ROCPROFSYS_BUILD_LIBUNWIND)
list(APPEND _RPM_PACKAGE_PROVIDES "libunwind.so.99()(64bit)")
list(APPEND _RPM_PACKAGE_PROVIDES "libunwind-x86_64.so.99()(64bit)")
list(APPEND _RPM_PACKAGE_PROVIDES "libunwind-setjmp.so.0()(64bit)")
@@ -241,22 +241,25 @@ if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE})
set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE})
endif()
omnitrace_add_feature(CPACK_PACKAGE_NAME "Package name")
omnitrace_add_feature(CPACK_PACKAGE_VERSION "Package version")
omnitrace_add_feature(CPACK_PACKAGING_INSTALL_PREFIX "Package installation prefix")
rocprofiler_systems_add_feature(CPACK_PACKAGE_NAME "Package name")
rocprofiler_systems_add_feature(CPACK_PACKAGE_VERSION "Package version")
rocprofiler_systems_add_feature(CPACK_PACKAGING_INSTALL_PREFIX
"Package installation prefix")
omnitrace_add_feature(CPACK_DEBIAN_FILE_NAME "Debian file name")
omnitrace_add_feature(CPACK_DEBIAN_PACKAGE_RELEASE "Debian package release version")
omnitrace_add_feature(CPACK_DEBIAN_PACKAGE_DEPENDS "Debian package dependencies")
omnitrace_add_feature(CPACK_DEBIAN_PACKAGE_SHLIBDEPS
"Debian package shared library dependencies")
rocprofiler_systems_add_feature(CPACK_DEBIAN_FILE_NAME "Debian file name")
rocprofiler_systems_add_feature(CPACK_DEBIAN_PACKAGE_RELEASE
"Debian package release version")
rocprofiler_systems_add_feature(CPACK_DEBIAN_PACKAGE_DEPENDS
"Debian package dependencies")
rocprofiler_systems_add_feature(CPACK_DEBIAN_PACKAGE_SHLIBDEPS
"Debian package shared library dependencies")
omnitrace_add_feature(CPACK_RPM_FILE_NAME "RPM file name")
omnitrace_add_feature(CPACK_RPM_PACKAGE_RELEASE "RPM package release version")
omnitrace_add_feature(CPACK_RPM_PACKAGE_REQUIRES "RPM package dependencies")
omnitrace_add_feature(CPACK_RPM_PACKAGE_AUTOREQPROV
"RPM package auto generate requires and provides")
omnitrace_add_feature(CPACK_RPM_PACKAGE_REQUIRES "RPM package requires")
omnitrace_add_feature(CPACK_RPM_PACKAGE_PROVIDES "RPM package provides")
rocprofiler_systems_add_feature(CPACK_RPM_FILE_NAME "RPM file name")
rocprofiler_systems_add_feature(CPACK_RPM_PACKAGE_RELEASE "RPM package release version")
rocprofiler_systems_add_feature(CPACK_RPM_PACKAGE_REQUIRES "RPM package dependencies")
rocprofiler_systems_add_feature(CPACK_RPM_PACKAGE_AUTOREQPROV
"RPM package auto generate requires and provides")
rocprofiler_systems_add_feature(CPACK_RPM_PACKAGE_REQUIRES "RPM package requires")
rocprofiler_systems_add_feature(CPACK_RPM_PACKAGE_PROVIDES "RPM package provides")
include(CPack)
@@ -6,10 +6,10 @@ include(CMakePackageConfigHelpers)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME config)
install(
EXPORT omnitrace-library-targets
FILE omnitrace-library-targets.cmake
NAMESPACE omnitrace::
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/omnitrace)
EXPORT rocprofiler-systems-library-targets
FILE ${PROJECT_NAME}-library-targets.cmake
NAMESPACE rocprofiler-systems::
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME})
# ------------------------------------------------------------------------------#
# install tree
@@ -20,9 +20,9 @@ set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
set(PROJECT_BUILD_TARGETS user)
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/Templates/${PROJECT_NAME}-config.cmake.in
${PROJECT_SOURCE_DIR}/cmake/Templates/rocprof-sys-config.cmake.in
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/omnitrace
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}
INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
PATH_VARS PROJECT_INSTALL_DIR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR)
@@ -45,16 +45,16 @@ export(PACKAGE ${PROJECT_NAME})
#
configure_file(
${PROJECT_SOURCE_DIR}/tests/validate-causal-json.py
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/omnitrace-causal-print COPYONLY)
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/rocprof-sys-causal-print COPYONLY)
install(PROGRAMS ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/omnitrace-causal-print
install(PROGRAMS ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/rocprof-sys-causal-print
DESTINATION ${CMAKE_INSTALL_BINDIR})
# ------------------------------------------------------------------------------#
# build tree
#
set(_BUILDTREE_EXPORT_DIR
"${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/omnitrace")
"${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}")
if(NOT EXISTS "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
@@ -64,15 +64,15 @@ if(NOT EXISTS "${_BUILDTREE_EXPORT_DIR}")
file(MAKE_DIRECTORY "${_BUILDTREE_EXPORT_DIR}")
endif()
if(NOT EXISTS "${_BUILDTREE_EXPORT_DIR}/omnitrace-library-targets.cmake")
file(TOUCH "${_BUILDTREE_EXPORT_DIR}/omnitrace-library-targets.cmake")
if(NOT EXISTS "${_BUILDTREE_EXPORT_DIR}/${PROJECT_NAME}-library-targets.cmake")
file(TOUCH "${_BUILDTREE_EXPORT_DIR}/${PROJECT_NAME}-library-targets.cmake")
endif()
export(
EXPORT omnitrace-library-targets
NAMESPACE omnitrace::
FILE "${_BUILDTREE_EXPORT_DIR}/omnitrace-library-targets.cmake")
EXPORT ${PROJECT_NAME}-library-targets
NAMESPACE rocprofiler-systems::
FILE "${_BUILDTREE_EXPORT_DIR}/${PROJECT_NAME}-library-targets.cmake")
set(omnitrace_DIR
set(${PROJECT_NAME}_DIR
"${_BUILDTREE_EXPORT_DIR}"
CACHE PATH "omnitrace" FORCE)
CACHE PATH "${PROJECT_NAME}" FORCE)
@@ -1,7 +1,7 @@
# ======================================================================================
# elfutils.cmake
#
# Configure elfutils for omnitrace
# Configure elfutils for rocprofiler-systems
#
# ----------------------------------------
#
@@ -38,7 +38,7 @@ set(ElfUtils_MIN_VERSION
CACHE STRING "Minimum acceptable elfutils version")
if(${ElfUtils_MIN_VERSION} VERSION_LESS ${_min_version})
omnitrace_message(
rocprofiler_systems_message(
FATAL_ERROR
"Requested version ${ElfUtils_MIN_VERSION} is less than minimum supported version (${_min_version})"
)
@@ -51,7 +51,7 @@ set(ElfUtils_DOWNLOAD_VERSION
# make sure we are not downloading a version less than minimum
if(${ElfUtils_DOWNLOAD_VERSION} VERSION_LESS ${ElfUtils_MIN_VERSION})
omnitrace_message(
rocprofiler_systems_message(
FATAL_ERROR
"elfutils download version is set to ${ElfUtils_DOWNLOAD_VERSION} but elfutils minimum version is set to ${ElfUtils_MIN_VERSION}"
)
@@ -85,7 +85,7 @@ find_program(
PATH_SUFFIXES bin)
if(NOT ElfUtils_C_COMPILER OR NOT ElfUtils_CXX_COMPILER)
omnitrace_message(
rocprofiler_systems_message(
FATAL_ERROR
"ElfUtils requires the GNU C and C++ compilers. ElfUtils_C_COMPILER: ${ElfUtils_C_COMPILER}, ElfUtils_CXX_COMPILER: ${ElfUtils_CXX_COMPILER}"
)
@@ -100,7 +100,7 @@ set(_eu_build_byproducts "${_eu_root}/lib/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${_eu_root}/lib/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}")
externalproject_add(
omnitrace-elfutils-build
rocprofiler-systems-elfutils-build
PREFIX ${PROJECT_BINARY_DIR}/external/elfutils
URL ${ElfUtils_DOWNLOAD_URL}
"https://sourceware.org/elfutils/ftp/${ElfUtils_DOWNLOAD_VERSION}/elfutils-${ElfUtils_DOWNLOAD_VERSION}.tar.bz2"
@@ -119,7 +119,7 @@ externalproject_add(
# target for re-executing the installation
add_custom_target(
omnitrace-elfutils-install
rocprofiler-systems-elfutils-install
COMMAND ${MAKE_COMMAND} install -s
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external/elfutils/src/ElfUtils-External
COMMENT "Installing ElfUtils...")
@@ -7,14 +7,14 @@ include_guard(DIRECTORY)
# ----------------------------------------------------------------------------------------#
# clang-tidy
macro(OMNITRACE_ACTIVATE_CLANG_TIDY)
if(OMNITRACE_USE_CLANG_TIDY)
macro(ROCPROFILER_SYSTEMS_ACTIVATE_CLANG_TIDY)
if(ROCPROFSYS_USE_CLANG_TIDY)
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
omnitrace_add_feature(CLANG_TIDY_COMMAND "Path to clang-tidy command")
rocprofiler_systems_add_feature(CLANG_TIDY_COMMAND "Path to clang-tidy command")
if(NOT CLANG_TIDY_COMMAND)
timemory_message(
WARNING "OMNITRACE_USE_CLANG_TIDY is ON but clang-tidy is not found!")
set(OMNITRACE_USE_CLANG_TIDY OFF)
WARNING "ROCPROFSYS_USE_CLANG_TIDY is ON but clang-tidy is not found!")
set(ROCPROFSYS_USE_CLANG_TIDY OFF)
else()
set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_COMMAND})
@@ -37,13 +37,13 @@ endmacro()
#
# ------------------------------------------------------------------------------#
find_program(OMNITRACE_CLANG_FORMAT_EXE NAMES clang-format-11 clang-format-mp-11
clang-format)
find_program(ROCPROFSYS_CLANG_FORMAT_EXE NAMES clang-format-11 clang-format-mp-11
clang-format)
find_program(OMNITRACE_CMAKE_FORMAT_EXE NAMES cmake-format)
find_program(OMNITRACE_BLACK_FORMAT_EXE NAMES black)
find_program(ROCPROFSYS_CMAKE_FORMAT_EXE NAMES cmake-format)
find_program(ROCPROFSYS_BLACK_FORMAT_EXE NAMES black)
add_custom_target(format-omnitrace)
add_custom_target(format-rocprofiler-systems)
if(NOT TARGET format)
add_custom_target(format)
endif()
@@ -53,9 +53,9 @@ foreach(_TYPE source python cmake)
endif()
endforeach()
if(OMNITRACE_CLANG_FORMAT_EXE
OR OMNITRACE_BLACK_FORMAT_EXE
OR OMNITRACE_CMAKE_FORMAT_EXE)
if(ROCPROFSYS_CLANG_FORMAT_EXE
OR ROCPROFSYS_BLACK_FORMAT_EXE
OR ROCPROFSYS_CMAKE_FORMAT_EXE)
file(GLOB_RECURSE sources ${PROJECT_SOURCE_DIR}/source/*.cpp
${PROJECT_SOURCE_DIR}/source/*.c)
file(GLOB_RECURSE headers ${PROJECT_SOURCE_DIR}/source/*.hpp
@@ -84,30 +84,34 @@ if(OMNITRACE_CLANG_FORMAT_EXE
list(REMOVE_ITEM cmake_files ${external})
endif()
if(OMNITRACE_CLANG_FORMAT_EXE)
if(ROCPROFSYS_CLANG_FORMAT_EXE)
add_custom_target(
format-omnitrace-source
${OMNITRACE_CLANG_FORMAT_EXE} -i ${sources} ${headers} ${examples}
format-rocprofiler-systems-source
${ROCPROFSYS_CLANG_FORMAT_EXE} -i ${sources} ${headers} ${examples}
${tests_source}
COMMENT "[omnitrace] Running C++ formatter ${OMNITRACE_CLANG_FORMAT_EXE}...")
COMMENT
"[rocprofiler-systems] Running C++ formatter ${ROCPROFSYS_CLANG_FORMAT_EXE}..."
)
endif()
if(OMNITRACE_BLACK_FORMAT_EXE)
if(ROCPROFSYS_BLACK_FORMAT_EXE)
add_custom_target(
format-omnitrace-python
${OMNITRACE_BLACK_FORMAT_EXE} -q ${PROJECT_SOURCE_DIR}
format-rocprofiler-systems-python
${ROCPROFSYS_BLACK_FORMAT_EXE} -q ${PROJECT_SOURCE_DIR}
COMMENT
"[omnitrace] Running Python formatter ${OMNITRACE_BLACK_FORMAT_EXE}...")
"[rocprofiler-systems] Running Python formatter ${ROCPROFSYS_BLACK_FORMAT_EXE}..."
)
if(NOT TARGET format-python)
add_custom_target(format-python)
endif()
endif()
if(OMNITRACE_CMAKE_FORMAT_EXE)
if(ROCPROFSYS_CMAKE_FORMAT_EXE)
add_custom_target(
format-omnitrace-cmake
${OMNITRACE_CMAKE_FORMAT_EXE} -i ${cmake_files}
COMMENT "[omnitrace] Running CMake formatter ${OMNITRACE_CMAKE_FORMAT_EXE}..."
format-rocprofiler-systems-cmake
${ROCPROFSYS_CMAKE_FORMAT_EXE} -i ${cmake_files}
COMMENT
"[rocprofiler-systems] Running CMake formatter ${ROCPROFSYS_CMAKE_FORMAT_EXE}..."
)
if(NOT TARGET format-cmake)
add_custom_target(format-cmake)
@@ -115,15 +119,16 @@ if(OMNITRACE_CLANG_FORMAT_EXE
endif()
foreach(_TYPE source python cmake)
if(TARGET format-omnitrace-${_TYPE})
add_dependencies(format-omnitrace format-omnitrace-${_TYPE})
add_dependencies(format-${_TYPE} format-omnitrace-${_TYPE})
if(TARGET format-rocprofiler-systems-${_TYPE})
add_dependencies(format-rocprofiler-systems
format-rocprofiler-systems-${_TYPE})
add_dependencies(format-${_TYPE} format-rocprofiler-systems-${_TYPE})
endif()
endforeach()
foreach(_TYPE source python)
if(TARGET format-omnitrace-${_TYPE})
add_dependencies(format format-omnitrace-${_TYPE})
if(TARGET format-rocprofiler-systems-${_TYPE})
add_dependencies(format format-rocprofiler-systems-${_TYPE})
endif()
endforeach()
else()
@@ -12,19 +12,19 @@ include(CMakeDependentOption)
include(CMakeParseArguments)
# -----------------------------------------------------------------------
# message which handles OMNITRACE_QUIET_CONFIG settings
# message which handles ROCPROFSYS_QUIET_CONFIG settings
# -----------------------------------------------------------------------
#
function(OMNITRACE_MESSAGE TYPE)
if(NOT OMNITRACE_QUIET_CONFIG)
message(${TYPE} "[omnitrace] ${ARGN}")
function(ROCPROFILER_SYSTEMS_MESSAGE TYPE)
if(NOT ROCPROFSYS_QUIET_CONFIG)
message(${TYPE} "[rocprofiler-systems] ${ARGN}")
endif()
endfunction()
# -----------------------------------------------------------------------
# Save a set of variables with the given prefix
# -----------------------------------------------------------------------
macro(OMNITRACE_SAVE_VARIABLES _PREFIX)
macro(ROCPROFILER_SYSTEMS_SAVE_VARIABLES _PREFIX)
# parse args
cmake_parse_arguments(
SAVE
@@ -58,7 +58,7 @@ endmacro()
# -----------------------------------------------------------------------
# Restore a set of variables with the given prefix
# -----------------------------------------------------------------------
macro(OMNITRACE_RESTORE_VARIABLES _PREFIX)
macro(ROCPROFILER_SYSTEMS_RESTORE_VARIABLES _PREFIX)
# parse args
cmake_parse_arguments(
RESTORE
@@ -92,10 +92,10 @@ macro(OMNITRACE_RESTORE_VARIABLES _PREFIX)
endmacro()
# -----------------------------------------------------------------------
# function - omnitrace_capitalize - make a string capitalized (first letter is capital)
# usage: capitalize("SHARED" CShared) message(STATUS "-- CShared is \"${CShared}\"") $ --
# CShared is "Shared"
function(OMNITRACE_CAPITALIZE str var)
# function - rocprofiler_systems_capitalize - make a string capitalized (first letter is
# capital) usage: capitalize("SHARED" CShared) message(STATUS "-- CShared is
# \"${CShared}\"") $ -- CShared is "Shared"
function(ROCPROFILER_SYSTEMS_CAPITALIZE str var)
# make string lower
string(TOLOWER "${str}" str)
string(SUBSTRING "${str}" 0 1 _first)
@@ -108,11 +108,11 @@ function(OMNITRACE_CAPITALIZE str var)
endfunction()
# ------------------------------------------------------------------------------#
# function omnitrace_strip_target(<TARGET> [FORCE] [EXPLICIT])
# function rocprofiler_systems_strip_target(<TARGET> [FORCE] [EXPLICIT])
#
# Creates a post-build command which strips a binary. FORCE flag will override
#
function(OMNITRACE_STRIP_TARGET)
function(ROCPROFILER_SYSTEMS_STRIP_TARGET)
cmake_parse_arguments(STRIP "FORCE;EXPLICIT" "" "ARGS" ${ARGN})
list(LENGTH STRIP_UNPARSED_ARGUMENTS NUM_UNPARSED)
@@ -120,17 +120,18 @@ function(OMNITRACE_STRIP_TARGET)
if(NUM_UNPARSED EQUAL 1)
set(_TARGET "${STRIP_UNPARSED_ARGUMENTS}")
else()
omnitrace_message(FATAL_ERROR
"omnitrace_strip_target cannot deduce target from \"${ARGN}\"")
rocprofiler_systems_message(
FATAL_ERROR
"rocprofiler_systems_strip_target cannot deduce target from \"${ARGN}\"")
endif()
if(NOT TARGET "${_TARGET}")
omnitrace_message(
rocprofiler_systems_message(
FATAL_ERROR
"omnitrace_strip_target not provided valid target: \"${_TARGET}\"")
"rocprofiler_systems_strip_target not provided valid target: \"${_TARGET}\"")
endif()
if(CMAKE_STRIP AND (STRIP_FORCE OR OMNITRACE_STRIP_LIBRARIES))
if(CMAKE_STRIP AND (STRIP_FORCE OR ROCPROFSYS_STRIP_LIBRARIES))
if(STRIP_EXPLICIT)
add_custom_command(
TARGET ${_TARGET}
@@ -143,16 +144,16 @@ function(OMNITRACE_STRIP_TARGET)
TARGET ${_TARGET}
POST_BUILD
COMMAND
${CMAKE_STRIP} -w --keep-symbol="omnitrace_init"
--keep-symbol="omnitrace_finalize"
--keep-symbol="omnitrace_push_trace"
--keep-symbol="omnitrace_pop_trace"
--keep-symbol="omnitrace_push_region"
--keep-symbol="omnitrace_pop_region" --keep-symbol="omnitrace_set_env"
--keep-symbol="omnitrace_set_mpi"
--keep-symbol="omnitrace_reset_preload"
--keep-symbol="omnitrace_set_instrumented"
--keep-symbol="omnitrace_user_*" --keep-symbol="ompt_start_tool"
${CMAKE_STRIP} -w --keep-symbol="rocprofsys_init"
--keep-symbol="rocprofsys_finalize"
--keep-symbol="rocprofsys_push_trace"
--keep-symbol="rocprofsys_pop_trace"
--keep-symbol="rocprofsys_push_region"
--keep-symbol="rocprofsys_pop_region"
--keep-symbol="rocprofsys_set_env" --keep-symbol="rocprofsys_set_mpi"
--keep-symbol="rocprofsys_reset_preload"
--keep-symbol="rocprofsys_set_instrumented"
--keep-symbol="rocprofsys_user_*" --keep-symbol="ompt_start_tool"
--keep-symbol="kokkosp_*" --keep-symbol="OnLoad"
--keep-symbol="OnUnload" --keep-symbol="OnLoadToolProp"
--keep-symbol="OnUnloadTool" --keep-symbol="__libc_start_main"
@@ -164,22 +165,17 @@ function(OMNITRACE_STRIP_TARGET)
endfunction()
# ------------------------------------------------------------------------------#
# function add_omnitrace_test_target()
# function add_rocprofiler_systems_test_target()
#
# Creates a target which runs ctest but depends on all the tests being built.
#
function(ADD_OMNITRACE_TEST_TARGET)
if(NOT TARGET omnitrace-test)
add_custom_target(
omnitrace-test
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} --target test
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Running tests...")
endif()
endfunction()
# function(ADD_ROCPROFSYS_TEST_TARGET) if(NOT TARGET rocprofiler-systems-test)
# add_custom_target( rocprofiler-systems-test COMMAND ${CMAKE_COMMAND} --build
# ${PROJECT_BINARY_DIR} --target test WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT
# "Running tests...") endif() endfunction()
# ----------------------------------------------------------------------------------------#
# macro omnitrace_checkout_git_submodule()
# macro rocprofiler_systems_checkout_git_submodule()
#
# Run "git submodule update" if a file in a submodule does not exist
#
@@ -188,7 +184,7 @@ endfunction()
# value) -- (default: PROJECT_SOURCE_DIR) TEST_FILE (one value) -- file to check for
# (default: CMakeLists.txt) ADDITIONAL_CMDS (many value) -- any addition commands to pass
#
function(OMNITRACE_CHECKOUT_GIT_SUBMODULE)
function(ROCPROFILER_SYSTEMS_CHECKOUT_GIT_SUBMODULE)
# parse args
cmake_parse_arguments(
CHECKOUT "RECURSIVE"
@@ -257,7 +253,7 @@ function(OMNITRACE_CHECKOUT_GIT_SUBMODULE)
if(RET GREATER 0)
set(_CMD "${GIT_EXECUTABLE} submodule update --init ${_RECURSE}
${CHECKOUT_ADDITIONAL_CMDS} ${CHECKOUT_RELATIVE_PATH}")
message(STATUS "function(omnitrace_checkout_git_submodule) failed.")
message(STATUS "function(rocprofiler_systems_checkout_git_submodule) failed.")
message(FATAL_ERROR "Command: \"${_CMD}\"")
else()
set(_TEST_FILE_EXISTS ON)
@@ -297,7 +293,7 @@ function(OMNITRACE_CHECKOUT_GIT_SUBMODULE)
"${GIT_EXECUTABLE} clone -b ${CHECKOUT_REPO_BRANCH}
${CHECKOUT_ADDITIONAL_CMDS} ${CHECKOUT_REPO_URL} ${CHECKOUT_RELATIVE_PATH}"
)
message(STATUS "function(omnitrace_checkout_git_submodule) failed.")
message(STATUS "function(rocprofiler_systems_checkout_git_submodule) failed.")
message(FATAL_ERROR "Command: \"${_CMD}\"")
else()
set(_TEST_FILE_EXISTS ON)
@@ -315,10 +311,10 @@ endfunction()
# ----------------------------------------------------------------------------------------#
# try to find a package quietly
#
function(OMNITRACE_TEST_FIND_PACKAGE PACKAGE_NAME OUTPUT_VAR)
function(ROCPROFILER_SYSTEMS_TEST_FIND_PACKAGE PACKAGE_NAME OUTPUT_VAR)
cmake_parse_arguments(PACKAGE "" "" "UNSET" ${ARGN})
find_package(${PACKAGE_NAME} QUIET ${PACKAGE_UNPARSED_ARGUMENTS})
if(NOT ${PACKAGE_NAME}_FOUND)
find_package(${PROJECT_NAME} QUIET ${PACKAGE_UNPARSED_ARGUMENTS})
if(NOT ${PROJECT_NAME}_FOUND)
set(${OUTPUT_VAR}
OFF
PARENT_SCOPE)
@@ -327,7 +323,7 @@ function(OMNITRACE_TEST_FIND_PACKAGE PACKAGE_NAME OUTPUT_VAR)
ON
PARENT_SCOPE)
endif()
foreach(_ARG ${PACKAGE_UNSET} FIND_PACKAGE_MESSAGE_DETAILS_${PACKAGE_NAME})
foreach(_ARG ${PACKAGE_UNSET} FIND_PACKAGE_MESSAGE_DETAILS_${PROJECT_NAME})
unset(${_ARG} CACHE)
endforeach()
endfunction()
@@ -335,7 +331,7 @@ endfunction()
# ----------------------------------------------------------------------------------------#
# macro to add an interface lib
#
macro(OMNITRACE_ADD_INTERFACE_LIBRARY _TARGET)
macro(ROCPROFILER_SYSTEMS_ADD_INTERFACE_LIBRARY _TARGET)
add_library(${_TARGET} INTERFACE)
add_library(${PROJECT_NAME}::${_TARGET} ALIAS ${_TARGET})
install(
@@ -355,7 +351,7 @@ endmacro()
# specified by the existence of the variable <NAME>, to the list of enabled/disabled
# features, plus a docstring describing the feature
#
function(OMNITRACE_ADD_FEATURE _var _description)
function(ROCPROFILER_SYSTEMS_ADD_FEATURE _var _description)
set(EXTRA_DESC "")
foreach(currentArg ${ARGN})
if(NOT "${currentArg}" STREQUAL "${_var}"
@@ -372,12 +368,12 @@ function(OMNITRACE_ADD_FEATURE _var _description)
if("CMAKE_DEFINE" IN_LIST ARGN)
set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_CMAKE_DEFINES
"${_var} @${_var}@")
if(OMNITRACE_BUILD_DOCS)
if(ROCPROFSYS_BUILD_DOCS)
set_property(
GLOBAL APPEND PROPERTY ${PROJECT_NAME}_CMAKE_OPTIONS_DOC
"${_var}` | ${_description}${EXTRA_DESC} |")
endif()
elseif("DOC" IN_LIST ARGN AND OMNITRACE_BUILD_DOCS)
elseif("DOC" IN_LIST ARGN AND ROCPROFSYS_BUILD_DOCS)
set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_CMAKE_OPTIONS_DOC
"${_var}` | ${_description}${EXTRA_DESC} |")
endif()
@@ -387,13 +383,13 @@ endfunction()
# function add_option(<OPTION_NAME> <DOCSRING> <DEFAULT_SETTING> [NO_FEATURE]) Add an
# option and add as a feature if NO_FEATURE is not provided
#
function(OMNITRACE_ADD_OPTION _NAME _MESSAGE _DEFAULT)
function(ROCPROFILER_SYSTEMS_ADD_OPTION _NAME _MESSAGE _DEFAULT)
option(${_NAME} "${_MESSAGE}" ${_DEFAULT})
if("NO_FEATURE" IN_LIST ARGN)
mark_as_advanced(${_NAME})
else()
omnitrace_add_feature(${_NAME} "${_MESSAGE}")
if(OMNITRACE_BUILD_DOCS)
rocprofiler_systems_add_feature(${_NAME} "${_MESSAGE}")
if(ROCPROFSYS_BUILD_DOCS)
set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_CMAKE_OPTIONS_DOC
"${_NAME}` | ${_MESSAGE} |")
endif()
@@ -407,10 +403,10 @@ function(OMNITRACE_ADD_OPTION _NAME _MESSAGE _DEFAULT)
endfunction()
# ----------------------------------------------------------------------------------------#
# function omnitrace_add_cache_option(<OPTION_NAME> <DOCSRING> <TYPE> <DEFAULT_VALUE>
# [NO_FEATURE] [ADVANCED] [CMAKE_DEFINE])
# function rocprofiler_systems_add_cache_option(<OPTION_NAME> <DOCSRING> <TYPE>
# <DEFAULT_VALUE> [NO_FEATURE] [ADVANCED] [CMAKE_DEFINE])
#
function(OMNITRACE_ADD_CACHE_OPTION _NAME _MESSAGE _TYPE _DEFAULT)
function(ROCPROFILER_SYSTEMS_ADD_CACHE_OPTION _NAME _MESSAGE _TYPE _DEFAULT)
set(_FORCE)
if("FORCE" IN_LIST ARGN)
set(_FORCE FORCE)
@@ -423,9 +419,9 @@ function(OMNITRACE_ADD_CACHE_OPTION _NAME _MESSAGE _TYPE _DEFAULT)
if("NO_FEATURE" IN_LIST ARGN)
mark_as_advanced(${_NAME})
else()
omnitrace_add_feature(${_NAME} "${_MESSAGE}")
rocprofiler_systems_add_feature(${_NAME} "${_MESSAGE}")
if(OMNITRACE_BUILD_DOCS)
if(ROCPROFSYS_BUILD_DOCS)
set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_CMAKE_OPTIONS_DOC
"${_NAME}` | ${_MESSAGE} |")
endif()
@@ -441,9 +437,9 @@ function(OMNITRACE_ADD_CACHE_OPTION _NAME _MESSAGE _TYPE _DEFAULT)
endfunction()
# ----------------------------------------------------------------------------------------#
# function omnitrace_report_feature_changes() :: print changes in features
# function rocprofiler_systems_report_feature_changes() :: print changes in features
#
function(OMNITRACE_REPORT_FEATURE_CHANGES)
function(ROCPROFILER_SYSTEMS_REPORT_FEATURE_CHANGES)
get_property(_features GLOBAL PROPERTY ${PROJECT_NAME}_FEATURES)
if(NOT "${_features}" STREQUAL "")
list(REMOVE_DUPLICATES _features)
@@ -451,9 +447,9 @@ function(OMNITRACE_REPORT_FEATURE_CHANGES)
endif()
foreach(_feature ${_features})
if("${ARGN}" STREQUAL "")
omnitrace_watch_for_change(${_feature})
rocprofiler_systems_watch_for_change(${_feature})
elseif("${_feature}" IN_LIST ARGN)
omnitrace_watch_for_change(${_feature})
rocprofiler_systems_watch_for_change(${_feature})
endif()
endforeach()
endfunction()
@@ -461,7 +457,7 @@ endfunction()
# ----------------------------------------------------------------------------------------#
# function print_enabled_features() Print enabled features plus their docstrings.
#
function(OMNITRACE_PRINT_ENABLED_FEATURES)
function(ROCPROFILER_SYSTEMS_PRINT_ENABLED_FEATURES)
set(_basemsg "The following features are defined/enabled (+):")
set(_currentFeatureText "${_basemsg}")
get_property(_features GLOBAL PROPERTY ${PROJECT_NAME}_FEATURES)
@@ -485,7 +481,7 @@ function(OMNITRACE_PRINT_ENABLED_FEATURES)
string(REGEX REPLACE "^${PROJECT_NAME}_USE_" "" _feature_tmp
"${_feature}")
string(TOLOWER "${_feature_tmp}" _feature_tmp_l)
omnitrace_capitalize("${_feature_tmp}" _feature_tmp_c)
rocprofiler_systems_capitalize("${_feature_tmp}" _feature_tmp_c)
foreach(_var _feature _feature_tmp _feature_tmp_l _feature_tmp_c)
set(_ver "${${${_var}}_VERSION}")
if(NOT "${_ver}" STREQUAL "")
@@ -509,7 +505,7 @@ endfunction()
# ----------------------------------------------------------------------------------------#
# function print_disabled_features() Print disabled features plus their docstrings.
#
function(OMNITRACE_PRINT_DISABLED_FEATURES)
function(ROCPROFILER_SYSTEMS_PRINT_DISABLED_FEATURES)
set(_basemsg "The following features are NOT defined/enabled (-):")
set(_currentFeatureText "${_basemsg}")
get_property(_features GLOBAL PROPERTY ${PROJECT_NAME}_FEATURES)
@@ -538,10 +534,10 @@ endfunction()
# ----------------------------------------------------------------------------------------#
# function print_features() Print all features plus their docstrings.
#
function(OMNITRACE_PRINT_FEATURES)
omnitrace_report_feature_changes()
omnitrace_print_enabled_features()
omnitrace_print_disabled_features()
function(ROCPROFILER_SYSTEMS_PRINT_FEATURES)
rocprofiler_systems_report_feature_changes()
rocprofiler_systems_print_enabled_features()
rocprofiler_systems_print_disabled_features()
endfunction()
# ----------------------------------------------------------------------------------------#
@@ -551,26 +547,29 @@ endfunction()
# source files DIRECTORY --> all files in directory PROJECT --> all files/targets in
# a project/subproject
#
function(omnitrace_custom_compilation)
function(rocprofiler_systems_custom_compilation)
cmake_parse_arguments(COMP "GLOBAL;PROJECT" "COMPILER" "DIRECTORY;TARGET;SOURCE"
${ARGN})
# find omnitrace-launch-compiler
# find rocprof-sys-launch-compiler
find_program(
OMNITRACE_COMPILE_LAUNCHER
NAMES omnitrace-launch-compiler
ROCPROFSYS_COMPILE_LAUNCHER
NAMES rocprof-sys-launch-compiler
HINTS ${PROJECT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}
PATHS ${PROJECT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}
PATH_SUFFIXES scripts bin)
message(STATUS "rocprof_sys_compile_launcher: ${ROCPROFSYS_COMPILE_LAUNCHER}")
if(NOT COMP_COMPILER)
message(FATAL_ERROR "omnitrace_custom_compilation not provided COMPILER argument")
message(
FATAL_ERROR "rocprof_sys_custom_compilation not provided COMPILER argument")
endif()
if(NOT OMNITRACE_COMPILE_LAUNCHER)
if(NOT ROCPROFSYS_COMPILE_LAUNCHER)
message(
FATAL_ERROR
"omnitrace could not find 'omnitrace-launch-compiler'. Please set '-DOMNITRACE_COMPILE_LAUNCHER=/path/to/launcher'"
"rocprofiler-systems could not find 'rocprof-sys-launch-compiler'. Please set '-DROCPROFSYS_COMPILE_LAUNCHER=/path/to/launcher'"
)
endif()
@@ -580,16 +579,16 @@ function(omnitrace_custom_compilation)
GLOBAL
PROPERTY
RULE_LAUNCH_COMPILE
"${OMNITRACE_COMPILE_LAUNCHER} ${COMP_COMPILER} ${CMAKE_CXX_COMPILER}")
"${ROCPROFSYS_COMPILE_LAUNCHER} ${COMP_COMPILER} ${CMAKE_CXX_COMPILER}")
set_property(
GLOBAL
PROPERTY
RULE_LAUNCH_LINK
"${OMNITRACE_COMPILE_LAUNCHER} ${COMP_COMPILER} ${CMAKE_CXX_COMPILER}")
"${ROCPROFSYS_COMPILE_LAUNCHER} ${COMP_COMPILER} ${CMAKE_CXX_COMPILER}")
else()
foreach(_TYPE PROJECT DIRECTORY TARGET SOURCE)
# make project/subproject scoping easy, e.g.
# omnitrace_custom_compilation(PROJECT) after project(...)
# rocprofiler_systems_custom_compilation(PROJECT) after project(...)
if("${_TYPE}" STREQUAL "PROJECT" AND COMP_${_TYPE})
list(APPEND COMP_DIRECTORY ${PROJECT_SOURCE_DIR})
unset(COMP_${_TYPE})
@@ -601,13 +600,13 @@ function(omnitrace_custom_compilation)
${_TYPE} ${_VAL}
PROPERTY
RULE_LAUNCH_COMPILE
"${OMNITRACE_COMPILE_LAUNCHER} ${COMP_COMPILER} ${CMAKE_CXX_COMPILER}"
"${ROCPROFSYS_COMPILE_LAUNCHER} ${COMP_COMPILER} ${CMAKE_CXX_COMPILER}"
)
set_property(
${_TYPE} ${_VAL}
PROPERTY
RULE_LAUNCH_LINK
"${OMNITRACE_COMPILE_LAUNCHER} ${COMP_COMPILER} ${CMAKE_CXX_COMPILER}"
"${ROCPROFSYS_COMPILE_LAUNCHER} ${COMP_COMPILER} ${CMAKE_CXX_COMPILER}"
)
endforeach()
endif()
@@ -615,7 +614,7 @@ function(omnitrace_custom_compilation)
endif()
endfunction()
function(OMNITRACE_WATCH_FOR_CHANGE _var)
function(ROCPROFILER_SYSTEMS_WATCH_FOR_CHANGE _var)
list(LENGTH ARGN _NUM_EXTRA_ARGS)
if(_NUM_EXTRA_ARGS EQUAL 1)
set(_VAR ${ARGN})
@@ -633,42 +632,43 @@ function(OMNITRACE_WATCH_FOR_CHANGE _var)
update_var(OFF)
set(_omnitrace_watch_var_name OMNITRACE_WATCH_VALUE_${_var})
if(DEFINED ${_omnitrace_watch_var_name})
if("${${_var}}" STREQUAL "${${_omnitrace_watch_var_name}}")
set(_rocprofiler_systems_watch_var_name ROCPROFSYS_WATCH_VALUE_${_var})
if(DEFINED ${_rocprofiler_systems_watch_var_name})
if("${${_var}}" STREQUAL "${${_rocprofiler_systems_watch_var_name}}")
return()
else()
omnitrace_message(
rocprofiler_systems_message(
STATUS
"${_var} changed :: ${${_omnitrace_watch_var_name}} --> ${${_var}}")
"${_var} changed :: ${${_rocprofiler_systems_watch_var_name}} --> ${${_var}}"
)
update_var(ON)
endif()
else()
if(NOT "${${_var}}" STREQUAL "")
omnitrace_message(STATUS "${_var} :: ${${_var}}")
rocprofiler_systems_message(STATUS "${_var} :: ${${_var}}")
update_var(ON)
endif()
endif()
# store the value for the next run
set(${_omnitrace_watch_var_name}
set(${_rocprofiler_systems_watch_var_name}
"${${_var}}"
CACHE INTERNAL "Last value of ${_var}" FORCE)
endfunction()
function(OMNITRACE_DIRECTORY)
function(ROCPROFILER_SYSTEMS_DIRECTORY)
cmake_parse_arguments(F "MKDIR;FAIL;FORCE" "PREFIX;OUTPUT_VARIABLE;WORKING_DIRECTORY"
"PATHS" ${ARGN})
if(F_PREFIX AND NOT IS_ABSOLUTE "${F_PREFIX}")
if(F_WORKING_DIRECTORY)
omnitrace_message(
rocprofiler_systems_message(
STATUS
"PREFIX was specified as a relative path, using working directory + prefix :: '${F_WORKING_DIRECTORY}/${F_PREFIX}'..."
)
set(F_PREFIX ${F_WORKING_DIRECTORY}/${F_PREFIX})
else()
omnitrace_message(
rocprofiler_systems_message(
FATAL_ERROR
"PREFIX was specified but it is not an absolute path: ${F_PREFIX}")
endif()
@@ -690,9 +690,10 @@ function(OMNITRACE_DIRECTORY)
endif()
if(NOT EXISTS "${_PATH}" AND F_FAIL)
omnitrace_message(FATAL_ERROR "Directory '${_PATH}' does not exist")
rocprofiler_systems_message(FATAL_ERROR "Directory '${_PATH}' does not exist")
elseif(NOT IS_DIRECTORY "${_PATH}" AND F_FAIL)
omnitrace_message(FATAL_ERROR "'${_PATH}' exists but is not a directory")
rocprofiler_systems_message(FATAL_ERROR
"'${_PATH}' exists but is not a directory")
elseif(NOT EXISTS "${_PATH}" AND F_MKDIR)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${_PATH}
WORKING_DIRECTORY ${F_WORKING_DIRECTORY})
@@ -716,11 +717,11 @@ function(OMNITRACE_DIRECTORY)
endif()
endfunction()
function(OMNITRACE_CHECK_PYTHON_DIRS_AND_VERSIONS)
function(ROCPROFILER_SYSTEMS_CHECK_PYTHON_DIRS_AND_VERSIONS)
cmake_parse_arguments(F "FAIL;UNSET" "RESULT_VARIABLE;OUTPUT_VARIABLE" "" ${ARGN})
list(LENGTH OMNITRACE_PYTHON_VERSIONS _NUM_PYTHON_VERSIONS)
list(LENGTH OMNITRACE_PYTHON_ROOT_DIRS _NUM_PYTHON_ROOT_DIRS)
list(LENGTH ROCPROFSYS_PYTHON_VERSIONS _NUM_PYTHON_VERSIONS)
list(LENGTH ROCPROFSYS_PYTHON_ROOT_DIRS _NUM_PYTHON_ROOT_DIRS)
if(NOT _NUM_PYTHON_VERSIONS EQUAL _NUM_PYTHON_ROOT_DIRS)
set(_RET 1)
@@ -741,20 +742,20 @@ function(OMNITRACE_CHECK_PYTHON_DIRS_AND_VERSIONS)
if(NOT ${_RET} EQUAL 0)
if(F_FAIL)
omnitrace_message(
rocprofiler_systems_message(
WARNING
"Error! Number of python versions : ${_NUM_PYTHON_VERSIONS}. VERSIONS :: ${OMNITRACE_PYTHON_VERSIONS}"
"Error! Number of python versions : ${_NUM_PYTHON_VERSIONS}. VERSIONS :: ${ROCPROFSYS_PYTHON_VERSIONS}"
)
omnitrace_message(
rocprofiler_systems_message(
WARNING
"Error! Number of python root directories : ${_NUM_PYTHON_ROOT_DIRS}. ROOT DIRS :: ${OMNITRACE_PYTHON_ROOT_DIRS}"
"Error! Number of python root directories : ${_NUM_PYTHON_ROOT_DIRS}. ROOT DIRS :: ${ROCPROFSYS_PYTHON_ROOT_DIRS}"
)
omnitrace_message(
rocprofiler_systems_message(
FATAL_ERROR
"Error! Number of python versions != number of python root directories")
elseif(F_UNSET)
unset(OMNITRACE_PYTHON_VERSIONS CACHE)
unset(OMNITRACE_PYTHON_ROOT_DIRS CACHE)
unset(ROCPROFSYS_PYTHON_VERSIONS CACHE)
unset(ROCPROFSYS_PYTHON_ROOT_DIRS CACHE)
if(F_OUTPUT_VARIABLE)
set(${F_OUTPUT_VARIABLE} 0)
endif()
@@ -765,7 +766,7 @@ endfunction()
# ----------------------------------------------------------------------------
# Console scripts
#
function(OMNITRACE_PYTHON_CONSOLE_SCRIPT SCRIPT_NAME SCRIPT_SUBMODULE)
function(ROCPROFILER_SYSTEMS_PYTHON_CONSOLE_SCRIPT SCRIPT_NAME SCRIPT_SUBMODULE)
set(options)
set(args VERSION ROOT_DIR)
set(kwargs)
@@ -786,7 +787,7 @@ function(OMNITRACE_PYTHON_CONSOLE_SCRIPT SCRIPT_NAME SCRIPT_SUBMODULE)
OPTIONAL)
endif()
if(OMNITRACE_BUILD_TESTING OR OMNITRACE_BUILD_PYTHON)
if(ROCPROFSYS_BUILD_TESTING OR ROCPROFSYS_BUILD_PYTHON)
add_test(
NAME ${SCRIPT_NAME}-console-script-test-${ARG_VERSION}
COMMAND ${PROJECT_BINARY_DIR}/bin/${SCRIPT_NAME}-${ARG_VERSION} --help
@@ -819,17 +820,17 @@ function(OMNITRACE_PYTHON_CONSOLE_SCRIPT SCRIPT_NAME SCRIPT_SUBMODULE)
endif()
endfunction()
function(OMNITRACE_FIND_STATIC_LIBRARY)
function(ROCPROFILER_SYSTEMS_FIND_STATIC_LIBRARY)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
find_library(${ARGN})
endfunction()
function(OMNITRACE_FIND_SHARED_LIBRARY)
function(ROCPROFILER_SYSTEMS_FIND_SHARED_LIBRARY)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
find_library(${ARGN})
endfunction()
function(OMNITRACE_BUILDTREE_TPL _TPL_TARGET _NEW_NAME _BUILD_TREE_DIR)
function(ROCPROFILER_SYSTEMS_BUILDTREE_TPL _TPL_TARGET _NEW_NAME _BUILD_TREE_DIR)
get_target_property(_TPL_VERSION ${_TPL_TARGET} VERSION)
get_target_property(_TPL_SOVERSION ${_TPL_TARGET} SOVERSION)
get_target_property(_TPL_NAME ${_TPL_TARGET} OUTPUT_NAME)
@@ -862,7 +863,7 @@ function(OMNITRACE_BUILDTREE_TPL _TPL_TARGET _NEW_NAME _BUILD_TREE_DIR)
COMMENT "Creating ${_NEW_NAME} from ${_TPL_TARGET}...")
endfunction()
function(OMNITRACE_INSTALL_TPL _TPL_TARGET _NEW_NAME _BUILD_TREE_DIR _COMPONENT)
function(ROCPROFILER_SYSTEMS_INSTALL_TPL _TPL_TARGET _NEW_NAME _BUILD_TREE_DIR _COMPONENT)
get_target_property(_TPL_VERSION ${_TPL_TARGET} VERSION)
get_target_property(_TPL_SOVERSION ${_TPL_TARGET} SOVERSION)
get_target_property(_TPL_NAME ${_TPL_TARGET} OUTPUT_NAME)
@@ -876,7 +877,8 @@ function(OMNITRACE_INSTALL_TPL _TPL_TARGET _NEW_NAME _BUILD_TREE_DIR _COMPONENT)
endforeach()
# build tree symbolic links
omnitrace_buildtree_tpl("${_TPL_TARGET}" "${_NEW_NAME}" "${_BUILD_TREE_DIR}" ${ARGN})
rocprofiler_systems_buildtree_tpl("${_TPL_TARGET}" "${_NEW_NAME}"
"${_BUILD_TREE_DIR}" ${ARGN})
install(
FILES $<TARGET_FILE:${_TPL_TARGET}>
@@ -10,7 +10,7 @@ set(MPI_HEADERS_VENDOR_INTERNAL
"OpenMPI"
CACHE STRING "Distribution type of internal mpi.h")
set(MPI_HEADERS_INCLUDE_DIR_INTERNAL
"${PROJECT_SOURCE_DIR}/source/lib/omnitrace/library/tpls/mpi"
"${PROJECT_SOURCE_DIR}/source/lib/rocprof-sys/library/tpls/mpi"
CACHE PATH "Path to internal ${MPI_HEADERS_VENDOR_INTERNAL} mpi.h")
mark_as_advanced(MPI_HEADERS_VENDOR_INTERNAL)
mark_as_advanced(MPI_HEADERS_INCLUDE_DIR_INTERNAL)
@@ -6,7 +6,7 @@ include(FindPackageHandleStandardArgs)
# ----------------------------------------------------------------------------------------#
set(RCCL-Headers_INCLUDE_DIR_INTERNAL
"${PROJECT_SOURCE_DIR}/source/lib/omnitrace/library/tpls/rccl"
"${PROJECT_SOURCE_DIR}/source/lib/rocprof-sys/library/tpls/rccl"
CACHE PATH "Path to internal rccl.h")
# ----------------------------------------------------------------------------------------#
@@ -60,7 +60,7 @@ else()
endif()
if(NOT EXISTS "${RCCL-Headers_INCLUDE_DIR}/${_RCCL-Headers_FILE}")
omnitrace_message(
rocprofiler_systems_message(
AUTHOR_WARNING
"RCCL header (${RCCL-Headers_INCLUDE_DIR}/${_RCCL-Headers_FILE}) does not exist! Setting RCCL-Headers_INCLUDE_DIR to internal RCCL include directory: ${RCCL-Headers_INCLUDE_DIR_INTERNAL}"
)
@@ -226,7 +226,7 @@ function(ROCM_VERSION_PARSE_VERSION_FILES)
# convert env to cache if not defined
foreach(_PATH ROCmVersion_DIR ROCmVersion_ROOT ROCmVersion_ROOT_DIR
OMNITRACE_DEFAULT_ROCM_PATH ROCM_PATH)
ROCPROFSYS_DEFAULT_ROCM_PATH ROCM_PATH)
if(NOT DEFINED ${_PATH} AND DEFINED ENV{${_PATH}})
set(_VAL "$ENV{${_PATH}}")
get_filename_component(_VAL "${_VAL}" REALPATH)
@@ -243,7 +243,7 @@ function(ROCM_VERSION_PARSE_VERSION_FILES)
foreach(
_DIR
${ROCmVersion_DIR} ${ROCmVersion_ROOT} ${ROCmVersion_ROOT_DIR}
$ENV{CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} ${OMNITRACE_DEFAULT_ROCM_PATH}
$ENV{CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} ${ROCPROFSYS_DEFAULT_ROCM_PATH}
${ROCM_PATH} /opt/rocm)
if(EXISTS ${_DIR})
get_filename_component(_ABS_DIR "${_DIR}" REALPATH)
@@ -1,13 +1,13 @@
# ======================================================================================
# PAPI.cmake
#
# Configure papi for omnitrace
# Configure papi for rocprofiler-systems
#
# ======================================================================================
include_guard(GLOBAL)
omnitrace_checkout_git_submodule(
rocprofiler_systems_checkout_git_submodule(
RELATIVE_PATH external/papi
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://bitbucket.org/icl/papi.git
@@ -18,38 +18,39 @@ set(PAPI_LIBPFM_SOVERSION
"4.11.1"
CACHE STRING "libpfm.so version")
set(OMNITRACE_PAPI_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/papi/source)
set(OMNITRACE_PAPI_INSTALL_DIR ${PROJECT_BINARY_DIR}/external/papi/install)
set(ROCPROFSYS_PAPI_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/papi/source)
set(ROCPROFSYS_PAPI_INSTALL_DIR ${PROJECT_BINARY_DIR}/external/papi/install)
if(NOT EXISTS "${OMNITRACE_PAPI_SOURCE_DIR}")
if(NOT EXISTS "${ROCPROFSYS_PAPI_SOURCE_DIR}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/external/papi
${OMNITRACE_PAPI_SOURCE_DIR})
${ROCPROFSYS_PAPI_SOURCE_DIR})
endif()
if(NOT EXISTS "${OMNITRACE_PAPI_INSTALL_DIR}")
if(NOT EXISTS "${ROCPROFSYS_PAPI_INSTALL_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
${OMNITRACE_PAPI_INSTALL_DIR})
${ROCPROFSYS_PAPI_INSTALL_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
${OMNITRACE_PAPI_INSTALL_DIR}/include)
${ROCPROFSYS_PAPI_INSTALL_DIR}/include)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
${OMNITRACE_PAPI_INSTALL_DIR}/lib)
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib)
execute_process(
COMMAND
${CMAKE_COMMAND} -E touch ${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpapi.a
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpfm.a
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpfm.so)
set(_OMNITRACE_PAPI_BUILD_BYPRODUCTS
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpapi.a
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpfm.a
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpfm.so)
${CMAKE_COMMAND} -E touch ${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.so)
set(_ROCPROFSYS_PAPI_BUILD_BYPRODUCTS
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.so)
endif()
omnitrace_add_option(OMNITRACE_PAPI_AUTO_COMPONENTS "Automatically enable components" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_PAPI_AUTO_COMPONENTS
"Automatically enable components" OFF)
# -------------- PACKAGES -----------------------------------------------------
set(_OMNITRACE_VALID_PAPI_COMPONENTS
set(_ROCPROFSYS_VALID_PAPI_COMPONENTS
appio
bgpm
coretemp
@@ -86,13 +87,13 @@ set(_OMNITRACE_VALID_PAPI_COMPONENTS
stealtime
sysdetect
vmware)
set(OMNITRACE_VALID_PAPI_COMPONENTS
"${_OMNITRACE_VALID_PAPI_COMPONENTS}"
set(ROCPROFSYS_VALID_PAPI_COMPONENTS
"${_ROCPROFSYS_VALID_PAPI_COMPONENTS}"
CACHE STRING "Valid PAPI components")
mark_as_advanced(OMNITRACE_VALID_PAPI_COMPONENTS)
mark_as_advanced(ROCPROFSYS_VALID_PAPI_COMPONENTS)
# default components which do not require 3rd-party headers or libraries
set(_OMNITRACE_PAPI_COMPONENTS
set(_ROCPROFSYS_PAPI_COMPONENTS
appio
coretemp
io
@@ -104,73 +105,73 @@ set(_OMNITRACE_PAPI_COMPONENTS
# rapl stealtime
)
if(OMNITRACE_PAPI_AUTO_COMPONENTS)
if(ROCPROFSYS_PAPI_AUTO_COMPONENTS)
# rocm
if(OMNITRACE_USE_HIP
OR OMNITRACE_USE_ROCTRACER
OR OMNITRACE_USE_ROCM_SMI)
list(APPEND _OMNITRACE_PAPI_COMPONENTS rocm)
if(ROCPROFSYS_USE_HIP
OR ROCPROFSYS_USE_ROCTRACER
OR ROCPROFSYS_USE_ROCM_SMI)
list(APPEND _ROCPROFSYS_PAPI_COMPONENTS rocm)
endif()
# lmsensors
find_path(OMNITRACE_PAPI_LMSENSORS_ROOT_DIR NAMES include/sensors/sensors.h
include/sensors.h)
find_path(ROCPROFSYS_PAPI_LMSENSORS_ROOT_DIR NAMES include/sensors/sensors.h
include/sensors.h)
if(OMNITRACE_PAPI_LMSENSORS_ROOT_DIR)
list(APPEND _OMNITRACE_PAPI_COMPONENTS lmsensors)
if(ROCPROFSYS_PAPI_LMSENSORS_ROOT_DIR)
list(APPEND _ROCPROFSYS_PAPI_COMPONENTS lmsensors)
endif()
# pcp
find_path(OMNITRACE_PAPI_PCP_ROOT_DIR NAMES include/pcp/impl.h)
find_path(ROCPROFSYS_PAPI_PCP_ROOT_DIR NAMES include/pcp/impl.h)
find_library(
OMNITRACE_PAPI_PCP_LIBRARY
ROCPROFSYS_PAPI_PCP_LIBRARY
NAMES pcp
PATH_SUFFIXES lib lib64)
if(OMNITRACE_PAPI_PCP_ROOT_DIR AND OMNITRACE_PAPI_PCP_LIBRARY)
list(APPEND _OMNITRACE_PAPI_COMPONENTS pcp)
if(ROCPROFSYS_PAPI_PCP_ROOT_DIR AND ROCPROFSYS_PAPI_PCP_LIBRARY)
list(APPEND _ROCPROFSYS_PAPI_COMPONENTS pcp)
endif()
endif()
# set the OMNITRACE_PAPI_COMPONENTS cache variable
set(OMNITRACE_PAPI_COMPONENTS
"${_OMNITRACE_PAPI_COMPONENTS}"
# set the ROCPROFSYS_PAPI_COMPONENTS cache variable
set(ROCPROFSYS_PAPI_COMPONENTS
"${_ROCPROFSYS_PAPI_COMPONENTS}"
CACHE STRING "PAPI components")
omnitrace_add_feature(OMNITRACE_PAPI_COMPONENTS "PAPI components")
string(REPLACE ";" "\ " _OMNITRACE_PAPI_COMPONENTS "${OMNITRACE_PAPI_COMPONENTS}")
set(OMNITRACE_PAPI_EXTRA_ENV)
rocprofiler_systems_add_feature(ROCPROFSYS_PAPI_COMPONENTS "PAPI components")
string(REPLACE ";" "\ " _ROCPROFSYS_PAPI_COMPONENTS "${ROCPROFSYS_PAPI_COMPONENTS}")
set(ROCPROFSYS_PAPI_EXTRA_ENV)
foreach(_COMP ${OMNITRACE_PAPI_COMPONENTS})
string(REPLACE ";" ", " _OMNITRACE_VALID_PAPI_COMPONENTS_MSG
"${OMNITRACE_VALID_PAPI_COMPONENTS}")
if(NOT "${_COMP}" IN_LIST OMNITRACE_VALID_PAPI_COMPONENTS)
omnitrace_message(
foreach(_COMP ${ROCPROFSYS_PAPI_COMPONENTS})
string(REPLACE ";" ", " _ROCPROFSYS_VALID_PAPI_COMPONENTS_MSG
"${ROCPROFSYS_VALID_PAPI_COMPONENTS}")
if(NOT "${_COMP}" IN_LIST ROCPROFSYS_VALID_PAPI_COMPONENTS)
rocprofiler_systems_message(
AUTHOR_WARNING
"OMNITRACE_PAPI_COMPONENTS contains an unknown component '${_COMP}'. Known components: ${_OMNITRACE_VALID_PAPI_COMPONENTS_MSG}"
"ROCPROFSYS_PAPI_COMPONENTS contains an unknown component '${_COMP}'. Known components: ${_ROCPROFSYS_VALID_PAPI_COMPONENTS_MSG}"
)
endif()
unset(_OMNITRACE_VALID_PAPI_COMPONENTS_MSG)
unset(_ROCPROFSYS_VALID_PAPI_COMPONENTS_MSG)
endforeach()
if("rocm" IN_LIST OMNITRACE_PAPI_COMPONENTS)
if("rocm" IN_LIST ROCPROFSYS_PAPI_COMPONENTS)
find_package(ROCmVersion REQUIRED)
list(APPEND OMNITRACE_PAPI_EXTRA_ENV PAPI_ROCM_ROOT=${ROCmVersion_DIR})
list(APPEND ROCPROFSYS_PAPI_EXTRA_ENV PAPI_ROCM_ROOT=${ROCmVersion_DIR})
endif()
if("lmsensors" IN_LIST OMNITRACE_PAPI_COMPONENTS AND OMNITRACE_PAPI_LMSENSORS_ROOT_DIR)
list(APPEND OMNITRACE_PAPI_EXTRA_ENV
PAPI_LMSENSORS_ROOT=${OMNITRACE_PAPI_LMSENSORS_ROOT_DIR})
if("lmsensors" IN_LIST ROCPROFSYS_PAPI_COMPONENTS AND ROCPROFSYS_PAPI_LMSENSORS_ROOT_DIR)
list(APPEND ROCPROFSYS_PAPI_EXTRA_ENV
PAPI_LMSENSORS_ROOT=${ROCPROFSYS_PAPI_LMSENSORS_ROOT_DIR})
endif()
if("pcp" IN_LIST OMNITRACE_PAPI_COMPONENTS AND OMNITRACE_PAPI_PCP_ROOT_DIR)
list(APPEND OMNITRACE_PAPI_EXTRA_ENV PAPI_PCP_ROOT=${OMNITRACE_PAPI_PCP_ROOT_DIR})
if("pcp" IN_LIST ROCPROFSYS_PAPI_COMPONENTS AND ROCPROFSYS_PAPI_PCP_ROOT_DIR)
list(APPEND ROCPROFSYS_PAPI_EXTRA_ENV PAPI_PCP_ROOT=${ROCPROFSYS_PAPI_PCP_ROOT_DIR})
endif()
if("perf_event_uncore" IN_LIST OMNITRACE_PAPI_COMPONENTS AND NOT "perf_event" IN_LIST
OMNITRACE_PAPI_COMPONENTS)
omnitrace_message(
if("perf_event_uncore" IN_LIST ROCPROFSYS_PAPI_COMPONENTS AND NOT "perf_event" IN_LIST
ROCPROFSYS_PAPI_COMPONENTS)
rocprofiler_systems_message(
FATAL_ERROR
"OMNITRACE_PAPI_COMPONENTS :: 'perf_event_uncore' requires 'perf_event' component"
"ROCPROFSYS_PAPI_COMPONENTS :: 'perf_event_uncore' requires 'perf_event' component"
)
endif()
@@ -180,7 +181,7 @@ find_program(
PATH_SUFFIXES bin)
if(NOT MAKE_EXECUTABLE)
omnitrace_message(
rocprofiler_systems_message(
FATAL_ERROR
"make/gmake executable not found. Please re-run with -DMAKE_EXECUTABLE=/path/to/make"
)
@@ -188,9 +189,9 @@ endif()
set(_PAPI_C_COMPILER ${CMAKE_C_COMPILER})
if(CMAKE_C_COMPILER_IS_CLANG)
find_program(OMNITRACE_GNU_C_COMPILER NAMES gcc)
if(OMNITRACE_GNU_C_COMPILER)
set(_PAPI_C_COMPILER ${OMNITRACE_GNU_C_COMPILER})
find_program(ROCPROFSYS_GNU_C_COMPILER NAMES gcc)
if(ROCPROFSYS_GNU_C_COMPILER)
set(_PAPI_C_COMPILER ${ROCPROFSYS_GNU_C_COMPILER})
endif()
endif()
set(PAPI_C_COMPILER
@@ -199,74 +200,77 @@ set(PAPI_C_COMPILER
include(ExternalProject)
externalproject_add(
omnitrace-papi-build
rocprofiler-systems-papi-build
PREFIX ${PROJECT_BINARY_DIR}/external/papi
SOURCE_DIR ${OMNITRACE_PAPI_SOURCE_DIR}/src
SOURCE_DIR ${ROCPROFSYS_PAPI_SOURCE_DIR}/src
BUILD_IN_SOURCE 1
PATCH_COMMAND
${CMAKE_COMMAND} -E env CC=${PAPI_C_COMPILER}
CFLAGS=-fPIC\ -O3\ -Wno-stringop-truncation LIBS=-lrt LDFLAGS=-lrt
${OMNITRACE_PAPI_EXTRA_ENV} <SOURCE_DIR>/configure --quiet
--prefix=${OMNITRACE_PAPI_INSTALL_DIR} --with-static-lib=yes --with-shared-lib=no
--with-perf-events --with-tests=no --with-components=${_OMNITRACE_PAPI_COMPONENTS}
${ROCPROFSYS_PAPI_EXTRA_ENV} <SOURCE_DIR>/configure --quiet
--prefix=${ROCPROFSYS_PAPI_INSTALL_DIR} --with-static-lib=yes --with-shared-lib=no
--with-perf-events --with-tests=no
--with-components=${_ROCPROFSYS_PAPI_COMPONENTS}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CFLAGS=-fPIC\ -O3\ -Wno-stringop-truncation
${OMNITRACE_PAPI_EXTRA_ENV} ${MAKE_EXECUTABLE} static install -s
${ROCPROFSYS_PAPI_EXTRA_ENV} ${MAKE_EXECUTABLE} static install -s
BUILD_COMMAND ${CMAKE_COMMAND} -E env CFLAGS=-fPIC\ -O3\ -Wno-stringop-truncation
${OMNITRACE_PAPI_EXTRA_ENV} ${MAKE_EXECUTABLE} utils install-utils -s
${ROCPROFSYS_PAPI_EXTRA_ENV} ${MAKE_EXECUTABLE} utils install-utils -s
INSTALL_COMMAND ""
BUILD_BYPRODUCTS "${_OMNITRACE_PAPI_BUILD_BYPRODUCTS}")
BUILD_BYPRODUCTS "${_ROCPROFSYS_PAPI_BUILD_BYPRODUCTS}")
# target for re-executing the installation
add_custom_target(
omnitrace-papi-install
rocprofiler-systems-papi-install
COMMAND ${CMAKE_COMMAND} -E env CFLAGS=-fPIC\ -O3\ -Wno-stringop-truncation
${OMNITRACE_PAPI_EXTRA_ENV} ${MAKE_EXECUTABLE} static install -s
${ROCPROFSYS_PAPI_EXTRA_ENV} ${MAKE_EXECUTABLE} static install -s
COMMAND ${CMAKE_COMMAND} -E env CFLAGS=-fPIC\ -O3\ -Wno-stringop-truncation
${OMNITRACE_PAPI_EXTRA_ENV} ${MAKE_EXECUTABLE} utils install-utils -s
WORKING_DIRECTORY ${OMNITRACE_PAPI_SOURCE_DIR}/src
${ROCPROFSYS_PAPI_EXTRA_ENV} ${MAKE_EXECUTABLE} utils install-utils -s
WORKING_DIRECTORY ${ROCPROFSYS_PAPI_SOURCE_DIR}/src
COMMENT "Installing PAPI...")
add_custom_target(
omnitrace-papi-clean
rocprofiler-systems-papi-clean
COMMAND ${MAKE_EXECUTABLE} distclean
COMMAND ${CMAKE_COMMAND} -E rm -rf ${OMNITRACE_PAPI_INSTALL_DIR}/include/*
COMMAND ${CMAKE_COMMAND} -E rm -rf ${OMNITRACE_PAPI_INSTALL_DIR}/lib/*
COMMAND ${CMAKE_COMMAND} -E rm -rf ${ROCPROFSYS_PAPI_INSTALL_DIR}/include/*
COMMAND ${CMAKE_COMMAND} -E rm -rf ${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/*
COMMAND
${CMAKE_COMMAND} -E touch ${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpapi.a
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpfm.a
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpfm.so
WORKING_DIRECTORY ${OMNITRACE_PAPI_SOURCE_DIR}/src
${CMAKE_COMMAND} -E touch ${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.so
WORKING_DIRECTORY ${ROCPROFSYS_PAPI_SOURCE_DIR}/src
COMMENT "Cleaning PAPI...")
set(PAPI_ROOT_DIR
${OMNITRACE_PAPI_INSTALL_DIR}
${ROCPROFSYS_PAPI_INSTALL_DIR}
CACHE PATH "Root PAPI installation" FORCE)
set(PAPI_INCLUDE_DIR
${OMNITRACE_PAPI_INSTALL_DIR}/include
${ROCPROFSYS_PAPI_INSTALL_DIR}/include
CACHE PATH "PAPI include folder" FORCE)
set(PAPI_LIBRARY
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_pfm_LIBRARY
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpfm.so
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.so
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_STATIC_LIBRARY
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpapi.a
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_pfm_STATIC_LIBRARY
${OMNITRACE_PAPI_INSTALL_DIR}/lib/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/libpfm.a
CACHE FILEPATH "PAPI library" FORCE)
target_include_directories(omnitrace-papi SYSTEM
target_include_directories(rocprofiler-systems-papi SYSTEM
INTERFACE $<BUILD_INTERFACE:${PAPI_INCLUDE_DIR}>)
target_link_libraries(omnitrace-papi INTERFACE $<BUILD_INTERFACE:${PAPI_LIBRARY}>
$<BUILD_INTERFACE:${PAPI_pfm_LIBRARY}>)
omnitrace_target_compile_definitions(
omnitrace-papi INTERFACE OMNITRACE_USE_PAPI $<BUILD_INTERFACE:TIMEMORY_USE_PAPI=1>)
target_link_libraries(
rocprofiler-systems-papi INTERFACE $<BUILD_INTERFACE:${PAPI_LIBRARY}>
$<BUILD_INTERFACE:${PAPI_pfm_LIBRARY}>)
rocprofiler_systems_target_compile_definitions(
rocprofiler-systems-papi INTERFACE ROCPROFSYS_USE_PAPI
$<BUILD_INTERFACE:TIMEMORY_USE_PAPI=1>)
install(
DIRECTORY ${OMNITRACE_PAPI_INSTALL_DIR}/lib/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/omnitrace
DIRECTORY ${ROCPROFSYS_PAPI_INSTALL_DIR}/lib/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT papi
FILES_MATCHING
PATTERN "*.so*")
@@ -289,7 +293,7 @@ foreach(
papi_version
papi_xml_event_info)
string(REPLACE "_" "-" _UTIL_EXE_INSTALL_NAME "omnitrace-${_UTIL_EXE}")
string(REPLACE "_" "-" _UTIL_EXE_INSTALL_NAME "${BINARY_NAME_PREFIX}-${_UTIL_EXE}")
# RPM installer on RedHat/RockyLinux throws error that #!/usr/bin/python should either
# be #!/usr/bin/python2 or #!/usr/bin/python3
@@ -300,14 +304,14 @@ foreach(
_HL_OUTPUT_WRITER)
string(REPLACE "#!/usr/bin/python\n" "#!/usr/bin/python3\n" _HL_OUTPUT_WRITER
"${_HL_OUTPUT_WRITER}")
file(MAKE_DIRECTORY "${OMNITRACE_PAPI_INSTALL_DIR}/bin")
file(WRITE "${OMNITRACE_PAPI_INSTALL_DIR}/bin/${_UTIL_EXE}3"
file(MAKE_DIRECTORY "${ROCPROFSYS_PAPI_INSTALL_DIR}/bin")
file(WRITE "${ROCPROFSYS_PAPI_INSTALL_DIR}/bin/${_UTIL_EXE}3"
"${_HL_OUTPUT_WRITER}")
set(_UTIL_EXE "${_UTIL_EXE}3")
endif()
install(
PROGRAMS ${OMNITRACE_PAPI_INSTALL_DIR}/bin/${_UTIL_EXE}
PROGRAMS ${ROCPROFSYS_PAPI_INSTALL_DIR}/bin/${_UTIL_EXE}
DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME ${_UTIL_EXE_INSTALL_NAME}
COMPONENT papi
@@ -7,73 +7,87 @@ include_guard(DIRECTORY)
#
# ########################################################################################
omnitrace_add_interface_library(
omnitrace-headers "Provides minimal set of include flags to compile with omnitrace")
omnitrace_add_interface_library(omnitrace-threading "Enables multithreading support")
omnitrace_add_interface_library(
omnitrace-dyninst
rocprofiler_systems_add_interface_library(
rocprofiler-systems-headers
"Provides minimal set of include flags to compile with rocprofiler-systems")
rocprofiler_systems_add_interface_library(rocprofiler-systems-threading
"Enables multithreading support")
rocprofiler_systems_add_interface_library(
rocprofiler-systems-dyninst
"Provides flags and libraries for Dyninst (dynamic instrumentation)")
omnitrace_add_interface_library(omnitrace-hip "Provides flags and libraries for HIP")
omnitrace_add_interface_library(omnitrace-roctracer
"Provides flags and libraries for roctracer")
omnitrace_add_interface_library(omnitrace-rocprofiler
"Provides flags and libraries for rocprofiler")
omnitrace_add_interface_library(omnitrace-rocm-smi
"Provides flags and libraries for rocm-smi")
omnitrace_add_interface_library(
omnitrace-rccl "Provides flags for ROCm Communication Collectives Library (RCCL)")
omnitrace_add_interface_library(omnitrace-mpi "Provides MPI or MPI headers")
omnitrace_add_interface_library(omnitrace-bfd "Provides Binary File Descriptor (BFD)")
omnitrace_add_interface_library(omnitrace-ptl "Enables PTL support (tasking)")
omnitrace_add_interface_library(omnitrace-papi "Enable PAPI support")
omnitrace_add_interface_library(omnitrace-ompt "Enable OMPT support")
omnitrace_add_interface_library(omnitrace-python "Enables Python support")
omnitrace_add_interface_library(omnitrace-elfutils "Provides ElfUtils")
omnitrace_add_interface_library(omnitrace-perfetto "Enables Perfetto support")
omnitrace_add_interface_library(omnitrace-timemory "Provides timemory libraries")
omnitrace_add_interface_library(omnitrace-timemory-config
"CMake interface library applied to all timemory targets")
omnitrace_add_interface_library(omnitrace-compile-definitions "Compile definitions")
rocprofiler_systems_add_interface_library(rocprofiler-systems-hip
"Provides flags and libraries for HIP")
rocprofiler_systems_add_interface_library(rocprofiler-systems-roctracer
"Provides flags and libraries for roctracer")
rocprofiler_systems_add_interface_library(rocprofiler-systems-rocprofiler
"Provides flags and libraries for rocprofiler")
rocprofiler_systems_add_interface_library(rocprofiler-systems-rocm-smi
"Provides flags and libraries for rocm-smi")
rocprofiler_systems_add_interface_library(
rocprofiler-systems-rccl
"Provides flags for ROCm Communication Collectives Library (RCCL)")
rocprofiler_systems_add_interface_library(rocprofiler-systems-mpi
"Provides MPI or MPI headers")
rocprofiler_systems_add_interface_library(rocprofiler-systems-bfd
"Provides Binary File Descriptor (BFD)")
rocprofiler_systems_add_interface_library(rocprofiler-systems-ptl
"Enables PTL support (tasking)")
rocprofiler_systems_add_interface_library(rocprofiler-systems-papi "Enable PAPI support")
rocprofiler_systems_add_interface_library(rocprofiler-systems-ompt "Enable OMPT support")
rocprofiler_systems_add_interface_library(rocprofiler-systems-python
"Enables Python support")
rocprofiler_systems_add_interface_library(rocprofiler-systems-elfutils
"Provides ElfUtils")
rocprofiler_systems_add_interface_library(rocprofiler-systems-perfetto
"Enables Perfetto support")
rocprofiler_systems_add_interface_library(rocprofiler-systems-timemory
"Provides timemory libraries")
rocprofiler_systems_add_interface_library(
rocprofiler-systems-timemory-config
"CMake interface library applied to all timemory targets")
rocprofiler_systems_add_interface_library(rocprofiler-systems-compile-definitions
"Compile definitions")
# libraries with relevant compile definitions
set(OMNITRACE_EXTENSION_LIBRARIES
omnitrace::omnitrace-hip
omnitrace::omnitrace-roctracer
omnitrace::omnitrace-rocprofiler
omnitrace::omnitrace-rocm-smi
omnitrace::omnitrace-rccl
omnitrace::omnitrace-bfd
omnitrace::omnitrace-mpi
omnitrace::omnitrace-ptl
omnitrace::omnitrace-ompt
omnitrace::omnitrace-papi
omnitrace::omnitrace-perfetto)
set(ROCPROFSYS_EXTENSION_LIBRARIES
rocprofiler-systems::rocprofiler-systems-hip
rocprofiler-systems::rocprofiler-systems-roctracer
rocprofiler-systems::rocprofiler-systems-rocprofiler
rocprofiler-systems::rocprofiler-systems-rocm-smi
rocprofiler-systems::rocprofiler-systems-rccl
rocprofiler-systems::rocprofiler-systems-bfd
rocprofiler-systems::rocprofiler-systems-mpi
rocprofiler-systems::rocprofiler-systems-ptl
rocprofiler-systems::rocprofiler-systems-ompt
rocprofiler-systems::rocprofiler-systems-papi
rocprofiler-systems::rocprofiler-systems-perfetto)
target_include_directories(
omnitrace-headers
rocprofiler-systems-headers
INTERFACE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/source/lib>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/source/lib/core>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/lib>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/lib/omnitrace>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/lib/omnitrace-dl>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/lib/omnitrace-user>)
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/lib/rocprof-sys>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/lib/rocprof-sys-dl>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/lib/rocprof-sys-user>)
# include threading because of rooflines
target_link_libraries(omnitrace-headers INTERFACE omnitrace::omnitrace-threading)
target_link_libraries(rocprofiler-systems-headers
INTERFACE rocprofiler-systems::rocprofiler-systems-threading)
# ensure the env overrides the appending /opt/rocm later
string(REPLACE ":" ";" CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH};${CMAKE_PREFIX_PATH}")
set(OMNITRACE_DEFAULT_ROCM_PATH
set(ROCPROFSYS_DEFAULT_ROCM_PATH
/opt/rocm
CACHE PATH "Default search path for ROCM")
if(EXISTS ${OMNITRACE_DEFAULT_ROCM_PATH})
get_filename_component(_OMNITRACE_DEFAULT_ROCM_PATH "${OMNITRACE_DEFAULT_ROCM_PATH}"
REALPATH)
if(EXISTS ${ROCPROFSYS_DEFAULT_ROCM_PATH})
get_filename_component(_ROCPROFSYS_DEFAULT_ROCM_PATH
"${ROCPROFSYS_DEFAULT_ROCM_PATH}" REALPATH)
if(NOT "${_OMNITRACE_DEFAULT_ROCM_PATH}" STREQUAL "${OMNITRACE_DEFAULT_ROCM_PATH}")
set(OMNITRACE_DEFAULT_ROCM_PATH
"${_OMNITRACE_DEFAULT_ROCM_PATH}"
if(NOT "${_ROCPROFSYS_DEFAULT_ROCM_PATH}" STREQUAL "${ROCPROFSYS_DEFAULT_ROCM_PATH}")
set(ROCPROFSYS_DEFAULT_ROCM_PATH
"${_ROCPROFSYS_DEFAULT_ROCM_PATH}"
CACHE PATH "Default search path for ROCM" FORCE)
endif()
endif()
@@ -94,11 +108,12 @@ find_library(pthread_LIBRARY NAMES pthread pthreads)
find_package_handle_standard_args(pthread-library REQUIRED_VARS pthread_LIBRARY)
if(pthread_LIBRARY)
target_link_libraries(omnitrace-threading INTERFACE ${pthread_LIBRARY})
target_link_libraries(rocprofiler-systems-threading INTERFACE ${pthread_LIBRARY})
else()
find_package(Threads ${omnitrace_FIND_QUIETLY} ${omnitrace_FIND_REQUIREMENT})
find_package(Threads ${rocprofiler_systems_FIND_QUIETLY}
${rocprofiler_systems_FIND_REQUIREMENT})
if(Threads_FOUND)
target_link_libraries(omnitrace-threading INTERFACE Threads::Threads)
target_link_libraries(rocprofiler-systems-threading INTERFACE Threads::Threads)
endif()
endif()
@@ -106,7 +121,7 @@ foreach(_LIB dl rt)
find_library(${_LIB}_LIBRARY NAMES ${_LIB})
find_package_handle_standard_args(${_LIB}-library REQUIRED_VARS ${_LIB}_LIBRARY)
if(${_LIB}_LIBRARY)
target_link_libraries(omnitrace-threading INTERFACE ${${_LIB}_LIBRARY})
target_link_libraries(rocprofiler-systems-threading INTERFACE ${${_LIB}_LIBRARY})
endif()
endforeach()
@@ -116,15 +131,16 @@ endforeach()
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_USE_HIP
OR OMNITRACE_USE_ROCTRACER
OR OMNITRACE_USE_ROCPROFILER
OR OMNITRACE_USE_ROCM_SMI)
if(ROCPROFSYS_USE_HIP
OR ROCPROFSYS_USE_ROCTRACER
OR ROCPROFSYS_USE_ROCPROFILER
OR ROCPROFSYS_USE_ROCM_SMI)
find_package(ROCmVersion)
if(NOT ROCmVersion_FOUND)
find_package(hip ${omnitrace_FIND_QUIETLY} REQUIRED HINTS
${OMNITRACE_DEFAULT_ROCM_PATH} PATHS ${OMNITRACE_DEFAULT_ROCM_PATH})
find_package(
hip ${rocprofiler_systems_FIND_QUIETLY} REQUIRED HINTS
${ROCPROFSYS_DEFAULT_ROCM_PATH} PATHS ${ROCPROFSYS_DEFAULT_ROCM_PATH})
if(SPACK_BUILD)
find_package(ROCmVersion HINTS ${ROCM_PATH} PATHS ${ROCM_PATH})
else()
@@ -147,14 +163,14 @@ if(OMNITRACE_USE_HIP
list(APPEND CMAKE_PREFIX_PATH ${ROCmVersion_DIR})
endif()
set(OMNITRACE_ROCM_VERSION ${ROCmVersion_FULL_VERSION})
set(OMNITRACE_HIP_VERSION_MAJOR ${ROCmVersion_MAJOR_VERSION})
set(OMNITRACE_HIP_VERSION_MINOR ${ROCmVersion_MINOR_VERSION})
set(OMNITRACE_HIP_VERSION_PATCH ${ROCmVersion_PATCH_VERSION})
set(OMNITRACE_HIP_VERSION ${ROCmVersion_TRIPLE_VERSION})
set(ROCPROFSYS_ROCM_VERSION ${ROCmVersion_FULL_VERSION})
set(ROCPROFSYS_HIP_VERSION_MAJOR ${ROCmVersion_MAJOR_VERSION})
set(ROCPROFSYS_HIP_VERSION_MINOR ${ROCmVersion_MINOR_VERSION})
set(ROCPROFSYS_HIP_VERSION_PATCH ${ROCmVersion_PATCH_VERSION})
set(ROCPROFSYS_HIP_VERSION ${ROCmVersion_TRIPLE_VERSION})
if(OMNITRACE_HIP_VERSION_MAJOR GREATER_EQUAL 4 AND OMNITRACE_HIP_VERSION_MINOR
GREATER 3)
if(ROCPROFSYS_HIP_VERSION_MAJOR GREATER_EQUAL 4 AND ROCPROFSYS_HIP_VERSION_MINOR
GREATER 3)
set(roctracer_kfdwrapper_LIBRARY)
endif()
@@ -162,12 +178,13 @@ if(OMNITRACE_USE_HIP
set(roctracer_kfdwrapper_LIBRARY)
endif()
omnitrace_add_feature(OMNITRACE_ROCM_VERSION "ROCm version used by omnitrace")
rocprofiler_systems_add_feature(ROCPROFSYS_ROCM_VERSION
"ROCm version used by rocprofiler-systems")
else()
set(OMNITRACE_HIP_VERSION "0.0.0")
set(OMNITRACE_HIP_VERSION_MAJOR 0)
set(OMNITRACE_HIP_VERSION_MINOR 0)
set(OMNITRACE_HIP_VERSION_PATCH 0)
set(ROCPROFSYS_HIP_VERSION "0.0.0")
set(ROCPROFSYS_HIP_VERSION_MAJOR 0)
set(ROCPROFSYS_HIP_VERSION_MINOR 0)
set(ROCPROFSYS_HIP_VERSION_PATCH 0)
endif()
# ----------------------------------------------------------------------------------------#
@@ -176,10 +193,11 @@ endif()
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_USE_HIP)
find_package(hip ${omnitrace_FIND_QUIETLY} REQUIRED)
omnitrace_target_compile_definitions(omnitrace-hip INTERFACE OMNITRACE_USE_HIP)
target_link_libraries(omnitrace-hip INTERFACE hip::host)
if(ROCPROFSYS_USE_HIP)
find_package(hip ${rocprofiler_systems_FIND_QUIETLY} REQUIRED)
rocprofiler_systems_target_compile_definitions(rocprofiler-systems-hip
INTERFACE ROCPROFSYS_USE_HIP)
target_link_libraries(rocprofiler-systems-hip INTERFACE hip::host)
endif()
# ----------------------------------------------------------------------------------------#
@@ -188,12 +206,13 @@ endif()
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_USE_ROCTRACER)
find_package(roctracer ${omnitrace_FIND_QUIETLY} REQUIRED)
omnitrace_target_compile_definitions(omnitrace-roctracer
INTERFACE OMNITRACE_USE_ROCTRACER)
target_link_libraries(omnitrace-roctracer INTERFACE roctracer::roctracer
omnitrace::omnitrace-hip)
if(ROCPROFSYS_USE_ROCTRACER)
find_package(roctracer ${rocprofiler_systems_FIND_QUIETLY} REQUIRED)
rocprofiler_systems_target_compile_definitions(rocprofiler-systems-roctracer
INTERFACE ROCPROFSYS_USE_ROCTRACER)
target_link_libraries(
rocprofiler-systems-roctracer
INTERFACE roctracer::roctracer rocprofiler-systems::rocprofiler-systems-hip)
endif()
# ----------------------------------------------------------------------------------------#
@@ -201,11 +220,12 @@ endif()
# rocprofiler
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_USE_ROCPROFILER)
find_package(rocprofiler ${omnitrace_FIND_QUIETLY} REQUIRED)
omnitrace_target_compile_definitions(omnitrace-rocprofiler
INTERFACE OMNITRACE_USE_ROCPROFILER)
target_link_libraries(omnitrace-rocprofiler INTERFACE rocprofiler::rocprofiler)
if(ROCPROFSYS_USE_ROCPROFILER)
find_package(rocprofiler ${rocprofiler_systems_FIND_QUIETLY} REQUIRED)
rocprofiler_systems_target_compile_definitions(rocprofiler-systems-rocprofiler
INTERFACE ROCPROFSYS_USE_ROCPROFILER)
target_link_libraries(rocprofiler-systems-rocprofiler
INTERFACE rocprofiler::rocprofiler)
endif()
# ----------------------------------------------------------------------------------------#
@@ -214,11 +234,11 @@ endif()
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_USE_ROCM_SMI)
find_package(rocm-smi ${omnitrace_FIND_QUIETLY} REQUIRED)
omnitrace_target_compile_definitions(omnitrace-rocm-smi
INTERFACE OMNITRACE_USE_ROCM_SMI)
target_link_libraries(omnitrace-rocm-smi INTERFACE rocm-smi::rocm-smi)
if(ROCPROFSYS_USE_ROCM_SMI)
find_package(rocm-smi ${rocprofiler_systems_FIND_QUIETLY} REQUIRED)
rocprofiler_systems_target_compile_definitions(rocprofiler-systems-rocm-smi
INTERFACE ROCPROFSYS_USE_ROCM_SMI)
target_link_libraries(rocprofiler-systems-rocm-smi INTERFACE rocm-smi::rocm-smi)
endif()
# ----------------------------------------------------------------------------------------#
@@ -227,10 +247,11 @@ endif()
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_USE_RCCL)
find_package(RCCL-Headers ${omnitrace_FIND_QUIETLY} REQUIRED)
target_link_libraries(omnitrace-rccl INTERFACE roc::rccl-headers)
omnitrace_target_compile_definitions(omnitrace-rccl INTERFACE OMNITRACE_USE_RCCL)
if(ROCPROFSYS_USE_RCCL)
find_package(RCCL-Headers ${rocprofiler_systems_FIND_QUIETLY} REQUIRED)
target_link_libraries(rocprofiler-systems-rccl INTERFACE roc::rccl-headers)
rocprofiler_systems_target_compile_definitions(rocprofiler-systems-rccl
INTERFACE ROCPROFSYS_USE_RCCL)
endif()
# ----------------------------------------------------------------------------------------#
@@ -240,18 +261,19 @@ endif()
# ----------------------------------------------------------------------------------------#
# suppress warning during CI that MPI_HEADERS_ALLOW_MPICH was unused
set(_OMNITRACE_MPI_HEADERS_ALLOW_MPICH ${MPI_HEADERS_ALLOW_MPICH})
set(_ROCPROFSYS_MPI_HEADERS_ALLOW_MPICH ${MPI_HEADERS_ALLOW_MPICH})
if(OMNITRACE_USE_MPI)
find_package(MPI ${omnitrace_FIND_QUIETLY} REQUIRED)
target_link_libraries(omnitrace-mpi INTERFACE MPI::MPI_C MPI::MPI_CXX)
omnitrace_target_compile_definitions(omnitrace-mpi INTERFACE TIMEMORY_USE_MPI=1
OMNITRACE_USE_MPI)
elseif(OMNITRACE_USE_MPI_HEADERS)
find_package(MPI-Headers ${omnitrace_FIND_QUIETLY} REQUIRED)
omnitrace_target_compile_definitions(
omnitrace-mpi INTERFACE TIMEMORY_USE_MPI_HEADERS=1 OMNITRACE_USE_MPI_HEADERS)
target_link_libraries(omnitrace-mpi INTERFACE MPI::MPI_HEADERS)
if(ROCPROFSYS_USE_MPI)
find_package(MPI ${rocprofiler_systems_FIND_QUIETLY} REQUIRED)
target_link_libraries(rocprofiler-systems-mpi INTERFACE MPI::MPI_C MPI::MPI_CXX)
rocprofiler_systems_target_compile_definitions(
rocprofiler-systems-mpi INTERFACE TIMEMORY_USE_MPI=1 ROCPROFSYS_USE_MPI)
elseif(ROCPROFSYS_USE_MPI_HEADERS)
find_package(MPI-Headers ${rocprofiler_systems_FIND_QUIETLY} REQUIRED)
rocprofiler_systems_target_compile_definitions(
rocprofiler-systems-mpi INTERFACE TIMEMORY_USE_MPI_HEADERS=1
ROCPROFSYS_USE_MPI_HEADERS)
target_link_libraries(rocprofiler-systems-mpi INTERFACE MPI::MPI_HEADERS)
endif()
# ----------------------------------------------------------------------------------------#
@@ -260,8 +282,8 @@ endif()
#
# ----------------------------------------------------------------------------------------#
omnitrace_target_compile_definitions(
omnitrace-ompt INTERFACE OMNITRACE_USE_OMPT=$<BOOL:${OMNITRACE_USE_OMPT}>)
rocprofiler_systems_target_compile_definitions(
rocprofiler-systems-ompt INTERFACE ROCPROFSYS_USE_OMPT=$<BOOL:${ROCPROFSYS_USE_OMPT}>)
# ----------------------------------------------------------------------------------------#
#
@@ -271,10 +293,11 @@ omnitrace_target_compile_definitions(
include(ElfUtils)
target_include_directories(omnitrace-elfutils SYSTEM INTERFACE ${ElfUtils_INCLUDE_DIRS})
target_compile_definitions(omnitrace-elfutils INTERFACE ${ElfUtils_DEFINITIONS})
target_link_directories(omnitrace-elfutils INTERFACE ${ElfUtils_LIBRARY_DIRS})
target_link_libraries(omnitrace-elfutils INTERFACE ${ElfUtils_LIBRARIES})
target_include_directories(rocprofiler-systems-elfutils SYSTEM
INTERFACE ${ElfUtils_INCLUDE_DIRS})
target_compile_definitions(rocprofiler-systems-elfutils INTERFACE ${ElfUtils_DEFINITIONS})
target_link_directories(rocprofiler-systems-elfutils INTERFACE ${ElfUtils_LIBRARY_DIRS})
target_link_libraries(rocprofiler-systems-elfutils INTERFACE ${ElfUtils_LIBRARIES})
# ----------------------------------------------------------------------------------------#
#
@@ -282,8 +305,8 @@ target_link_libraries(omnitrace-elfutils INTERFACE ${ElfUtils_LIBRARIES})
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_BUILD_DYNINST)
omnitrace_checkout_git_submodule(
if(ROCPROFSYS_BUILD_DYNINST)
rocprofiler_systems_checkout_git_submodule(
RELATIVE_PATH external/dyninst
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/jrmadsen/dyninst.git
@@ -316,21 +339,22 @@ if(OMNITRACE_BUILD_DYNINST)
set(CMAKE_BUILD_RPATH "")
endif()
omnitrace_save_variables(
rocprofiler_systems_save_variables(
PIC VARIABLES CMAKE_POSITION_INDEPENDENT_CODE CMAKE_INSTALL_RPATH
CMAKE_BUILD_RPATH CMAKE_INSTALL_RPATH_USE_LINK_PATH)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
set(CMAKE_BUILD_RPATH "\$ORIGIN:\$ORIGIN/omnitrace")
set(CMAKE_INSTALL_RPATH "\$ORIGIN:\$ORIGIN/omnitrace")
set(CMAKE_BUILD_RPATH "\$ORIGIN:\$ORIGIN/${PROJECT_NAME}")
set(CMAKE_INSTALL_RPATH "\$ORIGIN:\$ORIGIN/${PROJECT_NAME}")
set(DYNINST_TPL_INSTALL_PREFIX
"omnitrace"
"${PROJECT_NAME}"
CACHE PATH "Third-party library install-tree install prefix" FORCE)
set(DYNINST_TPL_INSTALL_LIB_DIR
"omnitrace"
"${PROJECT_NAME}"
CACHE PATH "Third-party library install-tree install library prefix" FORCE)
add_subdirectory(external/dyninst EXCLUDE_FROM_ALL)
omnitrace_restore_variables(
rocprofiler_systems_restore_variables(
PIC VARIABLES CMAKE_POSITION_INDEPENDENT_CODE CMAKE_INSTALL_RPATH
CMAKE_BUILD_RPATH CMAKE_INSTALL_RPATH_USE_LINK_PATH)
@@ -354,35 +378,37 @@ if(OMNITRACE_BUILD_DYNINST)
if(TARGET ${_LIB})
install(
TARGETS ${_LIB}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/omnitrace
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT dyninst
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/omnitrace/dyninst)
PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/dyninst)
endif()
endforeach()
# for packaging
install(
DIRECTORY ${DYNINST_TPL_STAGING_PREFIX}/lib/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/omnitrace
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT dyninst
FILES_MATCHING
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
target_link_libraries(omnitrace-dyninst INTERFACE Dyninst::Dyninst)
target_link_libraries(rocprofiler-systems-dyninst INTERFACE Dyninst::Dyninst)
else()
find_package(Dyninst ${omnitrace_FIND_QUIETLY} REQUIRED
find_package(Dyninst ${rocprofiler_systems_FIND_QUIETLY} REQUIRED
COMPONENTS dyninstAPI parseAPI instructionAPI symtabAPI)
if(TARGET Dyninst::Dyninst) # updated Dyninst CMake system was found
target_link_libraries(omnitrace-dyninst INTERFACE Dyninst::Dyninst)
target_link_libraries(rocprofiler-systems-dyninst INTERFACE Dyninst::Dyninst)
else() # updated Dyninst CMake system was not found
set(_BOOST_COMPONENTS atomic system thread date_time)
set(omnitrace_BOOST_COMPONENTS
set(rocprofiler_systems_BOOST_COMPONENTS
"${_BOOST_COMPONENTS}"
CACHE STRING "Boost components used by Dyninst in omnitrace")
CACHE STRING "Boost components used by Dyninst in rocprofiler-systems")
set(Boost_NO_BOOST_CMAKE ON)
find_package(Boost QUIET REQUIRED COMPONENTS ${omnitrace_BOOST_COMPONENTS})
find_package(Boost QUIET REQUIRED
COMPONENTS ${rocprofiler_systems_BOOST_COMPONENTS})
# some installs of dyninst don't set this properly
if(EXISTS "${DYNINST_INCLUDE_DIR}" AND NOT DYNINST_HEADER_DIR)
@@ -413,8 +439,8 @@ else()
PATH_SUFFIXES include)
endif()
target_link_libraries(omnitrace-dyninst INTERFACE ${DYNINST_LIBRARIES}
${Boost_LIBRARIES})
target_link_libraries(rocprofiler-systems-dyninst INTERFACE ${DYNINST_LIBRARIES}
${Boost_LIBRARIES})
foreach(
_TARG
dyninst
@@ -429,18 +455,20 @@ else()
date_time
TBB)
if(TARGET Dyninst::${_TARG})
target_link_libraries(omnitrace-dyninst INTERFACE Dyninst::${_TARG})
target_link_libraries(rocprofiler-systems-dyninst
INTERFACE Dyninst::${_TARG})
elseif(TARGET Boost::${_TARG})
target_link_libraries(omnitrace-dyninst INTERFACE Boost::${_TARG})
target_link_libraries(rocprofiler-systems-dyninst
INTERFACE Boost::${_TARG})
elseif(TARGET ${_TARG})
target_link_libraries(omnitrace-dyninst INTERFACE ${_TARG})
target_link_libraries(rocprofiler-systems-dyninst INTERFACE ${_TARG})
endif()
endforeach()
target_include_directories(
omnitrace-dyninst SYSTEM INTERFACE ${TBB_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}
${DYNINST_HEADER_DIR})
omnitrace_target_compile_definitions(omnitrace-dyninst
INTERFACE OMNITRACE_USE_DYNINST)
rocprofiler-systems-dyninst SYSTEM
INTERFACE ${TBB_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${DYNINST_HEADER_DIR})
rocprofiler_systems_target_compile_definitions(rocprofiler-systems-dyninst
INTERFACE ROCPROFSYS_USE_DYNINST)
endif()
endif()
@@ -450,25 +478,25 @@ endif()
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_BUILD_STATIC_LIBGCC)
if(ROCPROFSYS_BUILD_STATIC_LIBGCC)
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
omnitrace_save_variables(STATIC_LIBGCC_C VARIABLES CMAKE_C_FLAGS)
rocprofiler_systems_save_variables(STATIC_LIBGCC_C VARIABLES CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
omnitrace_save_variables(STATIC_LIBGCC_CXX VARIABLES CMAKE_CXX_FLAGS)
rocprofiler_systems_save_variables(STATIC_LIBGCC_CXX VARIABLES CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc")
else()
set(OMNITRACE_BUILD_STATIC_LIBGCC OFF)
set(ROCPROFSYS_BUILD_STATIC_LIBGCC OFF)
endif()
endif()
if(OMNITRACE_BUILD_STATIC_LIBSTDCXX)
if(ROCPROFSYS_BUILD_STATIC_LIBSTDCXX)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
omnitrace_save_variables(STATIC_LIBSTDCXX_CXX VARIABLES CMAKE_CXX_FLAGS)
rocprofiler_systems_save_variables(STATIC_LIBSTDCXX_CXX VARIABLES CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
else()
set(OMNITRACE_BUILD_STATIC_LIBSTDCXX OFF)
set(ROCPROFSYS_BUILD_STATIC_LIBSTDCXX OFF)
endif()
endif()
@@ -479,7 +507,7 @@ endif()
# ----------------------------------------------------------------------------------------#
set(perfetto_DIR ${PROJECT_SOURCE_DIR}/external/perfetto)
omnitrace_checkout_git_submodule(
rocprofiler_systems_checkout_git_submodule(
RELATIVE_PATH external/perfetto
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/google/perfetto.git
@@ -494,8 +522,8 @@ include(Perfetto)
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_BUILD_DEVICETRACE)
omnitrace_checkout_git_submodule(
if(ROCPROFSYS_BUILD_DEVICETRACE)
rocprofiler_systems_checkout_git_submodule(
RELATIVE_PATH external/elfio
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/jrmadsen/ELFIO.git
@@ -510,7 +538,7 @@ endif()
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_USE_PAPI AND OMNITRACE_BUILD_PAPI)
if(ROCPROFSYS_USE_PAPI AND ROCPROFSYS_BUILD_PAPI)
include(PAPI)
endif()
@@ -521,22 +549,23 @@ endif()
# ----------------------------------------------------------------------------------------#
target_compile_definitions(
omnitrace-timemory-config
rocprofiler-systems-timemory-config
INTERFACE TIMEMORY_PAPI_ARRAY_SIZE=12 TIMEMORY_USE_ROOFLINE=0 TIMEMORY_USE_ERT=0
TIMEMORY_USE_CONTAINERS=0 TIMEMORY_USE_ERT_EXTERN=0
TIMEMORY_USE_CONTAINERS_EXTERN=0)
if(OMNITRACE_BUILD_STACK_PROTECTOR)
add_target_flag_if_avail(omnitrace-timemory-config "-fstack-protector-strong"
"-Wstack-protector")
if(ROCPROFSYS_BUILD_STACK_PROTECTOR)
add_target_flag_if_avail(rocprofiler-systems-timemory-config
"-fstack-protector-strong" "-Wstack-protector")
endif()
if(OMNITRACE_BUILD_DEBUG)
add_target_flag_if_avail(omnitrace-timemory-config "-fno-omit-frame-pointer" "-g3")
if(ROCPROFSYS_BUILD_DEBUG)
add_target_flag_if_avail(rocprofiler-systems-timemory-config
"-fno-omit-frame-pointer" "-g3")
endif()
set(TIMEMORY_EXTERNAL_INTERFACE_LIBRARY
omnitrace-timemory-config
rocprofiler-systems-timemory-config
CACHE STRING "timemory configuration interface library")
set(TIMEMORY_INSTALL_HEADERS
OFF
@@ -571,7 +600,7 @@ set(TIMEMORY_QUIET_CONFIG
# timemory feature settings
set(TIMEMORY_USE_MPI
${OMNITRACE_USE_MPI}
${ROCPROFSYS_USE_MPI}
CACHE BOOL "Enable MPI support in timemory" FORCE)
set(TIMEMORY_USE_GOTCHA
ON
@@ -580,13 +609,13 @@ set(TIMEMORY_USE_PERFETTO
OFF
CACHE BOOL "Disable perfetto support in timemory")
set(TIMEMORY_USE_OMPT
${OMNITRACE_USE_OMPT}
${ROCPROFSYS_USE_OMPT}
CACHE BOOL "Enable OMPT support in timemory" FORCE)
set(TIMEMORY_USE_PAPI
${OMNITRACE_USE_PAPI}
${ROCPROFSYS_USE_PAPI}
CACHE BOOL "Enable PAPI support in timemory" FORCE)
set(TIMEMORY_USE_BFD
${OMNITRACE_USE_BFD}
${ROCPROFSYS_USE_BFD}
CACHE BOOL "Enable BFD support in timemory" FORCE)
set(TIMEMORY_USE_LIBUNWIND
ON
@@ -595,14 +624,14 @@ set(TIMEMORY_USE_VISIBILITY
OFF
CACHE BOOL "Enable/disable using visibility decorations")
set(TIMEMORY_USE_SANITIZER
${OMNITRACE_USE_SANITIZER}
CACHE BOOL "Build with -fsanitze=\${OMNITRACE_SANITIZER_TYPE}" FORCE)
${ROCPROFSYS_USE_SANITIZER}
CACHE BOOL "Build with -fsanitze=\${ROCPROFSYS_SANITIZER_TYPE}" FORCE)
set(TIMEMORY_SANITIZER_TYPE
${OMNITRACE_SANITIZER_TYPE}
${ROCPROFSYS_SANITIZER_TYPE}
CACHE STRING "Sanitizer type, e.g. leak, thread, address, memory, etc." FORCE)
if(DEFINED TIMEMORY_BUILD_GOTCHA AND NOT TIMEMORY_BUILD_GOTCHA)
omnitrace_message(
rocprofiler_systems_message(
FATAL_ERROR
"Using an external gotcha is not allowed due to known bug that has not been accepted upstream"
)
@@ -613,10 +642,10 @@ set(TIMEMORY_BUILD_GOTCHA
ON
CACHE BOOL "Enable building GOTCHA library from submodule" FORCE)
set(TIMEMORY_BUILD_LIBUNWIND
${OMNITRACE_BUILD_LIBUNWIND}
${ROCPROFSYS_BUILD_LIBUNWIND}
CACHE BOOL "Enable building libunwind library from submodule" FORCE)
set(TIMEMORY_BUILD_EXTRA_OPTIMIZATIONS
${OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS}
${ROCPROFSYS_BUILD_EXTRA_OPTIMIZATIONS}
CACHE BOOL "Enable building GOTCHA library from submodule" FORCE)
set(TIMEMORY_BUILD_ERT
OFF
@@ -630,13 +659,13 @@ set(TIMEMORY_TLS_MODEL
"global-dynamic"
CACHE STRING "Thread-local static model" FORCE)
set(TIMEMORY_MAX_THREADS
"${OMNITRACE_MAX_THREADS}"
"${ROCPROFSYS_MAX_THREADS}"
CACHE STRING "Max statically-allocated threads" FORCE)
set(TIMEMORY_SETTINGS_PREFIX
"OMNITRACE_"
"ROCPROFSYS_"
CACHE STRING "Prefix used for settings and environment variables")
set(TIMEMORY_PROJECT_NAME
"omnitrace"
"rocprofiler-systems"
CACHE STRING "Name for configuration")
set(TIMEMORY_CXX_LIBRARY_EXCLUDE
"kokkosp.cpp;pthread.cpp;timemory_c.cpp;trace.cpp;weak.cpp;library.cpp"
@@ -645,13 +674,13 @@ set(TIMEMORY_CXX_LIBRARY_EXCLUDE
mark_as_advanced(TIMEMORY_SETTINGS_PREFIX)
mark_as_advanced(TIMEMORY_PROJECT_NAME)
omnitrace_checkout_git_submodule(
rocprofiler_systems_checkout_git_submodule(
RELATIVE_PATH external/timemory
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/NERSC/timemory.git
REPO_BRANCH omnitrace)
omnitrace_save_variables(
rocprofiler_systems_save_variables(
BUILD_CONFIG VARIABLES BUILD_SHARED_LIBS BUILD_STATIC_LIBS
CMAKE_POSITION_INDEPENDENT_CODE CMAKE_PREFIX_PATH)
@@ -673,45 +702,47 @@ add_subdirectory(external/timemory EXCLUDE_FROM_ALL)
install(
TARGETS gotcha
DESTINATION ${CMAKE_INSTALL_LIBDIR}/omnitrace
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT gotcha)
if(OMNITRACE_BUILD_LIBUNWIND)
if(ROCPROFSYS_BUILD_LIBUNWIND)
install(
DIRECTORY ${PROJECT_BINARY_DIR}/external/timemory/external/libunwind/install/lib/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/omnitrace
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT libunwind
FILES_MATCHING
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
endif()
omnitrace_restore_variables(
rocprofiler_systems_restore_variables(
BUILD_CONFIG VARIABLES BUILD_SHARED_LIBS BUILD_STATIC_LIBS
CMAKE_POSITION_INDEPENDENT_CODE CMAKE_PREFIX_PATH)
if(TARGET omnitrace-papi-build)
if(TARGET rocprofiler-systems-papi-build)
foreach(_TARGET PAPI::papi timemory-core timemory-common timemory-papi-component
timemory-cxx)
if(TARGET "${_TARGET}")
add_dependencies(${_TARGET} omnitrace-papi-build)
add_dependencies(${_TARGET} rocprofiler-systems-papi-build)
endif()
foreach(_LINK shared static)
if(TARGET "${_TARGET}-${_LINK}")
add_dependencies(${_TARGET}-${_LINK} omnitrace-papi-build)
add_dependencies(${_TARGET}-${_LINK} rocprofiler-systems-papi-build)
endif()
endforeach()
endforeach()
endif()
target_link_libraries(
omnitrace-timemory
rocprofiler-systems-timemory
INTERFACE $<BUILD_INTERFACE:timemory::timemory-headers>
$<BUILD_INTERFACE:timemory::timemory-gotcha>
$<BUILD_INTERFACE:timemory::timemory-cxx-static>)
target_link_libraries(omnitrace-bfd INTERFACE $<BUILD_INTERFACE:timemory::timemory-bfd>)
target_link_libraries(rocprofiler-systems-bfd
INTERFACE $<BUILD_INTERFACE:timemory::timemory-bfd>)
if(OMNITRACE_USE_BFD)
omnitrace_target_compile_definitions(omnitrace-bfd INTERFACE OMNITRACE_USE_BFD)
if(ROCPROFSYS_USE_BFD)
rocprofiler_systems_target_compile_definitions(rocprofiler-systems-bfd
INTERFACE ROCPROFSYS_USE_BFD)
endif()
# ----------------------------------------------------------------------------------------#
@@ -722,7 +753,7 @@ endif()
# timemory might provide PTL::ptl-shared
if(NOT TARGET PTL::ptl-shared)
omnitrace_checkout_git_submodule(
rocprofiler_systems_checkout_git_submodule(
RELATIVE_PATH external/PTL
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/jrmadsen/PTL.git
@@ -736,7 +767,7 @@ if(NOT TARGET PTL::ptl-shared)
if(NOT DEFINED BUILD_OBJECT_LIBS)
set(BUILD_OBJECT_LIBS OFF)
endif()
omnitrace_save_variables(
rocprofiler_systems_save_variables(
BUILD_CONFIG
VARIABLES BUILD_SHARED_LIBS BUILD_STATIC_LIBS BUILD_OBJECT_LIBS
CMAKE_POSITION_INDEPENDENT_CODE CMAKE_CXX_VISIBILITY_PRESET
@@ -751,18 +782,19 @@ if(NOT TARGET PTL::ptl-shared)
add_subdirectory(external/PTL EXCLUDE_FROM_ALL)
omnitrace_restore_variables(
rocprofiler_systems_restore_variables(
BUILD_CONFIG
VARIABLES BUILD_SHARED_LIBS BUILD_STATIC_LIBS BUILD_OBJECT_LIBS
CMAKE_POSITION_INDEPENDENT_CODE CMAKE_CXX_VISIBILITY_PRESET
CMAKE_VISIBILITY_INLINES_HIDDEN)
endif()
target_sources(omnitrace-ptl
target_sources(rocprofiler-systems-ptl
INTERFACE $<BUILD_INTERFACE:$<TARGET_OBJECTS:PTL::ptl-object>>)
target_include_directories(
omnitrace-ptl INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/PTL/source>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/external/PTL/source>)
rocprofiler-systems-ptl
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/PTL/source>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/external/PTL/source>)
# ----------------------------------------------------------------------------------------#
#
@@ -773,23 +805,24 @@ target_include_directories(
# override compiler macros
include(Compilers)
if(OMNITRACE_BUILD_STATIC_LIBSTDCXX)
if(ROCPROFSYS_BUILD_STATIC_LIBSTDCXX)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
omnitrace_restore_variables(STATIC_LIBSTDCXX_CXX VARIABLES CMAKE_CXX_FLAGS)
rocprofiler_systems_restore_variables(STATIC_LIBSTDCXX_CXX
VARIABLES CMAKE_CXX_FLAGS)
endif()
endif()
if(OMNITRACE_BUILD_STATIC_LIBGCC)
if(ROCPROFSYS_BUILD_STATIC_LIBGCC)
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
omnitrace_restore_variables(STATIC_LIBGCC_C VARIABLES CMAKE_C_FLAGS)
rocprofiler_systems_restore_variables(STATIC_LIBGCC_C VARIABLES CMAKE_C_FLAGS)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
omnitrace_restore_variables(STATIC_LIBGCC_CXX VARIABLES CMAKE_CXX_FLAGS)
rocprofiler_systems_restore_variables(STATIC_LIBGCC_CXX VARIABLES CMAKE_CXX_FLAGS)
endif()
endif()
omnitrace_add_feature(CMAKE_C_FLAGS "C compiler flags")
omnitrace_add_feature(CMAKE_CXX_FLAGS "C++ compiler flags")
rocprofiler_systems_add_feature(CMAKE_C_FLAGS "C compiler flags")
rocprofiler_systems_add_feature(CMAKE_CXX_FLAGS "C++ compiler flags")
# ----------------------------------------------------------------------------------------#
#
@@ -797,64 +830,64 @@ omnitrace_add_feature(CMAKE_CXX_FLAGS "C++ compiler flags")
#
# ----------------------------------------------------------------------------------------#
if(OMNITRACE_USE_PYTHON)
if(OMNITRACE_USE_PYTHON AND NOT OMNITRACE_BUILD_PYTHON)
if(ROCPROFSYS_USE_PYTHON)
if(ROCPROFSYS_USE_PYTHON AND NOT ROCPROFSYS_BUILD_PYTHON)
find_package(pybind11 REQUIRED)
endif()
include(ConfigPython)
include(PyBind11Tools)
omnitrace_watch_for_change(OMNITRACE_PYTHON_ROOT_DIRS _PYTHON_DIRS_CHANGED)
rocprofiler_systems_watch_for_change(ROCPROFSYS_PYTHON_ROOT_DIRS _PYTHON_DIRS_CHANGED)
if(_PYTHON_DIRS_CHANGED)
unset(OMNITRACE_PYTHON_VERSION CACHE)
unset(OMNITRACE_PYTHON_VERSIONS CACHE)
unset(OMNITRACE_INSTALL_PYTHONDIR CACHE)
unset(ROCPROFSYS_PYTHON_VERSION CACHE)
unset(ROCPROFSYS_PYTHON_VERSIONS CACHE)
unset(ROCPROFSYS_INSTALL_PYTHONDIR CACHE)
else()
foreach(_VAR PREFIX ENVS)
omnitrace_watch_for_change(OMNITRACE_PYTHON_${_VAR} _CHANGED)
rocprofiler_systems_watch_for_change(ROCPROFSYS_PYTHON_${_VAR} _CHANGED)
if(_CHANGED)
unset(OMNITRACE_PYTHON_ROOT_DIRS CACHE)
unset(OMNITRACE_PYTHON_VERSIONS CACHE)
unset(OMNITRACE_INSTALL_PYTHONDIR CACHE)
unset(ROCPROFSYS_PYTHON_ROOT_DIRS CACHE)
unset(ROCPROFSYS_PYTHON_VERSIONS CACHE)
unset(ROCPROFSYS_INSTALL_PYTHONDIR CACHE)
break()
endif()
endforeach()
endif()
if(OMNITRACE_PYTHON_PREFIX AND OMNITRACE_PYTHON_ENVS)
omnitrace_directory(
if(ROCPROFSYS_PYTHON_PREFIX AND ROCPROFSYS_PYTHON_ENVS)
rocprofiler_systems_directory(
FAIL
PREFIX ${OMNITRACE_PYTHON_PREFIX}
PATHS ${OMNITRACE_PYTHON_ENVS}
PREFIX ${ROCPROFSYS_PYTHON_PREFIX}
PATHS ${ROCPROFSYS_PYTHON_ENVS}
OUTPUT_VARIABLE _PYTHON_ROOT_DIRS)
set(OMNITRACE_PYTHON_ROOT_DIRS
set(ROCPROFSYS_PYTHON_ROOT_DIRS
"${_PYTHON_ROOT_DIRS}"
CACHE INTERNAL "Root directories for python")
endif()
if(NOT OMNITRACE_PYTHON_VERSIONS AND OMNITRACE_PYTHON_VERSION)
set(OMNITRACE_PYTHON_VERSIONS "${OMNITRACE_PYTHON_VERSION}")
if(NOT ROCPROFSYS_PYTHON_VERSIONS AND ROCPROFSYS_PYTHON_VERSION)
set(ROCPROFSYS_PYTHON_VERSIONS "${ROCPROFSYS_PYTHON_VERSION}")
if(NOT OMNITRACE_PYTHON_ROOT_DIRS)
omnitrace_find_python(_PY VERSION ${OMNITRACE_PYTHON_VERSION})
set(OMNITRACE_PYTHON_ROOT_DIRS
if(NOT ROCPROFSYS_PYTHON_ROOT_DIRS)
rocprofiler_systems_find_python(_PY VERSION ${ROCPROFSYS_PYTHON_VERSION})
set(ROCPROFSYS_PYTHON_ROOT_DIRS
"${_PY_ROOT_DIR}"
CACHE INTERNAL "" FORCE)
endif()
unset(OMNITRACE_PYTHON_VERSION CACHE)
unset(OMNITRACE_INSTALL_PYTHONDIR CACHE)
unset(ROCPROFSYS_PYTHON_VERSION CACHE)
unset(ROCPROFSYS_INSTALL_PYTHONDIR CACHE)
elseif(
NOT OMNITRACE_PYTHON_VERSIONS
AND NOT OMNITRACE_PYTHON_VERSION
AND OMNITRACE_PYTHON_ROOT_DIRS)
NOT ROCPROFSYS_PYTHON_VERSIONS
AND NOT ROCPROFSYS_PYTHON_VERSION
AND ROCPROFSYS_PYTHON_ROOT_DIRS)
set(_PY_VERSIONS)
foreach(_DIR ${OMNITRACE_PYTHON_ROOT_DIRS})
omnitrace_find_python(_PY ROOT_DIR ${_DIR})
foreach(_DIR ${ROCPROFSYS_PYTHON_ROOT_DIRS})
rocprofiler_systems_find_python(_PY ROOT_DIR ${_DIR})
if(NOT _PY_FOUND)
continue()
@@ -865,46 +898,46 @@ if(OMNITRACE_USE_PYTHON)
endif()
endforeach()
set(OMNITRACE_PYTHON_VERSIONS
set(ROCPROFSYS_PYTHON_VERSIONS
"${_PY_VERSIONS}"
CACHE INTERNAL "" FORCE)
elseif(
NOT OMNITRACE_PYTHON_VERSIONS
AND NOT OMNITRACE_PYTHON_VERSION
AND NOT OMNITRACE_PYTHON_ROOT_DIRS)
omnitrace_find_python(_PY REQUIRED)
set(OMNITRACE_PYTHON_ROOT_DIRS
NOT ROCPROFSYS_PYTHON_VERSIONS
AND NOT ROCPROFSYS_PYTHON_VERSION
AND NOT ROCPROFSYS_PYTHON_ROOT_DIRS)
rocprofiler_systems_find_python(_PY REQUIRED)
set(ROCPROFSYS_PYTHON_ROOT_DIRS
"${_PY_ROOT_DIR}"
CACHE INTERNAL "" FORCE)
set(OMNITRACE_PYTHON_VERSIONS
set(ROCPROFSYS_PYTHON_VERSIONS
"${_PY_VERSION}"
CACHE INTERNAL "" FORCE)
endif()
omnitrace_watch_for_change(OMNITRACE_PYTHON_ROOT_DIRS)
omnitrace_watch_for_change(OMNITRACE_PYTHON_VERSIONS)
rocprofiler_systems_watch_for_change(ROCPROFSYS_PYTHON_ROOT_DIRS)
rocprofiler_systems_watch_for_change(ROCPROFSYS_PYTHON_VERSIONS)
omnitrace_check_python_dirs_and_versions(FAIL)
rocprofiler_systems_check_python_dirs_and_versions(FAIL)
list(LENGTH OMNITRACE_PYTHON_VERSIONS _NUM_PYTHON_VERSIONS)
list(LENGTH ROCPROFSYS_PYTHON_VERSIONS _NUM_PYTHON_VERSIONS)
if(_NUM_PYTHON_VERSIONS GREATER 1)
set(OMNITRACE_INSTALL_PYTHONDIR
set(ROCPROFSYS_INSTALL_PYTHONDIR
"${CMAKE_INSTALL_LIBDIR}/python/site-packages"
CACHE STRING "Installation prefix for python")
else()
set(OMNITRACE_INSTALL_PYTHONDIR
"${CMAKE_INSTALL_LIBDIR}/python${OMNITRACE_PYTHON_VERSIONS}/site-packages"
set(ROCPROFSYS_INSTALL_PYTHONDIR
"${CMAKE_INSTALL_LIBDIR}/python${ROCPROFSYS_PYTHON_VERSIONS}/site-packages"
CACHE STRING "Installation prefix for python")
endif()
else()
set(OMNITRACE_INSTALL_PYTHONDIR
set(ROCPROFSYS_INSTALL_PYTHONDIR
"${CMAKE_INSTALL_LIBDIR}/python/site-packages"
CACHE STRING "Installation prefix for python")
endif()
omnitrace_watch_for_change(OMNITRACE_INSTALL_PYTHONDIR)
set(CMAKE_INSTALL_PYTHONDIR ${OMNITRACE_INSTALL_PYTHONDIR})
rocprofiler_systems_watch_for_change(ROCPROFSYS_INSTALL_PYTHONDIR)
set(CMAKE_INSTALL_PYTHONDIR ${ROCPROFSYS_INSTALL_PYTHONDIR})
# ----------------------------------------------------------------------------------------#
#
@@ -912,19 +945,19 @@ set(CMAKE_INSTALL_PYTHONDIR ${OMNITRACE_INSTALL_PYTHONDIR})
#
# ----------------------------------------------------------------------------------------#
if("${CMAKE_BUILD_TYPE}" MATCHES "Release" AND NOT OMNITRACE_BUILD_DEBUG)
add_target_flag_if_avail(omnitrace-compile-options "-g1")
if("${CMAKE_BUILD_TYPE}" MATCHES "Release" AND NOT ROCPROFSYS_BUILD_DEBUG)
add_target_flag_if_avail(rocprofiler-systems-compile-options "-g1")
endif()
target_compile_definitions(omnitrace-compile-definitions
INTERFACE OMNITRACE_MAX_THREADS=${OMNITRACE_MAX_THREADS})
target_compile_definitions(rocprofiler-systems-compile-definitions
INTERFACE ROCPROFSYS_MAX_THREADS=${ROCPROFSYS_MAX_THREADS})
foreach(_LIB ${OMNITRACE_EXTENSION_LIBRARIES})
foreach(_LIB ${ROCPROFSYS_EXTENSION_LIBRARIES})
get_target_property(_COMPILE_DEFS ${_LIB} INTERFACE_COMPILE_DEFINITIONS)
if(_COMPILE_DEFS)
foreach(_DEF ${_COMPILE_DEFS})
if("${_DEF}" MATCHES "OMNITRACE_")
target_compile_definitions(omnitrace-compile-definitions
if("${_DEF}" MATCHES "ROCPROFSYS_")
target_compile_definitions(rocprofiler-systems-compile-definitions
INTERFACE ${_DEF})
endif()
endforeach()
@@ -1,7 +1,7 @@
# ======================================================================================
# Perfetto.cmake
#
# Configure perfetto for omnitrace
# Configure perfetto for rocprofiler-systems
#
# ======================================================================================
@@ -17,17 +17,17 @@ include(ProcessorCount)
# ---------------------------------------------------------------------------------------#
find_program(
OMNITRACE_COPY_EXECUTABLE
ROCPROFSYS_COPY_EXECUTABLE
NAMES cp
PATH_SUFFIXES bin)
find_program(
OMNITRACE_NINJA_EXECUTABLE
ROCPROFSYS_NINJA_EXECUTABLE
NAMES ninja
PATH_SUFFIXES bin)
mark_as_advanced(OMNITRACE_COPY_EXECUTABLE)
mark_as_advanced(OMNITRACE_NINJA_EXECUTABLE)
mark_as_advanced(ROCPROFSYS_COPY_EXECUTABLE)
mark_as_advanced(ROCPROFSYS_NINJA_EXECUTABLE)
# ---------------------------------------------------------------------------------------#
#
@@ -43,44 +43,44 @@ elseif(_NUM_THREADS LESS 1)
set(_NUM_THREADS 1)
endif()
set(OMNITRACE_PERFETTO_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/perfetto/source)
set(OMNITRACE_PERFETTO_TOOLS_DIR ${PROJECT_BINARY_DIR}/external/perfetto/source/tools)
set(OMNITRACE_PERFETTO_BINARY_DIR
set(ROCPROFSYS_PERFETTO_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/perfetto/source)
set(ROCPROFSYS_PERFETTO_TOOLS_DIR ${PROJECT_BINARY_DIR}/external/perfetto/source/tools)
set(ROCPROFSYS_PERFETTO_BINARY_DIR
${PROJECT_BINARY_DIR}/external/perfetto/source/out/linux)
set(OMNITRACE_PERFETTO_INSTALL_DIR
set(ROCPROFSYS_PERFETTO_INSTALL_DIR
${PROJECT_BINARY_DIR}/external/perfetto/source/out/linux/stripped)
set(OMNITRACE_PERFETTO_LINK_FLAGS
set(ROCPROFSYS_PERFETTO_LINK_FLAGS
"-static-libgcc"
CACHE STRING "Link flags for perfetto")
set(OMNITRACE_PERFETTO_BUILD_THREADS
set(ROCPROFSYS_PERFETTO_BUILD_THREADS
${_NUM_THREADS}
CACHE STRING "Number of threads to use when building perfetto tools")
if(CMAKE_CXX_COMPILER_IS_CLANG)
set(PERFETTO_IS_CLANG true)
set(OMNITRACE_PERFETTO_C_FLAGS
set(ROCPROFSYS_PERFETTO_C_FLAGS
""
CACHE STRING "Perfetto C flags")
set(OMNITRACE_PERFETTO_CXX_FLAGS
set(ROCPROFSYS_PERFETTO_CXX_FLAGS
""
CACHE STRING "Perfetto C++ flags")
else()
set(PERFETTO_IS_CLANG false)
set(OMNITRACE_PERFETTO_C_FLAGS
set(ROCPROFSYS_PERFETTO_C_FLAGS
"-static-libgcc -Wno-maybe-uninitialized -Wno-stringop-overflow"
CACHE STRING "Perfetto C flags")
set(OMNITRACE_PERFETTO_CXX_FLAGS
set(ROCPROFSYS_PERFETTO_CXX_FLAGS
"-static-libgcc -Wno-maybe-uninitialized -Wno-stringop-overflow -Wno-mismatched-new-delete"
CACHE STRING "Perfetto C++ flags")
endif()
mark_as_advanced(OMNITRACE_PERFETTO_C_FLAGS)
mark_as_advanced(OMNITRACE_PERFETTO_CXX_FLAGS)
mark_as_advanced(OMNITRACE_PERFETTO_LINK_FLAGS)
mark_as_advanced(ROCPROFSYS_PERFETTO_C_FLAGS)
mark_as_advanced(ROCPROFSYS_PERFETTO_CXX_FLAGS)
mark_as_advanced(ROCPROFSYS_PERFETTO_LINK_FLAGS)
if(NOT OMNITRACE_NINJA_EXECUTABLE)
set(OMNITRACE_NINJA_EXECUTABLE
${OMNITRACE_PERFETTO_TOOLS_DIR}/ninja
if(NOT ROCPROFSYS_NINJA_EXECUTABLE)
set(ROCPROFSYS_NINJA_EXECUTABLE
${ROCPROFSYS_PERFETTO_TOOLS_DIR}/ninja
CACHE FILEPATH "Ninja" FORCE)
endif()
@@ -90,13 +90,13 @@ endif()
#
# ---------------------------------------------------------------------------------------#
if(NOT EXISTS "${OMNITRACE_PERFETTO_SOURCE_DIR}")
if(NOT EXISTS "${ROCPROFSYS_PERFETTO_SOURCE_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
${PROJECT_BINARY_DIR}/external/perfetto)
# cmake -E copy_directory fails for some reason
execute_process(
COMMAND ${OMNITRACE_COPY_EXECUTABLE} -r ${PROJECT_SOURCE_DIR}/external/perfetto/
${OMNITRACE_PERFETTO_SOURCE_DIR})
COMMAND ${ROCPROFSYS_COPY_EXECUTABLE} -r ${PROJECT_SOURCE_DIR}/external/perfetto/
${ROCPROFSYS_PERFETTO_SOURCE_DIR})
endif()
file(READ ${PROJECT_SOURCE_DIR}/external/perfetto/sdk/perfetto.h _PERFETTO_HEADER)
@@ -107,21 +107,21 @@ string(
" ::perfetto::internal::ValidateEventNameType" _PERFETTO_HEADER
"${_PERFETTO_HEADER}")
if(OMNITRACE_USE_SANITIZER AND OMNITRACE_SANITIZER_TYPE MATCHES "address")
if(ROCPROFSYS_USE_SANITIZER AND ROCPROFSYS_SANITIZER_TYPE MATCHES "address")
string(REPLACE "__asan_poison_memory_region((a), (s))" "" _PERFETTO_HEADER
"${_PERFETTO_HEADER}")
string(REPLACE "__asan_unpoison_memory_region((a), (s))" "" _PERFETTO_HEADER
"${_PERFETTO_HEADER}")
endif()
file(WRITE ${OMNITRACE_PERFETTO_SOURCE_DIR}/sdk/perfetto.h.tmp "${_PERFETTO_HEADER}")
file(WRITE ${ROCPROFSYS_PERFETTO_SOURCE_DIR}/sdk/perfetto.h.tmp "${_PERFETTO_HEADER}")
configure_file(${OMNITRACE_PERFETTO_SOURCE_DIR}/sdk/perfetto.h.tmp
${OMNITRACE_PERFETTO_SOURCE_DIR}/sdk/perfetto.h COPYONLY)
configure_file(${ROCPROFSYS_PERFETTO_SOURCE_DIR}/sdk/perfetto.h.tmp
${ROCPROFSYS_PERFETTO_SOURCE_DIR}/sdk/perfetto.h COPYONLY)
configure_file(${PROJECT_SOURCE_DIR}/external/perfetto/sdk/perfetto.cc
${OMNITRACE_PERFETTO_SOURCE_DIR}/sdk/perfetto.cc COPYONLY)
${ROCPROFSYS_PERFETTO_SOURCE_DIR}/sdk/perfetto.cc COPYONLY)
configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/args.gn.in
${OMNITRACE_PERFETTO_BINARY_DIR}/args.gn @ONLY)
${ROCPROFSYS_PERFETTO_BINARY_DIR}/args.gn @ONLY)
# ---------------------------------------------------------------------------------------#
#
@@ -129,55 +129,56 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/args.gn.in
#
# ---------------------------------------------------------------------------------------#
if(OMNITRACE_INSTALL_PERFETTO_TOOLS)
if(ROCPROFSYS_INSTALL_PERFETTO_TOOLS)
find_program(
OMNITRACE_CURL_EXECUTABLE
ROCPROFSYS_CURL_EXECUTABLE
NAMES curl
PATH_SUFFIXES bin)
if(NOT OMNITRACE_CURL_EXECUTABLE)
omnitrace_message(
if(NOT ROCPROFSYS_CURL_EXECUTABLE)
rocprofiler_systems_message(
SEND_ERROR
"curl executable cannot be found. install-build-deps script for perfetto will fail"
)
endif()
externalproject_add(
omnitrace-perfetto-build
rocprofiler-systems-perfetto-build
PREFIX ${PROJECT_BINARY_DIR}/external/perfetto
SOURCE_DIR ${OMNITRACE_PERFETTO_SOURCE_DIR}
SOURCE_DIR ${ROCPROFSYS_PERFETTO_SOURCE_DIR}
BUILD_IN_SOURCE 1
PATCH_COMMAND ${OMNITRACE_PERFETTO_TOOLS_DIR}/install-build-deps
CONFIGURE_COMMAND ${OMNITRACE_PERFETTO_TOOLS_DIR}/gn gen
${OMNITRACE_PERFETTO_BINARY_DIR}
BUILD_COMMAND ${OMNITRACE_NINJA_EXECUTABLE} -C ${OMNITRACE_PERFETTO_BINARY_DIR} -j
${OMNITRACE_PERFETTO_BUILD_THREADS}
PATCH_COMMAND ${ROCPROFSYS_PERFETTO_TOOLS_DIR}/install-build-deps
CONFIGURE_COMMAND ${ROCPROFSYS_PERFETTO_TOOLS_DIR}/gn gen
${ROCPROFSYS_PERFETTO_BINARY_DIR}
BUILD_COMMAND ${ROCPROFSYS_NINJA_EXECUTABLE} -C ${ROCPROFSYS_PERFETTO_BINARY_DIR}
-j ${ROCPROFSYS_PERFETTO_BUILD_THREADS}
INSTALL_COMMAND ""
BUILD_BYPRODUCTS ${OMNITRACE_PERFETTO_BINARY_DIR}/args.gn)
BUILD_BYPRODUCTS ${ROCPROFSYS_PERFETTO_BINARY_DIR}/args.gn)
add_custom_target(
omnitrace-perfetto-clean
COMMAND ${OMNITRACE_NINJA_EXECUTABLE} -t clean
COMMAND ${CMAKE_COMMAND} -E rm -rf
${PROJECT_BINARY_DIR}/external/perfetto/src/omnitrace-perfetto-build-stamp
WORKING_DIRECTORY ${OMNITRACE_PERFETTO_BINARY_DIR}
rocprofiler-systems-perfetto-clean
COMMAND ${ROCPROFSYS_NINJA_EXECUTABLE} -t clean
COMMAND
${CMAKE_COMMAND} -E rm -rf
${PROJECT_BINARY_DIR}/external/perfetto/src/rocprof-sys-perfetto-build-stamp
WORKING_DIRECTORY ${ROCPROFSYS_PERFETTO_BINARY_DIR}
COMMENT "Cleaning Perfetto...")
install(
DIRECTORY ${OMNITRACE_PERFETTO_INSTALL_DIR}/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/omnitrace
DIRECTORY ${ROCPROFSYS_PERFETTO_INSTALL_DIR}/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT perfetto
FILES_MATCHING
PATTERN "*libperfetto.so*")
foreach(_FILE perfetto traced tracebox traced_probes traced_perf trigger_perfetto)
if("${_FILE}" STREQUAL "perfetto")
string(REPLACE "_" "-" _INSTALL_FILE "omnitrace-${_FILE}")
string(REPLACE "_" "-" _INSTALL_FILE "rocprof-sys-${_FILE}")
else()
string(REPLACE "_" "-" _INSTALL_FILE "omnitrace-perfetto-${_FILE}")
string(REPLACE "_" "-" _INSTALL_FILE "rocprof-sys-perfetto-${_FILE}")
endif()
install(
PROGRAMS ${OMNITRACE_PERFETTO_INSTALL_DIR}/${_FILE}
PROGRAMS ${ROCPROFSYS_PERFETTO_INSTALL_DIR}/${_FILE}
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT perfetto
RENAME ${_INSTALL_FILE}
@@ -191,31 +192,34 @@ endif()
#
# ---------------------------------------------------------------------------------------#
add_library(omnitrace-perfetto-library STATIC)
add_library(omnitrace::omnitrace-perfetto-library ALIAS omnitrace-perfetto-library)
add_library(rocprofiler-systems-perfetto-library STATIC)
add_library(rocprofiler-systems::rocprofiler-systems-perfetto-library ALIAS
rocprofiler-systems-perfetto-library)
target_sources(
omnitrace-perfetto-library PRIVATE ${OMNITRACE_PERFETTO_SOURCE_DIR}/sdk/perfetto.cc
${OMNITRACE_PERFETTO_SOURCE_DIR}/sdk/perfetto.h)
rocprofiler-systems-perfetto-library
PRIVATE ${ROCPROFSYS_PERFETTO_SOURCE_DIR}/sdk/perfetto.cc
${ROCPROFSYS_PERFETTO_SOURCE_DIR}/sdk/perfetto.h)
target_link_libraries(
omnitrace-perfetto-library
PRIVATE omnitrace::omnitrace-threading omnitrace::omnitrace-static-libgcc
omnitrace::omnitrace-static-libstdcxx)
rocprofiler-systems-perfetto-library
PRIVATE rocprofiler-systems::rocprofiler-systems-threading
rocprofiler-systems::rocprofiler-systems-static-libgcc
rocprofiler-systems::rocprofiler-systems-static-libstdcxx)
set_target_properties(
omnitrace-perfetto-library
rocprofiler-systems-perfetto-library
PROPERTIES OUTPUT_NAME perfetto
ARCHIVE_OUTPUT_DIRECTORY ${OMNITRACE_PERFETTO_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${ROCPROFSYS_PERFETTO_BINARY_DIR}
POSITION_INDEPENDENT_CODE ON
CXX_VISIBILITY_PRESET "internal")
set(perfetto_DIR ${OMNITRACE_PERFETTO_SOURCE_DIR})
set(perfetto_DIR ${ROCPROFSYS_PERFETTO_SOURCE_DIR})
set(PERFETTO_ROOT_DIR
${OMNITRACE_PERFETTO_SOURCE_DIR}
${ROCPROFSYS_PERFETTO_SOURCE_DIR}
CACHE PATH "Root Perfetto installation" FORCE)
set(PERFETTO_INCLUDE_DIR
${OMNITRACE_PERFETTO_SOURCE_DIR}/sdk
${ROCPROFSYS_PERFETTO_SOURCE_DIR}/sdk
CACHE PATH "Perfetto include folder" FORCE)
set(PERFETTO_LIBRARY
${OMNITRACE_PERFETTO_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}perfetto${CMAKE_STATIC_LIBRARY_SUFFIX}
${ROCPROFSYS_PERFETTO_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}perfetto${CMAKE_STATIC_LIBRARY_SUFFIX}
CACHE FILEPATH "Perfetto library" FORCE)
mark_as_advanced(PERFETTO_ROOT_DIR)
@@ -228,9 +232,11 @@ mark_as_advanced(PERFETTO_LIBRARY)
#
# ---------------------------------------------------------------------------------------#
omnitrace_target_compile_definitions(omnitrace-perfetto INTERFACE OMNITRACE_USE_PERFETTO)
target_include_directories(omnitrace-perfetto SYSTEM
rocprofiler_systems_target_compile_definitions(rocprofiler-systems-perfetto
INTERFACE ROCPROFSYS_USE_PERFETTO)
target_include_directories(rocprofiler-systems-perfetto SYSTEM
INTERFACE $<BUILD_INTERFACE:${PERFETTO_INCLUDE_DIR}>)
target_link_libraries(
omnitrace-perfetto INTERFACE $<BUILD_INTERFACE:${PERFETTO_LIBRARY}>
$<BUILD_INTERFACE:omnitrace::omnitrace-threading>)
rocprofiler-systems-perfetto
INTERFACE $<BUILD_INTERFACE:${PERFETTO_LIBRARY}>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-threading>)
@@ -23,6 +23,6 @@ enable_perfetto_trace_processor_percentile = false
enable_perfetto_trace_processor_sqlite = true
enable_perfetto_ui = false
extra_cflags = "@OMNITRACE_PERFETTO_C_FLAGS@"
extra_cxxflags = "@OMNITRACE_PERFETTO_CXX_FLAGS@"
extra_ldflags = "@OMNITRACE_PERFETTO_LINK_FLAGS@ -Wl,-rpath=\\\$ORIGIN:\\\$ORIGIN/../lib:\\\$ORIGIN/../lib/omnitrace"
extra_cflags = "@ROCPROFSYS_PERFETTO_C_FLAGS@"
extra_cxxflags = "@ROCPROFSYS_PERFETTO_CXX_FLAGS@"
extra_ldflags = "@ROCPROFSYS_PERFETTO_LINK_FLAGS@ -Wl,-rpath=\\\$ORIGIN:\\\$ORIGIN/../lib:\\\$ORIGIN/../lib/rocprof-sys"
@@ -10,7 +10,7 @@ set -e
run-script()
{
echo -e "\n##### omnitrace :: executing '${@}'... #####\n"
echo -e "\n##### ${PROJECT_NAME} :: executing '${@}'... #####\n"
eval $@
}
@@ -8,13 +8,13 @@ puts stderr "Loads @PROJECT_NAME@ v@PROJECT_VERSION@"
set ROOT [file normalize [file dirname [file normalize ${ModulesCurrentModulefile}]]/../../..]
setenv @PROJECT_NAME@_ROOT "${ROOT}"
setenv @PROJECT_NAME_UNDERSCORED@_ROOT "${ROOT}"
prepend-path CMAKE_PREFIX_PATH "${ROOT}"
prepend-path PATH "${ROOT}/bin"
prepend-path LD_LIBRARY_PATH "${ROOT}/@CMAKE_INSTALL_LIBDIR@"
prepend-path PYTHONPATH "${ROOT}/@CMAKE_INSTALL_PYTHONDIR@"
setenv @PROJECT_NAME@_DIR "${ROOT}/@CMAKE_INSTALL_DATAROOTDIR@/cmake/@PROJECT_NAME@"
setenv @PROJECT_NAME_UNDERSCORED@_DIR "${ROOT}/@CMAKE_INSTALL_DATAROOTDIR@/cmake/@PROJECT_NAME@"
# @OMNITRACE_HSA_ENV@setenv HSA_TOOLS_LIB "${ROOT}/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@omnitrace@CMAKE_SHARED_LIBRARY_SUFFIX@"
# @OMNITRACE_HSA_ENV@setenv HSA_TOOLS_REPORT_LOAD_FAILURE 1
# @OMNITRACE_ROCP_ENV@setenv ROCP_TOOL_LIB "${ROOT}/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@omnitrace@CMAKE_SHARED_LIBRARY_SUFFIX@"
# @ROCPROFSYS_HSA_ENV@setenv HSA_TOOLS_LIB "${ROOT}/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@rocprof-sys@CMAKE_SHARED_LIBRARY_SUFFIX@"
# @ROCPROFSYS_HSA_ENV@setenv HSA_TOOLS_REPORT_LOAD_FAILURE 1
# @ROCPROFSYS_ROCP_ENV@setenv ROCP_TOOL_LIB "${ROOT}/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@rocprof-sys@CMAKE_SHARED_LIBRARY_SUFFIX@"
@@ -10,7 +10,7 @@ import subprocess as sp
from urllib import request
from urllib.error import HTTPError
omnitrace_version = "@OMNITRACE_VERSION@"
rocprofsys_version = "@ROCPROFSYS_VERSION@"
_rocm_path = os.environ.get("ROCM_PATH", "/opt/rocm")
_rocm_version = None
@@ -155,11 +155,11 @@ if __name__ == "__main__":
parser.add_argument(
"--version",
help="Print omnitrace version which will be installed",
help="Print ROCm Systems Profiler version which will be installed",
action="store_true",
)
parser.add_argument(
"-p", "--prefix", help="Installation prefix", type=str, default="/opt/omnitrace"
"-p", "--prefix", help="Installation prefix", type=str, default="/opt/rocprof-sys"
)
parser.add_argument(
"-i",
@@ -193,7 +193,7 @@ if __name__ == "__main__":
)
parser.add_argument(
"--rocm",
help="Install omnitrace with ROCm support. Accepts either a ROCm version (e.g. '5.4') or the root path to the ROCm install containing .info/version* file(s) (e.g. /opt/rocm if /opt/rocm/.info/version exists). If no argument is provided, the ROCm version will attempted to be deduced from $ENV{ROCM_PATH}/.info/version",
help="Install ROCm Systems Profiler with ROCm support. Accepts either a ROCm version (e.g. '6.2') or the root path to the ROCm install containing .info/version* file(s) (e.g. /opt/rocm if /opt/rocm/.info/version exists). If no argument is provided, the ROCm version will attempted to be deduced from $ENV{ROCM_PATH}/.info/version",
nargs="?",
default=None,
const=True,
@@ -204,7 +204,7 @@ if __name__ == "__main__":
parser.add_argument(
"-e",
"--extensions",
help="Omnitrace extensions, e.g. PAPI, OMPT, and Python3",
help="ROCm Systems Profiler extensions, e.g. PAPI, OMPT, and Python3",
nargs="*",
default=("papi", "ompt", "python3"),
choices=("papi", "ompt", "python3"),
@@ -213,7 +213,7 @@ if __name__ == "__main__":
args = parser.parse_args()
if args.version:
print(f"omnitrace {omnitrace_version}")
print(f"ROCm Systems Profiler {rocprofsys_version}")
sys.exit(0)
os_distrib, os_version = get_os_info(args.os_distrib, args.os_version)
@@ -231,10 +231,10 @@ if __name__ == "__main__":
f"Error! ROCm version could not be determined from {_rocm_path}/.info/version*. Please provide a ROCm version or the root path to the ROCm install containing the .info directory, e.g. '--rocm 5.4' or '--rocm /path/to/rocm/install'"
)
script = f"omnitrace-{omnitrace_version}-{os_distrib}-{os_version}{rocm_version}{extensions}.sh"
url = f"https://github.com/ROCm/omnitrace/releases/download/v{omnitrace_version}/{script}"
script = f"rocprofiler-systems-{rocprofsys_version}-{os_distrib}-{os_version}{rocm_version}{extensions}.sh"
url = f"https://github.com/ROCm/rocprofiler-systems/releases/download/v{rocprofsys_version}/{script}"
download_dir = (
tempfile.mkdtemp(prefix="omnitrace-install-")
tempfile.mkdtemp(prefix="rocprof-sys-install-")
if args.download_path is None
else args.download_path
)
@@ -275,12 +275,12 @@ if __name__ == "__main__":
["--exclude-subdir", "--skip-license"] if not args.interactive else []
)
print_log(f"Installing omnitrace to {args.prefix} ...")
print_log(f"Installing ROCm Systems Profiler to {args.prefix} ...")
run([install_script, f"--prefix={args.prefix}"] + install_args)
print_log(
f"omnitrace v{omnitrace_version} installation to {args.prefix} succeeded!"
f"ROCm Systems Profiler v{rocprofsys_version} installation to {args.prefix} succeeded!"
)
finally:
@@ -13,25 +13,25 @@ if [ ! -d "${BASEDIR}" ]; then
return 1
fi
@PROJECT_NAME@_ROOT=${BASEDIR}
@PROJECT_NAME_UNDERSCORED@_ROOT=${BASEDIR}
PATH=${BASEDIR}/bin:${PATH}
LD_LIBRARY_PATH=${BASEDIR}/@CMAKE_INSTALL_LIBDIR@:${LD_LIBRARY_PATH}
PYTHONPATH=${BASEDIR}/@CMAKE_INSTALL_PYTHONDIR@:${PYTHONPATH}
CMAKE_PREFIX_PATH=${BASEDIR}:${CMAKE_PREFIX_PATH}
@PROJECT_NAME@_DIR=${BASEDIR}/@CMAKE_INSTALL_DATAROOTDIR@/cmake/@PROJECT_NAME@
@PROJECT_NAME_UNDERSCORED@_DIR=${BASEDIR}/@CMAKE_INSTALL_DATAROOTDIR@/cmake/@PROJECT_NAME@
export @PROJECT_NAME@_ROOT
export @PROJECT_NAME_UNDERSCORED@_ROOT
export PATH
export LD_LIBRARY_PATH
export PYTHONPATH
export CMAKE_PREFIX_PATH
export @PROJECT_NAME@_DIR
export @PROJECT_NAME_UNDERSCORED@_DIR
# ROCm environment variables
# @OMNITRACE_HSA_ENV@HSA_TOOLS_LIB="${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@omnitrace-dl@CMAKE_SHARED_LIBRARY_SUFFIX@"
# @OMNITRACE_HSA_ENV@HSA_TOOLS_REPORT_LOAD_FAILURE=1
# @OMNITRACE_ROCP_ENV@ROCP_TOOL_LIB="${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@omnitrace@CMAKE_SHARED_LIBRARY_SUFFIX@"
# @ROCPROFSYS_HSA_ENV@HSA_TOOLS_LIB="${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@rocprof-sys-dl@CMAKE_SHARED_LIBRARY_SUFFIX@"
# @ROCPROFSYS_HSA_ENV@HSA_TOOLS_REPORT_LOAD_FAILURE=1
# @ROCPROFSYS_ROCP_ENV@ROCP_TOOL_LIB="${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@rocprof-sys@CMAKE_SHARED_LIBRARY_SUFFIX@"
# @OMNITRACE_HSA_ENV@export HSA_TOOLS_LIB
# @OMNITRACE_HSA_ENV@export HSA_TOOLS_REPORT_LOAD_FAILURE
# @OMNITRACE_ROCP_ENV@export ROCP_TOOL_LIB
# @ROCPROFSYS_HSA_ENV@export HSA_TOOLS_LIB
# @ROCPROFSYS_HSA_ENV@export HSA_TOOLS_REPORT_LOAD_FAILURE
# @ROCPROFSYS_ROCP_ENV@export ROCP_TOOL_LIB
@@ -138,10 +138,10 @@ EXCLUDE_PATTERNS = */.git/* \
../../examples/* \
../../tests/*
EXCLUDE_SYMBOLS = "std::*" \
"OMNITRACE_ATTRIBUTE" \
"OMNITRACE_VISIBILITY" \
"OMNITRACE_PUBLIC_API" \
"OMNITRACE_HIDDEN_API" \
"ROCPROFSYS_ATTRIBUTE" \
"ROCPROFSYS_VISIBILITY" \
"ROCPROFSYS_PUBLIC_API" \
"ROCPROFSYS_HIDDEN_API" \
"SpaceHandle" \
"KokkosPDevice*"
EXAMPLE_PATH = ../../examples
@@ -314,10 +314,10 @@ SEARCH_INCLUDES = YES
INCLUDE_PATH = ../../source/lib/omnitrace-user
INCLUDE_FILE_PATTERNS = *.h \
*.hpp
PREDEFINED = OMNITRACE_PUBLIC_API= \
OMNITRACE_HIDDEN_API= \
"OMNITRACE_ATTRIBUTE(...)=" \
"OMNITRACE_VISIBILITY(...)=" \
PREDEFINED = ROCPROFSYS_PUBLIC_API= \
ROCPROFSYS_HIDDEN_API= \
"ROCPROFSYS_ATTRIBUTE(...)=" \
"ROCPROFSYS_VISIBILITY(...)=" \
"__attribute__(x)=" \
"__declspec(x)=" \
"size_t=unsigned long" \
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-examples LANGUAGES C CXX)
project(rocprofiler-systems-examples LANGUAGES C CXX)
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE
@@ -17,26 +17,27 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_CLANG_TIDY)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME examples)
if(OMNITRACE_BUILD_DEBUG)
if(ROCPROFSYS_BUILD_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -fno-omit-frame-pointer")
endif()
option(BUILD_SHARED_LIBS "Build dynamic libraries" ON)
if(CMAKE_PROJECT_NAME STREQUAL "omnitrace")
if(CMAKE_PROJECT_NAME STREQUAL "rocprofiler-systems")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
omnitrace_add_option(OMNITRACE_INSTALL_EXAMPLES "Install omnitrace examples" OFF)
rocprofiler_systems_add_option(ROCPROFSYS_INSTALL_EXAMPLES
"Install rocprofiler-systems examples" OFF)
else()
option(OMNITRACE_INSTALL_EXAMPLES "Install omnitrace examples" ON)
option(ROCPROFSYS_INSTALL_EXAMPLES "Install rocprofiler-systems examples" ON)
endif()
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
include(GNUInstallDirs)
endif()
set(OMNITRACE_EXAMPLE_ROOT_DIR
set(ROCPROFSYS_EXAMPLE_ROOT_DIR
${CMAKE_CURRENT_LIST_DIR}
CACHE INTERNAL "")
# defines function for creating causal profiling exes
@@ -3,8 +3,8 @@
#
include_guard(DIRECTORY)
if(NOT TARGET omnitrace::omnitrace-user-library)
find_package(omnitrace REQUIRED COMPONENTS user)
if(NOT TARGET rocprofiler-systems::rocprofiler-systems-user-library)
find_package(rocprofiler-systems REQUIRED COMPONENTS user)
endif()
if(NOT coz-profiler_FOUND)
@@ -15,11 +15,11 @@ if(NOT TARGET omni-causal-examples)
add_custom_target(omni-causal-examples)
endif()
function(omnitrace_causal_example_executable _NAME)
function(rocprofiler_systems_causal_example_executable _NAME)
cmake_parse_arguments(
CAUSAL "" "" "SOURCES;DEFINITIONS;INCLUDE_DIRECTORIES;LINK_LIBRARIES" ${ARGN})
function(omnitrace_causal_example_interface _TARGET)
function(rocprofiler_systems_causal_example_interface _TARGET)
if(NOT TARGET ${_TARGET})
find_package(Threads REQUIRED)
add_library(${_TARGET} INTERFACE)
@@ -27,8 +27,8 @@ function(omnitrace_causal_example_executable _NAME)
endif()
endfunction()
omnitrace_causal_example_interface(omni-causal-example-lib-debug)
omnitrace_causal_example_interface(omni-causal-example-lib-no-debug)
rocprofiler_systems_causal_example_interface(omni-causal-example-lib-debug)
rocprofiler_systems_causal_example_interface(omni-causal-example-lib-no-debug)
target_compile_options(omni-causal-example-lib-debug
INTERFACE -g3 -fno-omit-frame-pointer)
@@ -37,48 +37,54 @@ function(omnitrace_causal_example_executable _NAME)
add_executable(${_NAME} ${CAUSAL_SOURCES})
target_compile_definitions(${_NAME} PRIVATE USE_COZ=0 USE_OMNI=0
${CAUSAL_DEFINITIONS})
target_include_directories(${_NAME} PRIVATE ${OMNITRACE_EXAMPLE_ROOT_DIR}/causal
target_include_directories(${_NAME} PRIVATE ${ROCPROFSYS_EXAMPLE_ROOT_DIR}/causal
${CAUSAL_INCLUDE_DIRECTORIES})
target_link_libraries(
${_NAME} PRIVATE ${CAUSAL_LINK_LIBRARIES} omnitrace::omnitrace-user-library
omni-causal-example-lib-debug)
${_NAME}
PRIVATE ${CAUSAL_LINK_LIBRARIES}
rocprofiler-systems::rocprofiler-systems-user-library
omni-causal-example-lib-debug)
add_executable(${_NAME}-omni ${CAUSAL_SOURCES})
target_compile_definitions(${_NAME}-omni PRIVATE USE_COZ=0 USE_OMNI=1
${CAUSAL_DEFINITIONS})
target_include_directories(${_NAME}-omni PRIVATE ${OMNITRACE_EXAMPLE_ROOT_DIR}/causal
target_include_directories(${_NAME}-omni PRIVATE ${ROCPROFSYS_EXAMPLE_ROOT_DIR}/causal
${CAUSAL_INCLUDE_DIRECTORIES})
target_link_libraries(
${_NAME}-omni PRIVATE ${CAUSAL_LINK_LIBRARIES} omnitrace::omnitrace-user-library
omni-causal-example-lib-debug)
${_NAME}-omni
PRIVATE ${CAUSAL_LINK_LIBRARIES}
rocprofiler-systems::rocprofiler-systems-user-library
omni-causal-example-lib-debug)
add_executable(${_NAME}-ndebug ${CAUSAL_SOURCES})
target_compile_definitions(${_NAME}-ndebug PRIVATE USE_COZ=0 USE_OMNI=0
${CAUSAL_DEFINITIONS})
target_include_directories(
${_NAME}-ndebug PRIVATE ${OMNITRACE_EXAMPLE_ROOT_DIR}/causal
${_NAME}-ndebug PRIVATE ${ROCPROFSYS_EXAMPLE_ROOT_DIR}/causal
${CAUSAL_INCLUDE_DIRECTORIES})
target_link_libraries(
${_NAME}-ndebug
PRIVATE ${CAUSAL_LINK_LIBRARIES} omnitrace::omnitrace-user-library
PRIVATE ${CAUSAL_LINK_LIBRARIES}
rocprofiler-systems::rocprofiler-systems-user-library
omni-causal-example-lib-no-debug)
add_executable(${_NAME}-omni-ndebug ${CAUSAL_SOURCES})
target_compile_definitions(${_NAME}-omni-ndebug PRIVATE USE_COZ=0 USE_OMNI=1
${CAUSAL_DEFINITIONS})
target_include_directories(
${_NAME}-omni-ndebug PRIVATE ${OMNITRACE_EXAMPLE_ROOT_DIR}/causal
${_NAME}-omni-ndebug PRIVATE ${ROCPROFSYS_EXAMPLE_ROOT_DIR}/causal
${CAUSAL_INCLUDE_DIRECTORIES})
target_link_libraries(
${_NAME}-omni-ndebug
PRIVATE ${CAUSAL_LINK_LIBRARIES} omnitrace::omnitrace-user-library
PRIVATE ${CAUSAL_LINK_LIBRARIES}
rocprofiler-systems::rocprofiler-systems-user-library
omni-causal-example-lib-no-debug)
add_dependencies(omni-causal-examples ${_NAME} ${_NAME}-omni ${_NAME}-ndebug
${_NAME}-omni-ndebug)
if(coz-profiler_FOUND)
omnitrace_causal_example_interface(omni-causal-example-lib-coz)
rocprofiler_systems_causal_example_interface(omni-causal-example-lib-coz)
target_compile_options(omni-causal-example-lib-coz
INTERFACE -g3 -gdwarf-3 -fno-omit-frame-pointer)
@@ -86,7 +92,7 @@ function(omnitrace_causal_example_executable _NAME)
target_compile_definitions(${_NAME}-coz PRIVATE USE_COZ=1 USE_OMNI=0
${CAUSAL_DEFINITIONS})
target_include_directories(
${_NAME}-coz PRIVATE ${OMNITRACE_EXAMPLE_ROOT_DIR}/causal
${_NAME}-coz PRIVATE ${ROCPROFSYS_EXAMPLE_ROOT_DIR}/causal
${CAUSAL_INCLUDE_DIRECTORIES})
target_link_libraries(${_NAME}-coz PRIVATE ${CAUSAL_LINK_LIBRARIES}
omni-causal-example-lib-coz coz::coz)
@@ -94,11 +100,11 @@ function(omnitrace_causal_example_executable _NAME)
add_dependencies(omni-causal-examples ${_NAME}-coz)
endif()
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS ${_NAME} ${_NAME}-omni ${_NAME}-coz
DESTINATION bin
COMPONENT omnitrace-examples
COMPONENT rocprofiler-systems-examples
OPTIONAL)
endif()
endfunction()
@@ -1,20 +1,20 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-causal-example LANGUAGES CXX)
project(rocprofiler-systems-causal-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
set(CMAKE_BUILD_TYPE "Release")
find_package(Threads REQUIRED)
if(NOT TARGET omnitrace::omnitrace-user-library)
find_package(omnitrace REQUIRED COMPONENTS user)
if(NOT TARGET rocprofiler-systems::rocprofiler-systems-user-library)
find_package(rocprofiler-systems REQUIRED COMPONENTS user)
endif()
add_library(causal-interface-library INTERFACE)
@@ -23,19 +23,19 @@ target_compile_options(causal-interface-library INTERFACE -g3 -gdwarf-3
target_link_libraries(causal-interface-library INTERFACE Threads::Threads
${CMAKE_DL_LIBS})
omnitrace_causal_example_executable(
rocprofiler_systems_causal_example_executable(
"causal-both"
SOURCES causal.cpp impl.cpp
LINK_LIBRARIES causal-interface-library
DEFINITIONS USE_RNG=1 USE_CPU=1)
omnitrace_causal_example_executable(
rocprofiler_systems_causal_example_executable(
"causal-rng"
SOURCES causal.cpp impl.cpp
LINK_LIBRARIES causal-interface-library
DEFINITIONS USE_RNG=1 USE_CPU=0)
omnitrace_causal_example_executable(
rocprofiler_systems_causal_example_executable(
"causal-cpu"
SOURCES causal.cpp impl.cpp
LINK_LIBRARIES causal-interface-library
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -27,11 +27,11 @@
#define CAUSAL_LABEL __FILE__ ":" CAUSAL_STR(__LINE__)
#if defined(USE_OMNI) && USE_OMNI > 0
# include <omnitrace/causal.h>
# define CAUSAL_PROGRESS OMNITRACE_CAUSAL_PROGRESS
# define CAUSAL_PROGRESS_NAMED(LABEL) OMNITRACE_CAUSAL_PROGRESS_NAMED(LABEL)
# define CAUSAL_BEGIN(LABEL) OMNITRACE_CAUSAL_BEGIN(LABEL)
# define CAUSAL_END(LABEL) OMNITRACE_CAUSAL_END(LABEL)
# include <rocprofiler-systems/causal.h>
# define CAUSAL_PROGRESS ROCPROFSYS_CAUSAL_PROGRESS
# define CAUSAL_PROGRESS_NAMED(LABEL) ROCPROFSYS_CAUSAL_PROGRESS_NAMED(LABEL)
# define CAUSAL_BEGIN(LABEL) ROCPROFSYS_CAUSAL_BEGIN(LABEL)
# define CAUSAL_END(LABEL) ROCPROFSYS_CAUSAL_END(LABEL)
#elif defined(USE_COZ) && USE_COZ > 0
# include <coz.h>
# define CAUSAL_PROGRESS COZ_PROGRESS_NAMED(CAUSAL_LABEL)
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -61,7 +61,7 @@ get_clock_cpu_now() noexcept;
} // namespace
//
// This implementation works well for Omnitrace
// This implementation works well for rocprof-sys
// while COZ makes poor predictions
//
template <bool V>
@@ -82,7 +82,7 @@ template bool rng_impl_func<false>(int64_t, uint64_t);
//
// This implementation works well for COZ
// while Omnitrace makes poor predictions
// while rocprof-sys makes poor predictions
//
template <bool V>
bool
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(omnitrace-code-coverage-example LANGUAGES CXX)
project(rocprofiler-systems-code-coverage-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
@@ -19,11 +19,11 @@ add_executable(code-coverage code-coverage.cpp)
target_link_libraries(code-coverage PRIVATE Threads::Threads)
target_compile_options(code-coverage PRIVATE ${_FLAGS})
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS code-coverage
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
set(PYTHON_FILES code-coverage.py)
@@ -37,11 +37,11 @@ if(Python3_FOUND)
configure_file(${PROJECT_SOURCE_DIR}/${_FILE} ${PROJECT_BINARY_DIR}/${_FILE}
@ONLY)
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
PROGRAMS ${PROJECT_BINARY_DIR}/${_FILE}
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
endforeach()
endif()
@@ -1,6 +1,6 @@
#!@PYTHON_EXECUTABLE@
import omnitrace
import rocprofsys
import argparse
if __name__ == "__main__":
@@ -28,15 +28,15 @@ if __name__ == "__main__":
data = None
for itr in args.input:
_summary, _details = omnitrace.coverage.load(itr)
_summary, _details = rocprofsys.coverage.load(itr)
if data is None:
data = _details
else:
data = omnitrace.coverage.concat(data, _details)
data = rocprofsys.coverage.concat(data, _details)
summary = omnitrace.coverage.get_summary(data)
top = omnitrace.coverage.get_top(data)
bottom = omnitrace.coverage.get_bottom(data)
summary = rocprofsys.coverage.get_summary(data)
top = rocprofsys.coverage.get_top(data)
bottom = rocprofsys.coverage.get_bottom(data)
print("Top code coverage:")
for itr in top:
@@ -51,4 +51,4 @@ if __name__ == "__main__":
)
print("\nSaving code coverage")
omnitrace.coverage.save(summary, data, args.output)
rocprofsys.coverage.save(summary, data, args.output)
@@ -1,19 +1,20 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(omnitrace-fork LANGUAGES CXX)
project(rocprofiler-systems-fork LANGUAGES CXX)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
string(REPLACE " " ";" _FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")
find_package(Threads REQUIRED)
find_package(omnitrace REQUIRED COMPONENTS user)
find_package(rocprofiler-systems REQUIRED COMPONENTS user)
add_executable(fork-example fork.cpp)
target_link_libraries(fork-example PRIVATE Threads::Threads omnitrace::omnitrace)
target_link_libraries(fork-example PRIVATE Threads::Threads
rocprofiler-systems::rocprofiler-systems)
target_compile_options(fork-example PRIVATE ${_FLAGS})
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS fork-example
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
@@ -1,5 +1,5 @@
#include <omnitrace/user.h>
#include <rocprofiler-systems/user.h>
#include <chrono>
#include <cstdio>
@@ -33,7 +33,7 @@ run(const char* _name, int nchildren)
pthread_barrier_init(&_barrier, nullptr, nchildren + 1);
for(int i = 0; i < nchildren; ++i)
{
omnitrace_user_push_region("launch_child");
rocprofsys_user_push_region("launch_child");
auto _run = [&_barrier, &_children, i, _name](uint64_t _nsec) {
pthread_barrier_wait(&_barrier);
_children.at(i) = fork();
@@ -43,13 +43,13 @@ run(const char* _name, int nchildren)
print_info(_name);
printf("[%s][%i] child job starting...\n", _name, getpid());
auto _sleep = [=]() {
omnitrace_user_push_region("child_process_child_thread");
rocprofsys_user_push_region("child_process_child_thread");
std::this_thread::sleep_for(std::chrono::seconds{ _nsec });
omnitrace_user_pop_region("child_process_child_thread");
rocprofsys_user_pop_region("child_process_child_thread");
};
omnitrace_user_push_region("child_process");
rocprofsys_user_push_region("child_process");
std::thread{ _sleep }.join();
omnitrace_user_push_region("child_process");
rocprofsys_user_push_region("child_process");
printf("[%s][%i] child job complete\n", _name, getpid());
exit(EXIT_SUCCESS);
}
@@ -59,7 +59,7 @@ run(const char* _name, int nchildren)
}
};
_threads.emplace_back(_run, i + 1);
omnitrace_user_pop_region("launch_child");
rocprofsys_user_pop_region("launch_child");
}
// all child threads should start executing their fork once this returns
@@ -67,7 +67,7 @@ run(const char* _name, int nchildren)
// wait for the threads to successfully fork
pthread_barrier_wait(&_barrier);
omnitrace_user_push_region("wait_for_children");
rocprofsys_user_push_region("wait_for_children");
int _status = 0;
pid_t _wait_pid = 0;
@@ -110,7 +110,7 @@ run(const char* _name, int nchildren)
for(auto& itr : _threads)
itr.join();
omnitrace_user_pop_region("wait_for_children");
rocprofsys_user_pop_region("wait_for_children");
printf("[%s][%i] returning (error code: %i) ...\n", _name, getpid(), _status);
return _status;
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-lulesh-example LANGUAGES C CXX)
project(rocprofiler-systems-lulesh-example LANGUAGES C CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
@@ -65,18 +65,18 @@ endif()
file(GLOB headers ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.hxx)
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cc)
omnitrace_causal_example_executable(
rocprofiler_systems_causal_example_executable(
"lulesh"
SOURCES ${sources} ${headers}
LINK_LIBRARIES Kokkos::kokkos lulesh-mpi
INCLUDE_DIRECTORIES ${PROJECT_SOURCE_DIR}/includes)
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
if(LULESH_BUILD_KOKKOS)
install(
TARGETS kokkoscore kokkoscontainers
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
set_target_properties(lulesh PROPERTIES INSTALL_RPATH
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()
@@ -1,24 +1,25 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-mpi-examples LANGUAGES C CXX)
project(rocprofiler-systems-mpi-examples LANGUAGES C CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
find_package(MPI)
if(NOT MPI_FOUND)
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace" AND "$ENV{OMNITRACE_CI}")
if("${CMAKE_PROJECT_NAME}" STREQUAL "rocprofiler-systems" AND "$ENV{ROCPROFSYS_CI}")
set(_MSG_TYPE STATUS) # don't generate warnings during CI
else()
set(_MSG_TYPE AUTHOR_WARNING)
endif()
message(${_MSG_TYPE} "MPI could not be found. Cannot build omnitrace-mpi target")
message(${_MSG_TYPE}
"MPI could not be found. Cannot build rocprofiler-systems-mpi target")
return()
endif()
@@ -29,8 +30,9 @@ set(CMAKE_BUILD_TYPE "RelWithDebInfo")
add_library(mpi-c-interface-library INTERFACE)
target_link_libraries(
mpi-c-interface-library
INTERFACE Threads::Threads MPI::MPI_C
$<TARGET_NAME_IF_EXISTS:omnitrace::omnitrace-compile-options>)
INTERFACE
Threads::Threads MPI::MPI_C
$<TARGET_NAME_IF_EXISTS:rocprofiler-systems::rocprofiler-systems-compile-options>)
target_compile_options(mpi-c-interface-library INTERFACE -Wno-double-promotion)
add_executable(mpi-allgather allgather.c)
@@ -59,16 +61,17 @@ set(CMAKE_BUILD_TYPE "Release")
add_library(mpi-cxx-interface-library INTERFACE)
target_link_libraries(
mpi-cxx-interface-library
INTERFACE Threads::Threads MPI::MPI_CXX
$<TARGET_NAME_IF_EXISTS:omnitrace::omnitrace-compile-options>)
INTERFACE
Threads::Threads MPI::MPI_CXX
$<TARGET_NAME_IF_EXISTS:rocprofiler-systems::rocprofiler-systems-compile-options>)
add_executable(mpi-example mpi.cpp)
target_link_libraries(mpi-example PRIVATE mpi-cxx-interface-library)
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS mpi-example mpi-allgather mpi-bcast mpi-all2all mpi-reduce
mpi-scatter-gather mpi-send-recv
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-openmp LANGUAGES CXX)
project(rocprofiler-systems-openmp LANGUAGES CXX)
file(GLOB common_source ${CMAKE_CURRENT_SOURCE_DIR}/common/*.cpp)
add_library(openmp-common OBJECT ${common_source})
@@ -15,9 +15,9 @@ option(USE_CLANG_OMP "Use the clang OpenMP if available" ON)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
find_package(OpenMP REQUIRED)
target_link_libraries(openmp-common PUBLIC OpenMP::OpenMP_CXX)
set(OMNITRACE_OPENMP_USING_LIBOMP_LIBRARY
set(ROCPROFSYS_OPENMP_USING_LIBOMP_LIBRARY
ON
CACHE INTERNAL "Used by omnitrace testing" FORCE)
CACHE INTERNAL "Used by rocprofiler-systems testing" FORCE)
else()
find_program(CLANGXX_EXECUTABLE NAMES clang++)
find_library(
@@ -25,31 +25,34 @@ else()
NAMES omp omp5 ${CMAKE_SHARED_LIBRARY_PREFIX}omp${CMAKE_SHARED_LIBRARY_SUFFIX}.5)
if(CLANGXX_EXECUTABLE
AND LIBOMP_LIBRARY
AND COMMAND omnitrace_custom_compilation
AND COMMAND rocprofiler_systems_custom_compilation
AND USE_CLANG_OMP)
target_compile_options(openmp-common PUBLIC -W -Wall -fopenmp=libomp)
target_link_libraries(openmp-common PUBLIC ${LIBOMP_LIBRARY})
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-common)
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-cg)
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-lu)
set(OMNITRACE_OPENMP_USING_LIBOMP_LIBRARY
rocprofiler_systems_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET
openmp-common)
rocprofiler_systems_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET
openmp-cg)
rocprofiler_systems_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET
openmp-lu)
set(ROCPROFSYS_OPENMP_USING_LIBOMP_LIBRARY
ON
CACHE INTERNAL "Used by omnitrace testing" FORCE)
CACHE INTERNAL "Used by rocprofiler-systems testing" FORCE)
else()
find_package(OpenMP REQUIRED)
target_link_libraries(openmp-common PUBLIC OpenMP::OpenMP_CXX)
set(OMNITRACE_OPENMP_USING_LIBOMP_LIBRARY
set(ROCPROFSYS_OPENMP_USING_LIBOMP_LIBRARY
OFF
CACHE INTERNAL "Used by omnitrace testing" FORCE)
CACHE INTERNAL "Used by rocprofiler-systems testing" FORCE)
endif()
endif()
target_link_libraries(openmp-cg PRIVATE openmp-common)
target_link_libraries(openmp-lu PRIVATE openmp-common)
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS openmp-cg openmp-lu
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-parallel-overhead-example LANGUAGES CXX)
project(rocprofiler-systems-parallel-overhead-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
@@ -26,9 +26,9 @@ target_link_libraries(parallel-overhead-locks PRIVATE Threads::Threads
parallel-overhead-compile-options)
target_compile_definitions(parallel-overhead-locks PRIVATE USE_LOCKS=1)
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS parallel-overhead parallel-overhead-locks
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-python)
project(rocprofiler-systems-python)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
@@ -22,11 +22,11 @@ if(Python3_FOUND)
configure_file(${PROJECT_SOURCE_DIR}/${_FILE} ${PROJECT_BINARY_DIR}/${_FILE}
@ONLY)
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
PROGRAMS ${PROJECT_BINARY_DIR}/${_FILE}
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
endforeach()
endif()
@@ -3,9 +3,9 @@
import os
import sys
import time
import omnitrace
from omnitrace.user import region as omni_user_region
from omnitrace.profiler import config as omni_config
import rocprofsys
from rocprofsys.user import region as omni_user_region
from rocprofsys.profiler import config as omni_config
_prefix = ""
@@ -14,7 +14,7 @@ def loop(n):
pass
@omnitrace.profile()
@rocprofsys.profile()
def run(i, n, v):
for l in range(n * n):
loop(v + l)
@@ -3,8 +3,8 @@
import os
import sys
import time
import omnitrace
from omnitrace.user import region as omni_user_region
import rocprofsys
from rocprofsys.user import region as omni_user_region
_prefix = ""
@@ -50,7 +50,7 @@ except ImportError as e:
return _ret
@omnitrace.profile()
@rocprofsys.profile()
def run(n):
_ret = 0
_ret += fib(n)
@@ -78,6 +78,6 @@ if __name__ == "__main__":
for i in range(args.num_iterations):
with omni_user_region(f"main_loop"):
if args.stop_profile > 0 and i == args.stop_profile:
omnitrace.user.stop_trace()
rocprofsys.user.stop_trace()
ans = run(args.value)
print(f"[{_prefix}] [{i}] result of run({args.value}) = {ans}\n")
@@ -3,8 +3,8 @@
import os
import sys
import time
import omnitrace
from omnitrace.user import region as omni_user_region
import rocprofsys
from rocprofsys.user import region as omni_user_region
import random
_prefix = ""
@@ -33,7 +33,7 @@ def inefficient(n):
return _ret
@omnitrace.profile()
@rocprofsys.profile()
def run(n):
_ret = 0
_ret += fib(n)
@@ -61,6 +61,6 @@ if __name__ == "__main__":
for i in range(args.num_iterations):
with omni_user_region(f"main_loop"):
if args.stop_profile > 0 and i == args.stop_profile:
omnitrace.user.stop_trace()
rocprofsys.user.stop_trace()
ans = run(args.value)
print(f"[{_prefix}] [{i}] result of run({args.value}) = {ans}\n")
@@ -1,24 +1,24 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-rccl-example LANGUAGES CXX)
project(rocprofiler-systems-rccl-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
function(rccl_message _MSG_TYPE)
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace"
AND "$ENV{OMNITRACE_CI}"
if("${CMAKE_PROJECT_NAME}" STREQUAL "rocprofiler-systems"
AND "$ENV{ROCPROFSYS_CI}"
AND "${_MSG_TYPE}" MATCHES "WARNING")
set(_MSG_TYPE STATUS) # don't generate warnings during CI
endif()
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace")
omnitrace_message(${_MSG_TYPE} ${ARGN})
if("${CMAKE_PROJECT_NAME}" STREQUAL "rocprofiler-systems")
rocprofiler_systems_message(${_MSG_TYPE} ${ARGN})
else()
message(${_MSG_TYPE} ${ARGN})
endif()
@@ -31,10 +31,10 @@ if(NOT hip_FOUND)
return()
endif()
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace"
AND ("$ENV{OMNITRACE_CI}"
OR OMNITRACE_CI
OR OMNITRACE_BUILD_CI))
if("${CMAKE_PROJECT_NAME}" STREQUAL "rocprofiler-systems"
AND ("$ENV{ROCPROFSYS_CI}"
OR ROCPROFSYS_CI
OR ROCPROFSYS_BUILD_CI))
find_package(rccl QUIET) # avoid generating warning in CI
else()
find_package(rccl)
@@ -47,8 +47,7 @@ endif()
if(hip_FOUND AND rccl_FOUND)
include(FetchContent)
fetchcontent_declare(
rccl-tests GIT_REPOSITORY https://github.com/ROCmSoftwarePlatform/rccl-tests.git)
fetchcontent_declare(rccl-tests GIT_REPOSITORY https://github.com/ROCm/rccl-tests.git)
# After the following call, the CMake targets defined by googletest and Catch2 will be
# available to the rest of the build
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(omnitrace-rewrite-caller-example LANGUAGES CXX)
project(rocprofiler-systems-rewrite-caller-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
@@ -16,9 +16,9 @@ set(CMAKE_BUILD_TYPE "Debug")
add_executable(rewrite-caller rewrite-caller.cpp)
target_compile_options(rewrite-caller PRIVATE ${_FLAGS})
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS rewrite-caller
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(omnitrace-trace-time-window-example LANGUAGES CXX)
project(rocprofiler-systems-trace-time-window-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
@@ -16,9 +16,9 @@ set(CMAKE_BUILD_TYPE "Debug")
add_executable(trace-time-window trace-time-window.cpp)
target_compile_options(trace-time-window PRIVATE ${_FLAGS})
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS trace-time-window
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-transpose-example LANGUAGES CXX)
project(rocprofiler-systems-transpose-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
@@ -36,7 +36,7 @@ endif()
if((NOT CMAKE_CXX_COMPILER_IS_HIPCC OR (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang"
AND NOT hip_FOUND))
AND (NOT COMMAND omnitrace_custom_compilation AND NOT HIPCC_EXECUTABLE))
AND (NOT COMMAND rocprofiler_systems_custom_compilation AND NOT HIPCC_EXECUTABLE))
message(AUTHOR_WARNING "transpose target could not be built")
return()
endif()
@@ -56,8 +56,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang"
AND NOT HIPCC_EXECUTABLE)
target_link_libraries(
transpose
PRIVATE $<TARGET_NAME_IF_EXISTS:omnitrace::omnitrace-compile-options>
$<TARGET_NAME_IF_EXISTS:hip::host> $<TARGET_NAME_IF_EXISTS:hip::device>)
PRIVATE
$<TARGET_NAME_IF_EXISTS:rocprofiler-systems::rocprofiler-systems-compile-options>
$<TARGET_NAME_IF_EXISTS:hip::host>
$<TARGET_NAME_IF_EXISTS:hip::device>)
else()
target_compile_options(transpose PRIVATE -W -Wall)
endif()
@@ -73,12 +75,12 @@ endif()
if(NOT CMAKE_CXX_COMPILER_IS_HIPCC AND HIPCC_EXECUTABLE)
# defined in MacroUtilities.cmake
omnitrace_custom_compilation(COMPILER ${HIPCC_EXECUTABLE} TARGET transpose)
rocprofiler_systems_custom_compilation(COMPILER ${HIPCC_EXECUTABLE} TARGET transpose)
endif()
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS transpose
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
@@ -1,5 +1,5 @@
/*
Copyright (c) 2015-2020 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -221,7 +221,7 @@ main(int argc, char** argv)
#else
(void) size;
#endif
// this is a temporary workaround in omnitrace when HIP + MPI is enabled
// this is a temporary workaround in rocprof-sys when HIP + MPI is enabled
int ndevice = 0;
int devid = rank;
HIP_API_CALL(hipGetDeviceCount(&ndevice));
@@ -1,27 +1,29 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-user-api-example LANGUAGES CXX)
project(rocprofiler-systems-user-api-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
if(${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
ROCPROFSYS_DISABLE_EXAMPLES)
return()
endif()
endif()
set(CMAKE_BUILD_TYPE "Debug")
find_package(Threads REQUIRED)
if(NOT TARGET omnitrace::omnitrace-user-library)
find_package(omnitrace REQUIRED COMPONENTS user)
if(NOT TARGET rocprofiler-systems::rocprofiler-systems-user-library)
find_package(rocprofiler-systems REQUIRED COMPONENTS user)
endif()
add_executable(user-api user-api.cpp)
target_link_libraries(user-api PRIVATE Threads::Threads omnitrace::omnitrace-user-library)
target_link_libraries(
user-api PRIVATE Threads::Threads
rocprofiler-systems::rocprofiler-systems-user-library)
if(OMNITRACE_INSTALL_EXAMPLES)
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS user-api
DESTINATION bin
COMPONENT omnitrace-examples)
COMPONENT rocprofiler-systems-examples)
endif()
@@ -1,7 +1,7 @@
#include "omnitrace/categories.h"
#include "omnitrace/types.h"
#include <omnitrace/user.h>
#include <rocprofiler-systems/categories.h>
#include <rocprofiler-systems/types.h>
#include <rocprofiler-systems/user.h>
#include <atomic>
#include <cassert>
@@ -26,52 +26,52 @@ custom_push_region(const char* name);
namespace
{
omnitrace_user_callbacks_t custom_callbacks = OMNITRACE_USER_CALLBACKS_INIT;
omnitrace_user_callbacks_t original_callbacks = OMNITRACE_USER_CALLBACKS_INIT;
rocprofsys_user_callbacks_t custom_callbacks = ROCPROFSYS_USER_CALLBACKS_INIT;
rocprofsys_user_callbacks_t original_callbacks = ROCPROFSYS_USER_CALLBACKS_INIT;
} // namespace
int
main(int argc, char** argv)
{
custom_callbacks.push_region = &custom_push_region;
omnitrace_user_configure(OMNITRACE_USER_UNION_CONFIG, custom_callbacks,
&original_callbacks);
rocprofsys_user_configure(ROCPROFSYS_USER_UNION_CONFIG, custom_callbacks,
&original_callbacks);
omnitrace_user_push_region(argv[0]);
omnitrace_user_push_region("initialization");
rocprofsys_user_push_region(argv[0]);
rocprofsys_user_push_region("initialization");
size_t nthread = std::min<size_t>(16, std::thread::hardware_concurrency());
size_t nitr = 50000;
long nfib = 10;
if(argc > 1) nfib = atol(argv[1]);
if(argc > 2) nthread = atol(argv[2]);
if(argc > 3) nitr = atol(argv[3]);
omnitrace_user_pop_region("initialization");
rocprofsys_user_pop_region("initialization");
printf("[%s] Threads: %zu\n[%s] Iterations: %zu\n[%s] fibonacci(%li)...\n", argv[0],
nthread, argv[0], nitr, argv[0], nfib);
omnitrace_user_push_region("thread_creation");
rocprofsys_user_push_region("thread_creation");
std::vector<std::thread> threads{};
threads.reserve(nthread);
// disable instrumentation for child threads
omnitrace_user_stop_thread_trace();
rocprofsys_user_stop_thread_trace();
for(size_t i = 0; i < nthread; ++i)
{
threads.emplace_back(&run, nitr, nfib);
}
// re-enable instrumentation
omnitrace_user_start_thread_trace();
omnitrace_user_pop_region("thread_creation");
rocprofsys_user_start_thread_trace();
rocprofsys_user_pop_region("thread_creation");
omnitrace_user_push_region("thread_wait");
rocprofsys_user_push_region("thread_wait");
for(auto& itr : threads)
itr.join();
omnitrace_user_pop_region("thread_wait");
rocprofsys_user_pop_region("thread_wait");
run(nitr, nfib);
printf("[%s] fibonacci(%li) x %lu = %li\n", argv[0], nfib, nthread, total.load());
omnitrace_user_pop_region(argv[0]);
rocprofsys_user_pop_region(argv[0]);
return 0;
}
@@ -90,19 +90,19 @@ fib(long n)
void
run(size_t nitr, long n)
{
omnitrace_user_push_region(RUN_LABEL);
rocprofsys_user_push_region(RUN_LABEL);
long local = 0;
for(size_t i = 0; i < nitr; ++i)
local += fib(n);
total += local;
omnitrace_user_pop_region(RUN_LABEL);
rocprofsys_user_pop_region(RUN_LABEL);
}
int
custom_push_region(const char* name)
{
if(!original_callbacks.push_region || !original_callbacks.push_annotated_region)
return OMNITRACE_USER_ERROR_NO_BINDING;
return ROCPROFSYS_USER_ERROR_NO_BINDING;
printf("Pushing custom region :: %s\n", name);
@@ -113,13 +113,13 @@ custom_push_region(const char* name)
char _buff[1024];
if(_err != 0) _msg = strerror_r(_err, _buff, sizeof(_buff));
omnitrace_annotation_t _annotations[] = {
{ "errno", OMNITRACE_INT32, &_err }, { "strerror", OMNITRACE_STRING, _msg }
rocprofsys_annotation_t _annotations[] = {
{ "errno", ROCPROFSYS_INT32, &_err }, { "strerror", ROCPROFSYS_STRING, _msg }
};
errno = 0; // reset errno
return (*original_callbacks.push_annotated_region)(
name, _annotations, sizeof(_annotations) / sizeof(omnitrace_annotation_t));
name, _annotations, sizeof(_annotations) / sizeof(rocprofsys_annotation_t));
}
return (*original_callbacks.push_region)(name);
@@ -196,12 +196,12 @@ NPROC=$(nproc)
if [ ${NJOBS} -gt ${NPROC} ]; then NJOBS=${NPROC}; fi
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF -DCPACK_GENERATOR=STGZ"
OMNITRACE_GENERAL_ARGS="-DOMNITRACE_CPACK_SYSTEM_NAME=${DISTRO} -DOMNITRACE_ROCM_VERSION=${ROCM_VERSION} -DOMNITRACE_MAX_THREADS=${MAX_THREADS} -DOMNITRACE_STRIP_LIBRARIES=${STRIP} -DOMNITRACE_INSTALL_PERFETTO_TOOLS=${PERFETTO_TOOLS}"
OMNITRACE_BUILD_ARGS="-DOMNITRACE_BUILD_TESTING=OFF -DOMNITRACE_BUILD_EXAMPLES=OFF -DOMNITRACE_BUILD_PAPI=ON -DOMNITRACE_BUILD_LTO=${LTO} -DOMNITRACE_BUILD_HIDDEN_VISIBILITY=${HIDDEN_VIZ} -DOMNITRACE_BUILD_STATIC_LIBGCC=${LIBGCC} -DOMNITRACE_BUILD_STATIC_LIBSTDCXX=${LIBSTDCXX} -DOMNITRACE_BUILD_RELEASE=ON"
OMNITRACE_USE_ARGS="-DOMNITRACE_USE_MPI_HEADERS=ON -DOMNITRACE_USE_OMPT=ON -DOMNITRACE_USE_PAPI=ON"
ROCPROFSYS_GENERAL_ARGS="-DROCPROFSYS_CPACK_SYSTEM_NAME=${DISTRO} -DROCPROFSYS_ROCM_VERSION=${ROCM_VERSION} -DROCPROFSYS_MAX_THREADS=${MAX_THREADS} -DROCPROFSYS_STRIP_LIBRARIES=${STRIP} -DROCPROFSYS_INSTALL_PERFETTO_TOOLS=${PERFETTO_TOOLS}"
ROCPROFSYS_BUILD_ARGS="-DROCPROFSYS_BUILD_TESTING=OFF -DROCPROFSYS_BUILD_EXAMPLES=OFF -DROCPROFSYS_BUILD_PAPI=ON -DROCPROFSYS_BUILD_LTO=${LTO} -DROCPROFSYS_BUILD_HIDDEN_VISIBILITY=${HIDDEN_VIZ} -DROCPROFSYS_BUILD_STATIC_LIBGCC=${LIBGCC} -DROCPROFSYS_BUILD_STATIC_LIBSTDCXX=${LIBSTDCXX} -DROCPROFSYS_BUILD_RELEASE=ON"
ROCPROFSYS_USE_ARGS="-DROCPROFSYS_USE_MPI_HEADERS=ON -DROCPROFSYS_USE_OMPT=ON -DROCPROFSYS_USE_PAPI=ON"
TIMEMORY_ARGS="-DTIMEMORY_USE_LIBUNWIND=ON -DTIMEMORY_BUILD_LIBUNWIND=ON -DTIMEMORY_BUILD_PORTABLE=ON"
DYNINST_ARGS="-DOMNITRACE_BUILD_DYNINST=ON -DDYNINST_USE_OpenMP=ON $(echo -DDYNINST_BUILD_{TBB,BOOST,ELFUTILS,LIBIBERTY}=ON) -DDYNINST_BOOST_DOWNLOAD_VERSION=${BOOST_VERSION}"
STANDARD_ARGS="${CMAKE_ARGS} ${OMNITRACE_GENERAL_ARGS} ${OMNITRACE_USE_ARGS} ${OMNITRACE_BUILD_ARGS} ${TIMEMORY_ARGS} ${DYNINST_ARGS} ${EXTRA_ARGS}"
DYNINST_ARGS="-DROCPROFSYS_BUILD_DYNINST=ON -DDYNINST_USE_OpenMP=ON $(echo -DDYNINST_BUILD_{TBB,BOOST,ELFUTILS,LIBIBERTY}=ON) -DDYNINST_BOOST_DOWNLOAD_VERSION=${BOOST_VERSION}"
STANDARD_ARGS="${CMAKE_ARGS} ${ROCPROFSYS_GENERAL_ARGS} ${ROCPROFSYS_USE_ARGS} ${ROCPROFSYS_BUILD_ARGS} ${TIMEMORY_ARGS} ${DYNINST_ARGS} ${EXTRA_ARGS}"
SCRIPT_DIR=$(realpath $(dirname ${BASH_SOURCE[0]}))
cd $(dirname ${SCRIPT_DIR})
@@ -265,13 +265,13 @@ build-and-package-base()
DEST="stgz"
;;
DEB)
verbose-run cpack -G DEB -D CPACK_PACKAGING_INSTALL_PREFIX=/opt/omnitrace
verbose-run cpack -G DEB -D CPACK_PACKAGING_INSTALL_PREFIX=/opt/rocprof-sys
EXT="deb"
SEP="_"
DEST="deb"
;;
RPM)
verbose-run cpack -G RPM -D CPACK_PACKAGING_INSTALL_PREFIX=/opt/omnitrace
verbose-run cpack -G RPM -D CPACK_PACKAGING_INSTALL_PREFIX=/opt/rocprof-sys
EXT="rpm"
SEP="-"
DEST="rpm"
@@ -344,7 +344,7 @@ build-and-package-python()
fi
conda deactivate
done
build-and-package-base ${DIR}-python $@ -DOMNITRACE_USE_PYTHON=ON -DOMNITRACE_BUILD_PYTHON=ON -DOMNITRACE_PYTHON_ROOT_DIRS=\"${_PYTHON_ENVS}\"
build-and-package-base ${DIR}-python $@ -DROCPROFSYS_USE_PYTHON=ON -DROCPROFSYS_BUILD_PYTHON=ON -DROCPROFSYS_PYTHON_ROOT_DIRS=\"${_PYTHON_ENVS}\"
}
build-and-package()
@@ -372,7 +372,7 @@ if [ "${IS_DOCKER}" -ne 0 ]; then git config --global --add safe.directory ${PWD
verbose-run echo "Build omnitrace installers with generators: ${GENERATORS}"
build-and-package ${WITH_CORE} ${DISTRO}-core -DOMNITRACE_USE_HIP=OFF -DOMNITRACE_USE_MPI=OFF
build-and-package ${WITH_MPI} ${DISTRO}-${MPI_IMPL} -DOMNITRACE_USE_HIP=OFF -DOMNITRACE_USE_MPI=ON
build-and-package ${WITH_ROCM} ${DISTRO}-rocm-${ROCM_VERSION} -DOMNITRACE_USE_HIP=ON -DOMNITRACE_USE_MPI=OFF
build-and-package ${WITH_ROCM_MPI} ${DISTRO}-rocm-${ROCM_VERSION}-${MPI_IMPL} -DOMNITRACE_USE_HIP=ON -DOMNITRACE_USE_MPI=ON
build-and-package ${WITH_CORE} ${DISTRO}-core -DROCPROFSYS_USE_HIP=OFF -DROCPROFSYS_USE_MPI=OFF
build-and-package ${WITH_MPI} ${DISTRO}-${MPI_IMPL} -DROCPROFSYS_USE_HIP=OFF -DROCPROFSYS_USE_MPI=ON
build-and-package ${WITH_ROCM} ${DISTRO}-rocm-${ROCM_VERSION} -DROCPROFSYS_USE_HIP=ON -DROCPROFSYS_USE_MPI=OFF
build-and-package ${WITH_ROCM_MPI} ${DISTRO}-rocm-${ROCM_VERSION}-${MPI_IMPL} -DROCPROFSYS_USE_HIP=ON -DROCPROFSYS_USE_MPI=ON
+223
Parādīt failu
@@ -0,0 +1,223 @@
#!/usr/bin/env bash
# Start of configuration
preamble="Copyright +(\([cC]\) +)?"
postamble=",? +Advanced +Micro +Devices, +Inc\."
find_pattern="$preamble([0-9]{4}-)?[0-9]{4}$postamble"
# printf format string, receives the current year as a parameter
uptodate_pattern="$preamble([0-9]{4}-)?%d$postamble"
# <pattern>/<replacement> interpreted with sed syntax, also passed to printf
# printf interprets '\' escape sequences so they must be escaped
# The capture groups are as follows:
# - \1 is the whole preamble text
# - \3 is the start year, \2 is skipped because it is used for an optional part of the preamble
# - \5 is the end of the copyright statement after the end year, \4 would be the original end year
# as written in the file, it is replaced by the current year instead.
replace_pattern="($preamble)([0-9]{4})(-[0-9]{4})?($postamble)/\\\1\\\3-%d\\\5"
# End of configuration
print_help() { printf -- \
"\033[36musuage\033[0m: \033[33mcheck_year.sh [-h] [-u] [-a] [-d <SHA>] [-k] [-v]\033[0m
\033[36mdescription\033[0m: Checks for if the copyright year in the staged files is up to date and displays the files with out-of-date copyright statements. Exits with '0' if successful and with '1' if something is out of date.
\033[36moptions\033[0m:
\033[34m-h\033[0m Displays this message.
\033[34m-u\033[0m Automatically updates the copyright year
\033[34m-a\033[0m Automatically applies applies the changes to current staging environment. Implies '-u' and '-c'.
\033[34m-c\033[0m Compare files to the index instead of the working tree.
\033[34m-d <SHA>\033[0m Compare using the diff of a hash.
\033[34m-k\033[0m Compare using the fork point: where this branch and 'remotes/origin/HEAD' diverge.
\033[34m-q\033[0m Suppress updates about progress.
\033[34m-v\033[0m Verbose output.
Use '\033[33mgit config --local hooks.updateCopyright <true|false>\033[0m' to automatically apply copyright changes on commit.
"
}
# argument parsing
apply=false
update=false
verbose=false
forkdiff=false
quiet=false
cached=false
while getopts "auhvkqcd:" arg; do
case $arg in
a) update=true;apply=true;cached=true;;
u) update=true;;
v) verbose=true;;
k) forkdiff=true;;
q) quiet=true;;
c) cached=true;;
d) diff_hash=${OPTARG};;
h) print_help; exit;;
*) print help; exit 1;;
esac
done
# If set, check all files changed since the fork point
if $forkdiff; then
branch="$(git rev-parse --abbrev-ref HEAD)"
remote="$(git config --local --get "branch.$branch.remote" || echo 'origin')"
source_commit="remotes/$remote/HEAD"
# don't use fork-point for finding fork point (lol)
# see: https://stackoverflow.com/a/53981615
diff_hash="$(git merge-base "$source_commit" "$branch")"
fi
if [ -n "${diff_hash}" ]; then
$verbose && printf -- "Using base commit: %s\n" "${diff_hash}"
else
diff_hash="HEAD"
fi
# Current year
year="$(date +%Y)"
# Enable rename detection with full matches only, this skips copyright checks for file name only
# changes.
diff_opts=(-z --name-only '--diff-filter=MA' '--find-renames=100%')
git_grep_opts=(-z --extended-regexp --ignore-case --no-recursive -I)
if $cached; then
diff_opts+=(--cached)
git_grep_opts+=(--cached)
fi
! $quiet && printf -- "Checking if copyright statements are up-to-date... "
mapfile -d $'\0' changed_files < <(git diff-index "${diff_opts[@]}" "$diff_hash" | LANG=C.UTF-8 sort -z)
if ! (( ${#changed_files[@]} )); then
! $quiet && printf -- "\033[32mDone!\033[0m\n"
$verbose && printf -- "\033[36mNo changed files found.\033[0m\n"
exit 0
fi;
mapfile -d $'\0' found_copyright < <( \
git grep "${git_grep_opts[@]}" --files-with-matches -e "$find_pattern" \
-- "${changed_files[@]}" | \
LANG=C.UTF-8 sort -z)
outdated_copyright=()
if (( ${#found_copyright[@]} )); then
# uptodate_pattern variable holds the format string using it as such is intentional
# shellcheck disable=SC2059
printf -v uptodate_pattern -- "$uptodate_pattern" "$year"
mapfile -d $'\0' outdated_copyright < <( \
git grep "${git_grep_opts[@]}" --files-without-match -e "$uptodate_pattern" \
-- "${found_copyright[@]}" | \
LANG=C.UTF-8 sort -z)
fi
! $quiet && printf -- "\033[32mDone!\033[0m\n"
if $verbose; then
# Compute the files that don't have a copyright as the set difference of
# `changed_files and `found_copyright`
mapfile -d $'\0' notfound_copyright < <( \
printf -- '%s\0' "${changed_files[@]}" | \
LANG=C.UTF-8 comm -z -23 - <(printf -- '%s\0' "${found_copyright[@]}"))
if (( ${#notfound_copyright[@]} )); then
printf -- "\033[36mCouldn't find a copyright statement in %d file(s):\033[0m\n" \
"${#notfound_copyright[@]}"
printf -- ' - %q\n' "${notfound_copyright[@]}"
fi
# Similarly the up-to-date files are the difference of `found_copyright` and `outdated_copyright`
mapfile -d $'\0' uptodate_copyright < <( \
printf -- '%s\0' "${found_copyright[@]}" | \
LANG=C.UTF-8 comm -z -23 - <(printf -- '%s\0' "${outdated_copyright[@]}"))
if (( ${#uptodate_copyright[@]} )); then
printf -- "\033[36mThe copyright statement was already up to date in %d file(s):\033[0m\n" \
"${#uptodate_copyright[@]}"
printf -- ' - %q\n' "${uptodate_copyright[@]}"
fi
fi
if ! (( ${#outdated_copyright[@]} )); then
exit 0
fi
printf -- \
"\033[31m==== COPYRIGHT OUT OF DATE ====\033[0m
\033[36m%d file(s) need(s) to be updated:\033[0m\n" "${#outdated_copyright[@]}"
printf -- ' - %q\n' "${outdated_copyright[@]}"
# If we don't need to update, we early exit.
if ! $update; then
printf -- \
"\nRun '\033[33m%s -u\033[0m' to update the copyright statement(s). See '-h' for more info,
or set '\033[33mgit config --local hooks.updateCopyright true\033[0m' to automatically update copyrights when committing.\n" \
"${BASH_SOURCE[0]}"
exit 1
fi
if $apply; then
! $quiet && printf -- "Updating copyrights and staging changes... "
else
! $quiet && printf -- "Updating copyrights... "
fi
# replace_pattern variable holds a format string, using it as such is intentional
# shellcheck disable=SC2059
printf -v replace_pattern -- "$replace_pattern" "$year"
# Just update the files in place if only touching the working-tree
if ! $apply; then
sed --regexp-extended --separate "s/$replace_pattern/g" -i "${outdated_copyright[@]}"
printf -- "\033[32mDone!\033[0m\n"
exit 0
fi
generate_patch() {
# Sed command to create a hunk for a copyright statement fix
# expects input to be line number then copyright statement on the next line
to_hunk_cmd="{# Print hunk header, move to the next line
s/.+/@@ -&,1 +&,1 @@/;n
# Print removed line by prepending '-' to it
;s/^/-/;p
# Print added line, replace the '-' with '+' and replace the copyright statement
s/^-/+/;s/$replace_pattern/g}"
# Run file-names through git ls-files, just to get a (possibly) quoted name for each
mapfile -t -d $'\n' quoted_files < <(git ls-files --cached -- "${outdated_copyright[@]}")
for ((i = 0;i < ${#outdated_copyright[@]}; i++)); do
file="${outdated_copyright["$i"]}"
quoted="${quoted_files["$i"]}"
# Drop the quote from the start and end (to avoid quoting twice)
escaped="${quoted#\"}"; escaped="${escaped%\"}"
a="\"a/$escaped\""
b="\"b/$escaped\""
printf -- "diff --git %s %s\n--- %s\n+++ %s\n" "$a" "$b" "$a" "$b"
# Print line number and line for each line with a copyright statement
git cat-file blob ":$file" | \
sed --quiet --regexp-extended "/$find_pattern/{=;p}" | \
sed --regexp-extended "$to_hunk_cmd"
done
}
patch_file="$(git rev-parse --git-dir)/copyright-fix.patch"
generate_patch > "$patch_file"
# Cleanup patch file when the script exits
finish () {
rm -f "$patch_file"
}
# The trap will be invoked whenever the script exits, even due to a signal, this is a bash only
# feature
trap finish EXIT
if ! git apply --unidiff-zero < "$patch_file"; then
printf -- "\033[31mFailed to apply changes to working tree.
Perhaps the fix is already applied, but not yet staged?\n\033[0m"
exit 1
fi
if ! git apply --cached --unidiff-zero < "$patch_file"; then
printf -- "\033[31mFailed to apply change to the index.\n\033[0m"
exit 1
fi
! $quiet && printf -- "\033[32mDone!\033[0m\n"
exit 0
@@ -6,7 +6,7 @@ import glob
"""
This script reads in function prototypes can generates the implementation pieces
needed to dlsym the function in libomnitrace
needed to dlsym the function in librocprof-sys.
Example input file:
@@ -18,13 +18,13 @@ generates:
##### declaration:
bool OnLoad(HsaApiTable*, uint64_t, uint64_t, const char* const*) OMNITRACE_PUBLIC_API;
void OnUnload() OMNITRACE_PUBLIC_API;
bool OnLoad(HsaApiTable*, uint64_t, uint64_t, const char* const*) ROCPROFSYS_PUBLIC_API;
void OnUnload() ROCPROFSYS_PUBLIC_API;
##### dlsym:
OMNITRACE_DLSYM(OnLoad_f, m_omnihandle, "OnLoad");
OMNITRACE_DLSYM(OnUnload_f, m_omnihandle, "OnUnload");
ROCPROFSYS_DLSYM(OnLoad_f, m_omnihandle, "OnLoad");
ROCPROFSYS_DLSYM(OnUnload_f, m_omnihandle, "OnUnload");
##### member variables:
@@ -35,12 +35,12 @@ generates:
bool OnLoad(HsaApiTable* table, uint64_t runtime_version, uint64_t failed_tool_count, const char* const* failed_tool_names)
{
return OMNITRACE_DL_INVOKE(get_indirect().OnLoad_f, table, runtime_version, failed_tool_count, failed_tool_names);
return ROCPROFSYS_DL_INVOKE(get_indirect().OnLoad_f, table, runtime_version, failed_tool_count, failed_tool_names);
}
void OnUnload()
{
return OMNITRACE_DL_INVOKE(get_indirect().OnUnload_f);
return ROCPROFSYS_DL_INVOKE(get_indirect().OnUnload_f);
}
"""
@@ -69,18 +69,18 @@ class function:
)
def function_decl(self):
return " {} {}({}) OMNITRACE_PUBLIC_API;".format(
return " {} {}({}) ROCPROFSYS_PUBLIC_API;".format(
self.return_type, self.func_name, ", ".join(self.param_types)
)
def dlsym_function(self):
return ' OMNITRACE_DLSYM({0}_f, m_omnihandle, "{0}");'.format(self.func_name)
return ' ROCPROFSYS_DLSYM({0}_f, m_omnihandle, "{0}");'.format(self.func_name)
def call_dlsym_function(self):
_param_names = ", ".join(self.param_names)
if _param_names and _param_names != ", ":
_param_names = f", {_param_names}"
return " {} {}({})\n {}\n return OMNITRACE_DL_INVOKE(get_indirect().{}_f{});\n {}".format(
return " {} {}({})\n {}\n return ROCPROFSYS_DL_INVOKE(get_indirect().{}_f{});\n {}".format(
self.return_type,
self.func_name,
", ".join(self.params),
@@ -87,7 +87,7 @@ run-pprof()
}
# configure pre-loading of profiler library
for i in $(find ${PWD} -type f | egrep 'libomnitrace' | egrep -v '\.a$' | egrep '\.so$') $(ldd ${1} | awk '{print $(NF-1)}')
for i in $(find ${PWD} -type f | egrep 'librocprof-sys' | egrep -v '\.a$' | egrep '\.so$') $(ldd ${1} | awk '{print $(NF-1)}')
do
if [ -f "${i}" ]; then run-verbose ADD_LIBS "${i}"; fi
done
@@ -1,7 +1,7 @@
#!/bin/bash -e
#
# This script allows CMAKE_CXX_COMPILER to be a standard
# C++ compiler and omnitrace sets RULE_LAUNCH_COMPILE and
# C++ compiler and rocprofiler-systems sets RULE_LAUNCH_COMPILE and
# RULE_LAUNCH_LINK in CMake so that all compiler and link
# commands are prefixed with this script followed by the
# C++ compiler. Thus if $1 == $2 then we know the command
@@ -15,24 +15,24 @@
# emit a message about the underlying command executed
: ${DEBUG:=0}
: ${OMNITRACE_DEBUG_LAUNCH_COMPILER:=${DEBUG}}
: ${ROCPROFSYS_DEBUG_LAUNCH_COMPILER:=${DEBUG}}
debug-message()
{
if [ "${OMNITRACE_DEBUG_LAUNCH_COMPILER}" -ne 0 ]; then
if [ "${ROCPROFSYS_DEBUG_LAUNCH_COMPILER}" -ne 0 ]; then
echo -e "##### $(basename ${BASH_SOURCE[0]}) executing: \"$@\"... #####"
fi
}
# if omnitrace compiler is not passed, someone is probably trying to invoke it directly
# if rocprofiler-systems compiler is not passed, someone is probably trying to invoke it directly
if [ -z "${1}" ]; then
echo -e "\n${BASH_SOURCE[0]} was invoked without the omnitrace compiler as the first argument."
echo -e "\n${BASH_SOURCE[0]} was invoked without the rocprofiler-systems compiler as the first argument."
echo "This script is not indended to be directly invoked by any mechanism other"
echo -e "than through a RULE_LAUNCH_COMPILE or RULE_LAUNCH_LINK property set in CMake.\n"
exit 1
fi
# if omnitrace compiler is not passed, someone is probably trying to invoke it directly
# if rocprofiler-systems compiler is not passed, someone is probably trying to invoke it directly
if [ -z "${2}" ]; then
echo -e "\n${BASH_SOURCE[0]} was invoked without the C++ compiler as the second argument."
echo "This script is not indended to be directly invoked by any mechanism other"
@@ -43,10 +43,10 @@ fi
# if there aren't two args, this isn't necessarily invalid, just a bit strange
if [ -z "${3}" ]; then exit 0; fi
# store the omnitrace compiler
OMNITRACE_COMPILER=${1}
# store the rocprofiler-systems compiler
ROCPROFSYS_COMPILER=${1}
# remove the omnitrace compiler from the arguments
# remove the rocprofiler-systems compiler from the arguments
shift
# store the expected C++ compiler
@@ -81,19 +81,19 @@ fi
if [[ "${CXX_COMPILER}" != "${1}" ]]; then
debug-message $@
# the command does not depend on omnitrace so just execute the command w/o re-directing to ${OMNITRACE_COMPILER}
# the command does not depend on rocprofiler-systems so just execute the command w/o re-directing to ${ROCPROFSYS_COMPILER}
eval $@
else
# the executable is the C++ compiler, so we need to re-direct to ${OMNITRACE_COMPILER}
if [ ! -f "${OMNITRACE_COMPILER}" ]; then
echo -e "\nError: the compiler redirect for omnitrace was not found at ${OMNITRACE_COMPILER}\n"
# the executable is the C++ compiler, so we need to re-direct to ${ROCPROFSYS_COMPILER}
if [ ! -f "${ROCPROFSYS_COMPILER}" ]; then
echo -e "\nError: the compiler redirect for rocprofiler-systems was not found at ${ROCPROFSYS_COMPILER}\n"
exit 1
fi
# discard the compiler from the command
shift
debug-message ${OMNITRACE_COMPILER} $@
# execute ${OMNITRACE_COMPILER} (again, usually nvcc_wrapper)
${OMNITRACE_COMPILER} $@
debug-message ${ROCPROFSYS_COMPILER} $@
# execute ${ROCPROFSYS_COMPILER} (again, usually nvcc_wrapper)
${ROCPROFSYS_COMPILER} $@
fi
@@ -1,5 +1,5 @@
# false positive
race:omnitrace::component::pthread_create_gotcha::operator()
race:rocprofsys::component::pthread_create_gotcha::operator()
race:pthread_create
race:tim::impl::storage<*>::_data()
race:tim::graph<*>::append_child
@@ -39,7 +39,7 @@ def generate_custom(args, cmake_args, ctest_args):
NAME = re.sub(r"(.*)-([0-9]+)/merge", "PR_\\2_\\1", NAME)
return f"""
set(CTEST_PROJECT_NAME "Omnitrace")
set(CTEST_PROJECT_NAME "rocprofiler-systems")
set(CTEST_NIGHTLY_START_TIME "05:00:00 UTC")
set(CTEST_DROP_METHOD "http")
@@ -66,7 +66,7 @@ def generate_custom(args, cmake_args, ctest_args):
set(CTEST_BINARY_DIRECTORY {BINARY_DIR})
set(CTEST_UPDATE_COMMAND {GIT_CMD})
set(CTEST_CONFIGURE_COMMAND "{CMAKE_CMD} -B {BINARY_DIR} {SOURCE_DIR} -DOMNITRACE_BUILD_CI=ON {CMAKE_ARGS}")
set(CTEST_CONFIGURE_COMMAND "{CMAKE_CMD} -B {BINARY_DIR} {SOURCE_DIR} -DROCPROFSYS_BUILD_CI=ON {CMAKE_ARGS}")
set(CTEST_BUILD_COMMAND "{CMAKE_CMD} --build {BINARY_DIR} --target all --parallel {BUILD_JOBS}")
set(CTEST_COVERAGE_COMMAND {GCOV_CMD})
"""
@@ -138,7 +138,7 @@ def parse_cdash_args(args):
BINARY_DIR = os.path.join(SOURCE_DIR, "build")
SITE = socket.gethostname()
NAME = None
SUBMIT_URL = "my.cdash.org/submit.php?project=Omnitrace"
SUBMIT_URL = "my.cdash.org/submit.php?project=rocprofiler-systems"
CODECOV = False
parser = argparse.ArgumentParser()
@@ -219,7 +219,10 @@ def parse_args(args=None):
cdash_args = parse_cdash_args(input_args)
if cdash_args.coverage:
cmake_args += ["-DOMNITRACE_BUILD_CODECOV=ON", "-DOMNITRACE_STRIP_LIBRARIES=OFF"]
cmake_args += [
"-DROCPROFSYS_BUILD_CODECOV=ON",
"-DROCPROFSYS_STRIP_LIBRARIES=OFF",
]
def get_repeat_val(_param):
_value = getattr(cdash_args, f"repeat_{_param}".replace("-", "_"))
@@ -20,7 +20,7 @@ toupper()
: ${BINARY_DIR:=${PWD}/build}
: ${SITE:=$(hostname)}
: ${NAME:=""}
: ${SUBMIT_URL:="my.cdash.org/submit.php?project=Omnitrace"}
: ${SUBMIT_URL:="my.cdash.org/submit.php?project=rocprofiler-systems"}
: ${CODECOV:=0}
usage()
@@ -159,7 +159,7 @@ export CMAKE_BUILD_PARALLEL_LEVEL
if [ "${CODECOV}" -gt 0 ]; then
GCOV_CMD=$(which gcov)
CMAKE_ARGS="${CMAKE_ARGS} -DOMNITRACE_BUILD_CODECOV=ON -DOMNITRACE_STRIP_LIBRARIES=OFF"
CMAKE_ARGS="${CMAKE_ARGS} -DROCPROFSYS_BUILD_CODECOV=ON -DROCPROFSYS_STRIP_LIBRARIES=OFF"
fi
GIT_CMD=$(which git)
@@ -172,7 +172,7 @@ verbose-run mkdir -p ${BINARY_DIR}
cat << EOF > ${BINARY_DIR}/CTestCustom.cmake
set(CTEST_PROJECT_NAME "Omnitrace")
set(CTEST_PROJECT_NAME "rocprofiler-systems")
set(CTEST_NIGHTLY_START_TIME "05:00:00 UTC")
set(CTEST_DROP_METHOD "http")
@@ -199,7 +199,7 @@ set(CTEST_SOURCE_DIRECTORY ${SOURCE_DIR})
set(CTEST_BINARY_DIRECTORY ${BINARY_DIR})
set(CTEST_UPDATE_COMMAND ${GIT_CMD})
set(CTEST_CONFIGURE_COMMAND "${CMAKE_CMD} -B ${BINARY_DIR} ${SOURCE_DIR} -DOMNITRACE_BUILD_CI=ON ${CMAKE_ARGS}")
set(CTEST_CONFIGURE_COMMAND "${CMAKE_CMD} -B ${BINARY_DIR} ${SOURCE_DIR} -DROCPROFSYS_BUILD_CI=ON ${CMAKE_ARGS}")
set(CTEST_BUILD_COMMAND "${CMAKE_CMD} --build ${BINARY_DIR} --target all --parallel ${CMAKE_BUILD_PARALLEL_LEVEL}")
set(CTEST_COVERAGE_COMMAND ${GCOV_CMD})
EOF
@@ -23,9 +23,9 @@ fi
: ${EXAMPLE_DIR:=examples}
: ${EXAMPLE_NAME:=user-api}
: ${SOURCE_DIR:=$(mktemp -t -d omnitrace-test-source-XXXX)}
: ${BINARY_DIR:=$(mktemp -t -d omnitrace-test-build-XXXX)}
: ${INSTALL_DIR:=$(mktemp -t -d omnitrace-install-XXXX)}
: ${SOURCE_DIR:=$(mktemp -t -d rocprof-sys-test-source-XXXX)}
: ${BINARY_DIR:=$(mktemp -t -d rocprof-sys-test-build-XXXX)}
: ${INSTALL_DIR:=$(mktemp -t -d rocprof-sys-install-XXXX)}
: ${INSTALL_SCRIPT:=""}
usage()
@@ -36,7 +36,7 @@ usage()
print_option example-dir "<PATH>" "Directory containing example" "${EXAMPLE_DIR}"
print_option source-dir "<PATH>" "Location to copy example to" "${SOURCE_DIR}"
print_option binary-dir "<PATH>" "Location to build" "${BINARY_DIR}"
print_option install-dir "<PATH>" "Location of omnitrace installation" "${INSTALL_DIR}"
print_option install-dir "<PATH>" "Location of rocprofiler-systems installation" "${INSTALL_DIR}"
print_option install-script "<FILEPATH>" "Absolute path to the installer script" ""
}
@@ -92,9 +92,9 @@ do
esac
done
if [ ! -f "${INSTALL_DIR}/include/omnitrace/user.h" ]; then
if [ ! -f "${INSTALL_DIR}/include/rocprofiler-systems/user.h" ]; then
if [ -z "${INSTALL_SCRIPT}" ]; then
error-message "Unable to find \"omnitrace/user.h\" in \"${INSTALL_DIR}/include\" and installation script not provided"
error-message "Unable to find \"rocprofiler-systems/user.h\" in \"${INSTALL_DIR}/include\" and installation script not provided"
elif [ ! -f "${INSTALL_SCRIPT}" ]; then
error-message "Unable to locate \"${INSTALL_SCRIPT}\" in directory \"${PWD}\""
else
@@ -122,10 +122,10 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(omnitrace REQUIRED COMPONENTS user)
find_package(rocprofiler-systems REQUIRED COMPONENTS user)
find_package(Threads REQUIRED)
get_target_property(LIBS omnitrace::omnitrace INTERFACE_LINK_LIBRARIES)
get_target_property(LIBS rocprofiler-systems::rocprofiler-systems INTERFACE_LINK_LIBRARIES)
foreach(_LIB \${LIBS})
foreach(_VAR LINK_LIBRARIES INCLUDE_DIRECTORIES)
get_target_property(_VAL \${_LIB} INTERFACE_\${_VAR})
@@ -137,7 +137,7 @@ endforeach()
file(GLOB sources \${CMAKE_CURRENT_LIST_DIR}/*.cpp \${CMAKE_CURRENT_LIST_DIR}/*.c)
add_executable(app \${sources})
target_link_libraries(app PRIVATE Threads::Threads omnitrace::omnitrace)
target_link_libraries(app PRIVATE Threads::Threads rocprofiler-systems::rocprofiler-systems)
EOF
export CMAKE_PREFIX_PATH=${INSTALL_DIR}:${CMAKE_PREFIX_PATH}
@@ -34,46 +34,46 @@ if [ -d "$(realpath /tmp)" ]; then
export TMPDIR
fi
: ${CONFIG_DIR:=$(mktemp -t -d omnitrace-test-install-XXXX)}
: ${CONFIG_DIR:=$(mktemp -t -d rocprof-sys-test-install-XXXX)}
: ${SOURCE_DIR:=$(dirname ${SCRIPT_DIR})}
: ${ENABLE_OMNITRACE_INSTRUMENT:=1}
: ${ENABLE_OMNITRACE_AVAIL:=1}
: ${ENABLE_OMNITRACE_SAMPLE:=1}
: ${ENABLE_OMNITRACE_PYTHON:=0}
: ${ENABLE_OMNITRACE_REWRITE:=1}
: ${ENABLE_OMNITRACE_RUNTIME:=1}
: ${ENABLE_ROCPROFSYS_INSTRUMENT:=1}
: ${ENABLE_ROCPROFSYS_AVAIL:=1}
: ${ENABLE_ROCPROFSYS_SAMPLE:=1}
: ${ENABLE_ROCPROFSYS_PYTHON:=0}
: ${ENABLE_ROCPROFSYS_REWRITE:=1}
: ${ENABLE_ROCPROFSYS_RUNTIME:=1}
usage()
{
print_option() { printf " --%-10s %-24s %s (default: %s)\n" "${1}" "${2}" "${3}" "${4}"; }
print_option() { printf " --%-10s %-30s %s (default: %s)\n" "${1}" "${2}" "${3}" "${4}"; }
echo "Options:"
print_option source-dir "<PATH>" "Location of source directory" "${SOURCE_DIR}"
print_option test-omnitrace-instrument "0|1" "Enable testing omnitrace-instrument exe" "${ENABLE_OMNITRACE_INSTRUMENT}"
print_option test-omnitrace-avail "0|1" "Enable testing omnitrace-avail" "${ENABLE_OMNITRACE_AVAIL}"
print_option test-omnitrace-sample "0|1" "Enable testing omnitrace-sample" "${ENABLE_OMNITRACE_SAMPLE}"
print_option test-omnitrace-python "0|1" "Enable testing omnitrace-python" "${ENABLE_OMNITRACE_PYTHON}"
print_option test-omnitrace-rewrite "0|1" "Enable testing omnitrace-instrument binary rewrite" "${ENABLE_OMNITRACE_REWRITE}"
print_option test-omnitrace-runtime "0|1" "Enable testing omnitrace-instrument runtime instrumentation" "${ENABLE_OMNITRACE_RUNTIME}"
print_option test-rocprof-sys-instrument "0|1" "Enable testing rocprof-sys-instrument" "${ENABLE_ROCPROFSYS_INSTRUMENT}"
print_option test-rocprof-sys-avail "0|1" "Enable testing rocprof-sys-avail" "${ENABLE_ROCPROFSYS_AVAIL}"
print_option test-rocprof-sys-sample "0|1" "Enable testing rocprof-sys-sample" "${ENABLE_ROCPROFSYS_SAMPLE}"
print_option test-rocprof-sys-python "0|1" "Enable testing rocprof-sys-python" "${ENABLE_ROCPROFSYS_PYTHON}"
print_option test-rocprof-sys-rewrite "0|1" "Enable testing rocprof-sys-instrument binary rewrite" "${ENABLE_ROCPROFSYS_REWRITE}"
print_option test-rocprof-sys-runtime "0|1" "Enable testing rocprof-sys-instrument runtime instrumentation" "${ENABLE_ROCPROFSYS_RUNTIME}"
}
cat << EOF > ${CONFIG_DIR}/omnitrace.cfg
OMNITRACE_VERBOSE = 2
OMNITRACE_PROFILE = ON
OMNITRACE_TRACE = ON
OMNITRACE_USE_SAMPLING = ON
OMNITRACE_USE_PROCESS_SAMPLING = ON
OMNITRACE_OUTPUT_PATH = %env{CONFIG_DIR}%/omnitrace-tests-output
OMNITRACE_OUTPUT_PREFIX = %tag%/
OMNITRACE_SAMPLING_FREQ = 100
OMNITRACE_SAMPLING_DELAY = 0.05
OMNITRACE_COUT_OUTPUT = ON
OMNITRACE_TIME_OUTPUT = OFF
OMNITRACE_USE_PID = OFF
cat << EOF > ${CONFIG_DIR}/rocprof-sys.cfg
ROCPROFSYS_VERBOSE = 2
ROCPROFSYS_PROFILE = ON
ROCPROFSYS_TRACE = ON
ROCPROFSYS_USE_SAMPLING = ON
ROCPROFSYS_USE_PROCESS_SAMPLING = ON
ROCPROFSYS_OUTPUT_PATH = %env{CONFIG_DIR}%/rocprof-sys-tests-output
ROCPROFSYS_OUTPUT_PREFIX = %tag%/
ROCPROFSYS_SAMPLING_FREQ = 100
ROCPROFSYS_SAMPLING_DELAY = 0.05
ROCPROFSYS_COUT_OUTPUT = ON
ROCPROFSYS_TIME_OUTPUT = OFF
ROCPROFSYS_USE_PID = OFF
EOF
export CONFIG_DIR
export OMNITRACE_CONFIG_FILE=${CONFIG_DIR}/omnitrace.cfg
verbose-run cat ${OMNITRACE_CONFIG_FILE}
export ROCPROFSYS_CONFIG_FILE=${CONFIG_DIR}/rocprof-sys.cfg
verbose-run cat ${ROCPROFSYS_CONFIG_FILE}
while [[ $# -gt 0 ]]
do
@@ -100,28 +100,28 @@ do
fi
case "${ARG}" in
--test-omnitrace-instrument)
ENABLE_OMNITRACE_INSTRUMENT=${VAL}
--test-rocprof-sys-instrument)
ENABLE_ROCPROFSYS_INSTRUMENT=${VAL}
continue
;;
--test-omnitrace-avail)
ENABLE_OMNITRACE_AVAIL=${VAL}
--test-rocprof-sys-avail)
ENABLE_ROCPROFSYS_AVAIL=${VAL}
continue
;;
--test-omnitrace-sample)
ENABLE_OMNITRACE_SAMPLE=${VAL}
--test-rocprof-sys-sample)
ENABLE_ROCPROFSYS_SAMPLE=${VAL}
continue
;;
--test-omnitrace-python)
ENABLE_OMNITRACE_PYTHON=${VAL}
--test-rocprof-sys-python)
ENABLE_ROCPROFSYS_PYTHON=${VAL}
continue
;;
--test-omnitrace-rewrite)
ENABLE_OMNITRACE_REWRITE=${VAL}
--test-rocprof-sys-rewrite)
ENABLE_ROCPROFSYS_REWRITE=${VAL}
continue
;;
--test-omnitrace-runtime)
ENABLE_OMNITRACE_RUNTIME=${VAL}
--test-rocprof-sys-runtime)
ENABLE_ROCPROFSYS_RUNTIME=${VAL}
continue
;;
--source-dir)
@@ -136,40 +136,40 @@ do
esac
done
test-omnitrace()
test-rocprof-sys-instrument()
{
verbose-run which omnitrace
verbose-run ldd $(which omnitrace)
verbose-run omnitrace-instrument --help
verbose-run which rocprof-sys-instrument
verbose-run ldd $(which rocprof-sys-instrument)
verbose-run rocprof-sys-instrument --help
}
test-omnitrace-avail()
test-rocprof-sys-avail()
{
verbose-run which omnitrace-avail
verbose-run ldd $(which omnitrace-avail)
verbose-run omnitrace-avail --help
verbose-run omnitrace-avail -a
verbose-run which rocprof-sys-avail
verbose-run ldd $(which rocprof-sys-avail)
verbose-run rocprof-sys-avail --help
verbose-run rocprof-sys-avail -a
}
test-omnitrace-sample()
test-rocprof-sys-sample()
{
verbose-run which omnitrace-sample
verbose-run ldd $(which omnitrace-sample)
verbose-run omnitrace-sample --help
verbose-run omnitrace-sample --cputime 100 --realtime 50 --hsa-interrupt 0 -TPH -- python3 ${SOURCE_DIR}/examples/python/external.py -n 5 -v 20
verbose-run which rocprof-sys-sample
verbose-run ldd $(which rocprof-sys-sample)
verbose-run rocprof-sys-sample --help
verbose-run rocprof-sys-sample --cputime 100 --realtime 50 --hsa-interrupt 0 -TPH -- python3 ${SOURCE_DIR}/examples/python/external.py -n 5 -v 20
}
test-omnitrace-python()
test-rocprof-sys-python()
{
verbose-run which omnitrace-python
verbose-run omnitrace-python --help
verbose-run omnitrace-python -b -- ${SOURCE_DIR}/examples/python/builtin.py -n 5 -v 5
verbose-run omnitrace-python -b -- ${SOURCE_DIR}/examples/python/noprofile.py -n 5 -v 5
verbose-run omnitrace-python -- ${SOURCE_DIR}/examples/python/external.py -n 5 -v 5
verbose-run which rocprof-sys-python
verbose-run rocprof-sys-python --help
verbose-run rocprof-sys-python -b -- ${SOURCE_DIR}/examples/python/builtin.py -n 5 -v 5
verbose-run rocprof-sys-python -b -- ${SOURCE_DIR}/examples/python/noprofile.py -n 5 -v 5
verbose-run rocprof-sys-python -- ${SOURCE_DIR}/examples/python/external.py -n 5 -v 5
verbose-run python3 ${SOURCE_DIR}/examples/python/source.py -n 5 -v 5
}
test-omnitrace-rewrite()
test-rocprof-sys-rewrite()
{
if [ -f /usr/bin/coreutils ]; then
local LS_NAME=coreutils
@@ -178,13 +178,13 @@ test-omnitrace-rewrite()
local LS_NAME=ls
local LS_ARGS=""
fi
verbose-run omnitrace-instrument -e -v 1 -o ${CONFIG_DIR}/ls.inst --simulate -- ${LS_NAME}
for i in $(find ${CONFIG_DIR}/omnitrace-tests-output/ls.inst -type f); do verbose-run ls ${i}; done
verbose-run omnitrace-instrument -e -v 1 -o ${CONFIG_DIR}/ls.inst -- ${LS_NAME}
verbose-run omnitrace-run -- ${CONFIG_DIR}/ls.inst ${LS_ARGS}
verbose-run rocprof-sys-instrument -e -v 1 -o ${CONFIG_DIR}/ls.inst --simulate -- ${LS_NAME}
for i in $(find ${CONFIG_DIR}/rocprof-sys-tests-output/ls.inst -type f); do verbose-run ls ${i}; done
verbose-run rocprof-sys-instrument -e -v 1 -o ${CONFIG_DIR}/ls.inst -- ${LS_NAME}
verbose-run rocprof-sys-run -- ${CONFIG_DIR}/ls.inst ${LS_ARGS}
}
test-omnitrace-runtime()
test-rocprof-sys-runtime()
{
if [ -f /usr/bin/coreutils ]; then
local LS_NAME=coreutils
@@ -193,14 +193,14 @@ test-omnitrace-runtime()
local LS_NAME=ls
local LS_ARGS=""
fi
verbose-run omnitrace-instrument -e -v 1 --simulate -- ${LS_NAME} ${LS_ARGS}
for i in $(find ${CONFIG_DIR}/omnitrace-tests-output/$(basename ${LS_NAME}) -type f); do verbose-run ls ${i}; done
verbose-run omnitrace-instrument -e -v 1 -- ${LS_NAME} ${LS_ARGS}
verbose-run rocprof-sys-instrument -e -v 1 --simulate -- ${LS_NAME} ${LS_ARGS}
for i in $(find ${CONFIG_DIR}/rocprof-sys-tests-output/$(basename ${LS_NAME}) -type f); do verbose-run ls ${i}; done
verbose-run rocprof-sys-instrument -e -v 1 -- ${LS_NAME} ${LS_ARGS}
}
if [ "${ENABLE_OMNITRACE_INSTRUMENT}" -ne 0 ]; then verbose-run test-omnitrace; fi
if [ "${ENABLE_OMNITRACE_AVAIL}" -ne 0 ]; then verbose-run test-omnitrace-avail; fi
if [ "${ENABLE_OMNITRACE_SAMPLE}" -ne 0 ]; then verbose-run test-omnitrace-sample; fi
if [ "${ENABLE_OMNITRACE_PYTHON}" -ne 0 ]; then verbose-run test-omnitrace-python; fi
if [ "${ENABLE_OMNITRACE_REWRITE}" -ne 0 ]; then verbose-run test-omnitrace-rewrite; fi
if [ "${ENABLE_OMNITRACE_RUNTIME}" -ne 0 ]; then verbose-run test-omnitrace-runtime; fi
if [ "${ENABLE_ROCPROFSYS_INSTRUMENT}" -ne 0 ]; then verbose-run test-rocprof-sys-instrument; fi
if [ "${ENABLE_ROCPROFSYS_AVAIL}" -ne 0 ]; then verbose-run test-rocprof-sys-avail; fi
if [ "${ENABLE_ROCPROFSYS_SAMPLE}" -ne 0 ]; then verbose-run test-rocprof-sys-sample; fi
if [ "${ENABLE_ROCPROFSYS_PYTHON}" -ne 0 ]; then verbose-run test-rocprof-sys-python; fi
if [ "${ENABLE_ROCPROFSYS_REWRITE}" -ne 0 ]; then verbose-run test-rocprof-sys-rewrite; fi
if [ "${ENABLE_ROCPROFSYS_RUNTIME}" -ne 0 ]; then verbose-run test-rocprof-sys-runtime; fi
@@ -84,7 +84,7 @@ done
remove-pycache()
{
rm -rf ${1}/lib/python/site-packages/omnitrace/__pycache__
rm -rf ${1}/lib/python/site-packages/rocprofsys/__pycache__
}
setup-env()
@@ -96,11 +96,11 @@ setup-env()
test-install()
{
verbose-run omnitrace-instrument --help
verbose-run omnitrace-avail --help
verbose-run omnitrace-avail --all
if [ -d "${1}/lib/python/site-packages/omnitrace" ]; then
verbose-run omnitrace-python --help
verbose-run rocprof-sys-instrument --help
verbose-run rocprof-sys-avail --help
verbose-run rocprof-sys-avail --all
if [ -d "${1}/lib/python/site-packages/rocprofsys" ]; then
verbose-run rocprof-sys-python --help
fi
}
@@ -121,12 +121,12 @@ test-stgz()
if [ -z "${1}" ]; then return; fi
local INSTALLER=$(change-directory ${1})
mkdir /opt/omnitrace-stgz
setup-env /opt/omnitrace-stgz
mkdir /opt/rocprof-sys-stgz
setup-env /opt/rocprof-sys-stgz
verbose-run ${INSTALLER} --prefix=/opt/omnitrace-stgz --skip-license --exclude-dir
verbose-run ${INSTALLER} --prefix=/opt/rocprof-sys-stgz --skip-license --exclude-dir
test-install /opt/omnitrace-stgz
test-install /opt/rocprof-sys-stgz
}
test-deb()
@@ -134,16 +134,16 @@ test-deb()
if [ -z "${1}" ]; then return; fi
local INSTALLER=$(change-directory ${1})
setup-env /opt/omnitrace
setup-env /opt/rocprof-sys
verbose-run ${SUDO_CMD} dpkg --contents ${INSTALLER}
verbose-run ${SUDO_CMD} dpkg -i ${INSTALLER}
test-install /opt/omnitrace
remove-pycache /opt/omnitrace
verbose-run apt-get remove -y omnitrace
if [ -d /opt/omnitrace ]; then
find /opt/omnitrace -type f
test-install /opt/rocprof-sys
remove-pycache /opt/rocprof-sys
verbose-run apt-get remove -y rocprof-sys
if [ -d /opt/rocprof-sys ]; then
find /opt/rocprof-sys -type f
fi
}
@@ -152,16 +152,16 @@ test-rpm()
if [ -z "${1}" ]; then return; fi
local INSTALLER=$(change-directory ${1})
setup-env /opt/omnitrace
setup-env /opt/rocprof-sys
verbose-run ${SUDO_CMD} rpm -ql -p ${INSTALLER}
verbose-run ${SUDO_CMD} rpm -v -i -p ${INSTALLER} --nodeps
test-install /opt/omnitrace
remove-pycache /opt/omnitrace
verbose-run rpm -e omnitrace
if [ -d /opt/omnitrace ]; then
find /opt/omnitrace -type f
test-install /opt/rocprof-sys
remove-pycache /opt/rocprof-sys
verbose-run rpm -e rocprof-sys
if [ -d /opt/rocprof-sys ]; then
find /opt/rocprof-sys -type f
fi
}
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.8)
if(NOT DEFINED OMNITRACE_VERSION)
if(NOT DEFINED ROCPROFSYS_VERSION)
file(READ "${CMAKE_CURRENT_LIST_DIR}/../VERSION" FULL_VERSION_STRING LIMIT_COUNT 1)
string(REGEX REPLACE "(\n|\r)" "" FULL_VERSION_STRING "${FULL_VERSION_STRING}")
string(REGEX REPLACE "([0-9]+)\.([0-9]+)\.([0-9]+)(.*)" "\\1.\\2.\\3"
OMNITRACE_VERSION "${FULL_VERSION_STRING}")
ROCPROFSYS_VERSION "${FULL_VERSION_STRING}")
endif()
if(NOT DEFINED OUTPUT_DIR)
@@ -13,7 +13,8 @@ endif()
message(
STATUS
"Writing ${OUTPUT_DIR}/omnitrace-install.py for omnitrace v${OMNITRACE_VERSION}")
"Writing ${OUTPUT_DIR}/rocprofiler-systems-install.py for rocprofiler-systems v${ROCPROFSYS_VERSION}"
)
configure_file(${CMAKE_CURRENT_LIST_DIR}/../cmake/Templates/omnitrace-install.py.in
${OUTPUT_DIR}/omnitrace-install.py @ONLY)
configure_file(${CMAKE_CURRENT_LIST_DIR}/../cmake/Templates/rocprof-sys-install.py.in
${OUTPUT_DIR}/rocprofiler-systems-install.py @ONLY)
@@ -2,7 +2,7 @@ if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
endif()
if(OMNITRACE_BUILD_LTO)
if(ROCPROFSYS_BUILD_LTO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
endif()
@@ -13,16 +13,16 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
add_subdirectory(lib)
add_subdirectory(bin)
if(OMNITRACE_USE_PYTHON)
if(ROCPROFSYS_USE_PYTHON)
add_subdirectory(python)
endif()
if(OMNITRACE_BUILD_DEVELOPER)
add_custom_target(omnitrace-precommit)
foreach(_TARGET format-omnitrace-source format-omnitrace-cmake format-timemory-source
format-timemory-cmake)
if(ROCPROFSYS_BUILD_DEVELOPER)
add_custom_target(rocprofiler-systems-precommit)
foreach(_TARGET format-rocprofiler-systems-source format-rocprofiler-systems-cmake
format-timemory-source format-timemory-cmake)
if(TARGET ${_TARGET})
add_dependencies(omnitrace-precommit ${_TARGET})
add_dependencies(rocprofiler-systems-precommit ${_TARGET})
endif()
endforeach()
endif()
@@ -1,27 +1,26 @@
# executable RPATH
if(OMNITRACE_USE_ROCPROFILER
if(ROCPROFSYS_USE_ROCPROFILER
AND rocprofiler_LIBRARY_DIR
AND ROCmVersion_TRIPLE_VERSION VERSION_LESS 5.2.0
AND NOT CMAKE_INSTALL_RPATH_USE_LINK_PATH)
set(OMNITRACE_EXE_INSTALL_RPATH
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/omnitrace:${rocprofiler_LIBRARY_DIR}"
set(ROCPROFSYS_EXE_INSTALL_RPATH
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}:${rocprofiler_LIBRARY_DIR}"
)
else()
set(OMNITRACE_EXE_INSTALL_RPATH
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/omnitrace"
set(ROCPROFSYS_EXE_INSTALL_RPATH
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}"
)
endif()
# executables
add_subdirectory(omnitrace-avail)
add_subdirectory(omnitrace-causal)
add_subdirectory(omnitrace-sample)
add_subdirectory(omnitrace-instrument)
add_subdirectory(omnitrace-run)
# omnitrace-exe is deprecated
add_subdirectory(omnitrace-exe)
add_subdirectory(rocprof-sys-avail)
add_subdirectory(rocprof-sys-causal)
add_subdirectory(rocprof-sys-sample)
add_subdirectory(rocprof-sys-instrument)
add_subdirectory(rocprof-sys-run)
if(OMNITRACE_BUILD_TESTING OR "$ENV{OMNITRACE_CI}" MATCHES "[1-9]+|ON|on|y|yes")
# tests
if(ROCPROFSYS_BUILD_TESTING OR "$ENV{ROCPROFSYS_CI}" MATCHES "[1-9]+|ON|on|y|yes")
add_subdirectory(tests)
endif()
@@ -1,27 +0,0 @@
# ------------------------------------------------------------------------------#
#
# omnitrace-causal target
#
# ------------------------------------------------------------------------------#
add_executable(
omnitrace-causal
${CMAKE_CURRENT_LIST_DIR}/omnitrace-causal.cpp
${CMAKE_CURRENT_LIST_DIR}/omnitrace-causal.hpp ${CMAKE_CURRENT_LIST_DIR}/impl.cpp)
target_compile_definitions(omnitrace-causal PRIVATE TIMEMORY_CMAKE=1)
target_include_directories(omnitrace-causal PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(
omnitrace-causal
PRIVATE omnitrace::omnitrace-compile-definitions omnitrace::omnitrace-headers
omnitrace::omnitrace-common-library omnitrace::omnitrace-core)
set_target_properties(
omnitrace-causal PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}")
omnitrace_strip_target(omnitrace-causal)
install(
TARGETS omnitrace-causal
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,23 +0,0 @@
# ------------------------------------------------------------------------------#
#
# omnitrace-exe target (deprecated 'omnitrace' executable, now 'omnitrace-instrument')
#
# ------------------------------------------------------------------------------#
add_executable(omnitrace-exe ${CMAKE_CURRENT_LIST_DIR}/omnitrace.cpp)
target_link_libraries(omnitrace-exe PRIVATE omnitrace::omnitrace-threading)
set_target_properties(
omnitrace-exe
PROPERTIES OUTPUT_NAME omnitrace
BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}"
INSTALL_RPATH_USE_LINK_PATH ON)
omnitrace_strip_target(omnitrace-exe)
install(
TARGETS omnitrace-exe
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,60 +0,0 @@
# ------------------------------------------------------------------------------#
#
# omnitrace-instrument target (formerly omnitrace-exe target prior to 1.8.1)
#
# ------------------------------------------------------------------------------#
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
add_executable(omnitrace-instrument)
target_sources(
omnitrace-instrument
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/details.cpp
${CMAKE_CURRENT_LIST_DIR}/function_signature.cpp
${CMAKE_CURRENT_LIST_DIR}/function_signature.hpp
${CMAKE_CURRENT_LIST_DIR}/fwd.hpp
${CMAKE_CURRENT_LIST_DIR}/info.hpp
${CMAKE_CURRENT_LIST_DIR}/internal_libs.cpp
${CMAKE_CURRENT_LIST_DIR}/internal_libs.hpp
${CMAKE_CURRENT_LIST_DIR}/log.cpp
${CMAKE_CURRENT_LIST_DIR}/log.hpp
${CMAKE_CURRENT_LIST_DIR}/module_function.cpp
${CMAKE_CURRENT_LIST_DIR}/module_function.hpp
${CMAKE_CURRENT_LIST_DIR}/omnitrace-instrument.cpp
${CMAKE_CURRENT_LIST_DIR}/omnitrace-instrument.hpp)
target_link_libraries(
omnitrace-instrument
PRIVATE omnitrace::omnitrace-headers
omnitrace::omnitrace-dyninst
omnitrace::omnitrace-compile-options
omnitrace::omnitrace-compile-definitions
omnitrace::omnitrace-sanitizer
timemory::timemory-headers
timemory::timemory-extensions
timemory::timemory-core)
set_target_properties(
omnitrace-instrument
PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}"
INSTALL_RPATH_USE_LINK_PATH ON)
if(OMNITRACE_BUILD_DYNINST)
target_compile_definitions(omnitrace-instrument PRIVATE OMNITRACE_BUILD_DYNINST=1)
endif()
add_target_flag_if_avail(omnitrace-instrument "-Wno-deprecated-declarations")
omnitrace_strip_target(omnitrace-instrument)
if(CMAKE_BUILD_TYPE MATCHES "^(DEBUG|Debug)")
string(REPLACE " " ";" _FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
target_compile_options(omnitrace-instrument PRIVATE ${_FLAGS})
endif()
install(
TARGETS omnitrace-instrument
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,28 +0,0 @@
# ------------------------------------------------------------------------------#
#
# omnitrace-run target
#
# ------------------------------------------------------------------------------#
add_executable(
omnitrace-run
${CMAKE_CURRENT_LIST_DIR}/omnitrace-run.cpp
${CMAKE_CURRENT_LIST_DIR}/omnitrace-run.hpp ${CMAKE_CURRENT_LIST_DIR}/impl.cpp)
target_compile_definitions(omnitrace-run PRIVATE TIMEMORY_CMAKE=1)
target_include_directories(omnitrace-run PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(
omnitrace-run
PRIVATE omnitrace::omnitrace-compile-definitions omnitrace::omnitrace-headers
omnitrace::omnitrace-common-library omnitrace::omnitrace-core
omnitrace::omnitrace-sanitizer)
set_target_properties(
omnitrace-run PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}")
omnitrace_strip_target(omnitrace-run)
install(
TARGETS omnitrace-run
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,25 +0,0 @@
# ------------------------------------------------------------------------------#
#
# omnitrace-sample target
#
# ------------------------------------------------------------------------------#
add_executable(omnitrace-sample ${CMAKE_CURRENT_LIST_DIR}/omnitrace-sample.cpp
${CMAKE_CURRENT_LIST_DIR}/impl.cpp)
target_compile_definitions(omnitrace-sample PRIVATE TIMEMORY_CMAKE=1)
target_include_directories(omnitrace-sample PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(
omnitrace-sample
PRIVATE omnitrace::omnitrace-compile-definitions omnitrace::omnitrace-headers
omnitrace::omnitrace-common-library)
set_target_properties(
omnitrace-sample PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}")
omnitrace_strip_target(omnitrace-sample)
install(
TARGETS omnitrace-sample
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,13 +1,13 @@
# ------------------------------------------------------------------------------#
#
# omnitrace-avail target
# rocprofiler-systems-avail target
#
# ------------------------------------------------------------------------------#
add_executable(omnitrace-avail)
add_executable(rocprofiler-systems-avail)
target_sources(
omnitrace-avail
rocprofiler-systems-avail
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/avail.cpp
${CMAKE_CURRENT_LIST_DIR}/avail.hpp
${CMAKE_CURRENT_LIST_DIR}/common.cpp
@@ -22,19 +22,23 @@ target_sources(
${CMAKE_CURRENT_LIST_DIR}/info_type.cpp
${CMAKE_CURRENT_LIST_DIR}/info_type.hpp)
target_include_directories(omnitrace-avail PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_compile_definitions(omnitrace-avail PRIVATE OMNITRACE_EXTERN_COMPONENTS=0)
target_include_directories(rocprofiler-systems-avail PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_compile_definitions(rocprofiler-systems-avail
PRIVATE ROCPROFSYS_EXTERN_COMPONENTS=0)
target_link_libraries(
omnitrace-avail
PRIVATE omnitrace::omnitrace-compile-definitions
omnitrace::omnitrace-interface-library omnitrace::libomnitrace-static)
rocprofiler-systems-avail
PRIVATE rocprofiler-systems::rocprofiler-systems-compile-definitions
rocprofiler-systems::rocprofiler-systems-interface-library
rocprofiler-systems::librocprofiler-systems-static)
set_target_properties(
omnitrace-avail PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${OMNITRACE_EXE_INSTALL_RPATH}")
rocprofiler-systems-avail
PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${ROCPROFSYS_EXE_INSTALL_RPATH}"
OUTPUT_NAME ${BINARY_NAME_PREFIX}-avail)
omnitrace_strip_target(omnitrace-avail)
rocprofiler_systems_strip_target(rocprofiler-systems-avail)
install(
TARGETS omnitrace-avail
TARGETS rocprofiler-systems-avail
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -118,8 +118,8 @@ write_hw_counter_info(std::ostream&, const array_t<bool, N>& = {},
namespace
{
// initialize HIP before main so that libomnitrace is not HSA_TOOLS_LIB
int gpu_count = omnitrace::gpu::hip_device_count();
// initialize HIP before main so that librocprof-sys is not HSA_TOOLS_LIB
int gpu_count = rocprofsys::gpu::hip_device_count();
// statically allocated shared_ptrs to prevent use after free errors
auto timemory_manager = tim::manager::master_instance();
@@ -137,8 +137,8 @@ main(int argc, char** argv)
(void) timemory_hash_aliases; //
tim::unwind::set_bfd_verbose(3);
tim::set_env("OMNITRACE_INIT_TOOLING", "OFF", 1);
omnitrace_init_library();
tim::set_env("ROCPROFSYS_INIT_TOOLING", "OFF", 1);
rocprofsys_init_library();
std::set<std::string> _category_options = component_categories{}();
{
@@ -193,7 +193,7 @@ main(int argc, char** argv)
std::string file = {};
parser_t parser("omnitrace-avail");
parser_t parser("rocprof-sys-avail");
parser.set_help_width(40);
auto _cols = std::get<0>(tim::utility::console::get_columns());
@@ -202,7 +202,7 @@ main(int argc, char** argv)
std::min<int>(_cols - parser.get_help_width() - 8, 120));
parser.enable_help();
parser.enable_version("omnitrace-avail", OMNITRACE_ARGPARSE_VERSION_INFO);
parser.enable_version("rocprof-sys-avail", ROCPROFSYS_ARGPARSE_VERSION_INFO);
parser.start_group("DEBUG");
@@ -440,7 +440,7 @@ main(int argc, char** argv)
"Dump a configuration to a specified file.")
.max_count(1)
.dtype("filename")
.set_default(std::string{ "omnitrace-config" })
.set_default(std::string{ "rocprof-sys-config" })
.action([&_config_file](parser_t& _p) {
auto _out =
(_p.exists("output")) ? _p.get<std::string>("output") : std::string{};
@@ -508,15 +508,15 @@ main(int argc, char** argv)
return EXIT_FAILURE;
}
#if OMNITRACE_USE_HIP > 0
#if ROCPROFSYS_USE_HIP > 0
if(gpu_count > 0)
{
size_t _num_metrics = 0;
try
{
// call to rocm_metrics() will add choices to OMNITRACE_ROCM_EVENTS setting
// call to rocm_metrics() will add choices to ROCPROFSYS_ROCM_EVENTS setting
// so always perform this call even if list of HW counters is not requested
_num_metrics = omnitrace::rocprofiler::rocm_metrics().size();
_num_metrics = rocprofsys::rocprofiler::rocm_metrics().size();
} catch(std::runtime_error& _e)
{
verbprintf(0, "Retrieving the GPU HW counters failed: %s", _e.what());
@@ -556,7 +556,7 @@ main(int argc, char** argv)
generate_config(_config_file, _config_fmts, options);
} catch(std::runtime_error& _e)
{
std::cerr << "[omnitrace-avail] " << _e.what() << std::endl;
std::cerr << "[rocprof-sys-avail] " << _e.what() << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
@@ -1076,7 +1076,7 @@ write_hw_counter_info(std::ostream& os, const array_t<bool, N>& options,
auto _papi_events = tim::papi::available_events_info();
auto _rocm_events =
(gpu_count > 0) ? omnitrace::rocprofiler::rocm_metrics() : hwcounter_info_t{};
(gpu_count > 0) ? rocprofsys::rocprofiler::rocm_metrics() : hwcounter_info_t{};
if(alphabetical)
{
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -52,14 +52,14 @@ str_vec_t category_regex_keys = {};
str_set_t category_view = {};
std::stringstream lerr{};
bool debug_msg = tim::get_env<bool>("OMNITRACE_DEBUG_AVAIL", settings::debug());
bool debug_msg = tim::get_env<bool>("ROCPROFSYS_DEBUG_AVAIL", settings::debug());
int32_t verbose_level =
tim::get_env<int32_t>("OMNITRACE_VERBOSE_AVAIL", settings::verbose());
tim::get_env<int32_t>("ROCPROFSYS_VERBOSE_AVAIL", settings::verbose());
// explicit setting names to exclude
std::set<std::string> settings_exclude = {
"OMNITRACE_ENVIRONMENT",
"OMNITRACE_COMMAND_LINE",
"ROCPROFSYS_ENVIRONMENT",
"ROCPROFSYS_COMMAND_LINE",
"cereal_class_version",
"settings",
};
@@ -362,7 +362,7 @@ dump_log()
void
dump_log_abort(int _v)
{
fprintf(stderr, "\n[omnitrace-avail] Exiting with signal %i...\n", _v);
fprintf(stderr, "\n[rocprof-sys-avail] Exiting with signal %i...\n", _v);
debug_msg = true;
dump_log();
}
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -109,11 +109,11 @@ extern std::stringstream lerr;
// explicit setting names to exclude
extern std::set<std::string> settings_exclude;
// exclude some timemory settings which are not relevant to omnitrace
// exact matches, e.g. OMNITRACE_BANNER
// exclude some timemory settings which are not relevant to rocprof-sys
// exact matches, e.g. ROCPROFSYS_BANNER
extern std::string settings_rexclude_exact;
// leading matches, e.g. OMNITRACE_MPI_[A-Z_]+
// leading matches, e.g. ROCPROFSYS_MPI_[A-Z_]+
extern std::string settings_rexclude_begin;
constexpr size_t max_error_message_buffer_length = 4096;
@@ -156,12 +156,12 @@ file_exists(const std::string&);
if(debug_msg || verbose_level >= LEVEL) \
{ \
fprintf(stderr, "%s", tim::log::color::fatal()); \
fprintf(stderr, "[omnitrace][avail] Error! " __VA_ARGS__); \
fprintf(stderr, "[rocprof-sys][avail] Error! " __VA_ARGS__); \
fprintf(stderr, "%s", tim::log::color::end()); \
} \
char _buff[max_error_message_buffer_length]; \
snprintf(_buff, max_error_message_buffer_length, \
"[omnitrace][avail] Error! " __VA_ARGS__); \
"[rocprof-sys][avail] Error! " __VA_ARGS__); \
throw std::runtime_error(std::string{ _buff }); \
} \
else \
@@ -169,7 +169,7 @@ file_exists(const std::string&);
if(debug_msg || verbose_level >= LEVEL) \
{ \
fprintf(stderr, "%s", tim::log::color::warning()); \
fprintf(stderr, "[omnitrace][avail] Warning! " __VA_ARGS__); \
fprintf(stderr, "[rocprof-sys][avail] Warning! " __VA_ARGS__); \
fprintf(stderr, "%s", tim::log::color::end()); \
} \
} \
@@ -182,7 +182,7 @@ file_exists(const std::string&);
if(debug_msg || verbose_level >= LEVEL) \
{ \
fprintf(stderr, "%s", tim::log::color::info()); \
fprintf(stderr, "[omnitrace][avail] " __VA_ARGS__); \
fprintf(stderr, "[rocprof-sys][avail] " __VA_ARGS__); \
fprintf(stderr, "%s", tim::log::color::end()); \
} \
fflush(stderr); \
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -163,9 +163,9 @@ struct setting_serialization<tsettings<Tp>, custom_setting_serializer>
template <typename... Tp>
void push(type_list<Tp...>)
{
OMNITRACE_FOLD_EXPRESSION(
ROCPROFSYS_FOLD_EXPRESSION(
settings::push_serialize_map_callback<Tp, custom_setting_serializer>());
OMNITRACE_FOLD_EXPRESSION(
ROCPROFSYS_FOLD_EXPRESSION(
settings::push_serialize_data_callback<Tp, custom_setting_serializer>(
type_list<std::string>{}));
}
@@ -173,9 +173,9 @@ void push(type_list<Tp...>)
template <typename... Tp>
void pop(type_list<Tp...>)
{
OMNITRACE_FOLD_EXPRESSION(
ROCPROFSYS_FOLD_EXPRESSION(
settings::pop_serialize_map_callback<Tp, custom_setting_serializer>());
OMNITRACE_FOLD_EXPRESSION(
ROCPROFSYS_FOLD_EXPRESSION(
settings::pop_serialize_data_callback<Tp, custom_setting_serializer>(
type_list<std::string>{}));
}
@@ -245,7 +245,7 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
auto _serialize = [_settings](auto&& _ar) {
_ar->setNextName(TIMEMORY_PROJECT_NAME);
_ar->startNode();
(*_ar)(cereal::make_nvp("version", std::string{ OMNITRACE_VERSION_STRING }));
(*_ar)(cereal::make_nvp("version", std::string{ ROCPROFSYS_VERSION_STRING }));
(*_ar)(cereal::make_nvp("date", tim::get_local_datetime("%F_%H.%M", &_time)));
settings::serialize_settings(*_ar, *_settings);
_ar->finishNode();
@@ -260,12 +260,12 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
if(force_config)
{
if(settings::verbose() >= 1)
std::cout << "[omnitrace-avail] File '" << _fname
std::cout << "[rocprof-sys-avail] File '" << _fname
<< "' exists. Overwrite force...\n";
}
else
{
std::cout << "[omnitrace-avail] File '" << _fname
std::cout << "[rocprof-sys-avail] File '" << _fname
<< "' exists. Overwrite? " << std::flush;
std::string _response = {};
std::cin >> _response;
@@ -276,7 +276,7 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
if(filepath::open(_ofs, _fname))
{
if(settings::verbose() >= 0)
printf("[omnitrace-avail] Outputting %s configuration file '%s'...\n",
printf("[rocprof-sys-avail] Outputting %s configuration file '%s'...\n",
_type.c_str(), _fname.c_str());
}
else
@@ -332,16 +332,16 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
{
_settings->ordering();
std::sort(_data.begin(), _data.end(), [](auto _lhs, auto _rhs) {
auto _lomni = _lhs->get_categories().count("omnitrace") > 0;
auto _romni = _rhs->get_categories().count("omnitrace") > 0;
auto _lomni = _lhs->get_categories().count("rocprofsys") > 0;
auto _romni = _rhs->get_categories().count("rocprofsys") > 0;
if(_lomni && !_romni) return true;
if(_romni && !_lomni) return false;
for(const auto* itr :
{ "OMNITRACE_CONFIG", "OMNITRACE_MODE", "OMNITRACE_TRACE",
"OMNITRACE_PROFILE", "OMNITRACE_USE_SAMPLING",
"OMNITRACE_USE_PROCESS_SAMPLING", "OMNITRACE_USE_ROCTRACER",
"OMNITRACE_USE_ROCM_SMI", "OMNITRACE_USE_KOKKOSP",
"OMNITRACE_USE_OMPT", "OMNITRACE_USE", "OMNITRACE_OUTPUT" })
{ "ROCPROFSYS_CONFIG", "ROCPROFSYS_MODE", "ROCPROFSYS_TRACE",
"ROCPROFSYS_PROFILE", "ROCPROFSYS_USE_SAMPLING",
"ROCPROFSYS_USE_PROCESS_SAMPLING", "ROCPROFSYS_USE_ROCTRACER",
"ROCPROFSYS_USE_ROCM_SMI", "ROCPROFSYS_USE_KOKKOSP",
"ROCPROFSYS_USE_OMPT", "ROCPROFSYS_USE", "ROCPROFSYS_OUTPUT" })
{
if(_lhs->get_env_name().find(itr) == 0 &&
_rhs->get_env_name().find(itr) != 0)
@@ -351,7 +351,7 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
return false;
}
for(const auto* itr :
{ "OMNITRACE_SUPPRESS_PARSING", "OMNITRACE_SUPPRESS_CONFIG" })
{ "ROCPROFSYS_SUPPRESS_PARSING", "ROCPROFSYS_SUPPRESS_CONFIG" })
{
if(_lhs->get_env_name().find(itr) == 0 &&
_rhs->get_env_name().find(itr) != 0)
@@ -423,8 +423,9 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
true, _output_dir);
std::ofstream ofs{};
_open(ofs, _fname, "text")
<< "# auto-generated by omnitrace-avail (version " << OMNITRACE_VERSION_STRING
<< ") on " << tim::get_local_datetime("%F @ %H:%M", &_time) << "\n\n"
<< "# auto-generated by rocprof-sys-avail (version "
<< ROCPROFSYS_VERSION_STRING << ") on "
<< tim::get_local_datetime("%F @ %H:%M", &_time) << "\n\n"
<< _ss.str();
}
@@ -440,7 +441,7 @@ update_choices(const std::shared_ptr<settings>& _settings)
std::vector<info_type> _info = get_component_info<TIMEMORY_NATIVE_COMPONENTS_END>();
if(_settings->get_verbose() >= 2 || _settings->get_debug())
printf("[omnitrace-avail] # of component found: %zu\n", _info.size());
printf("[rocprof-sys-avail] # of component found: %zu\n", _info.size());
_info.erase(std::remove_if(_info.begin(), _info.end(),
[](const auto& itr) {
@@ -463,8 +464,8 @@ update_choices(const std::shared_ptr<settings>& _settings)
for(const auto& itr : _info)
_component_choices.emplace_back(itr.id_type());
if(_settings->get_verbose() >= 2 || _settings->get_debug())
printf("[omnitrace-avail] # of component choices: %zu\n",
printf("[rocprof-sys-avail] # of component choices: %zu\n",
_component_choices.size());
_settings->find("OMNITRACE_TIMEMORY_COMPONENTS")
_settings->find("ROCPROFSYS_TIMEMORY_COMPONENTS")
->second->set_choices(_component_choices);
}
@@ -0,0 +1,31 @@
# ------------------------------------------------------------------------------#
#
# rocprofiler-systems-causal target
#
# ------------------------------------------------------------------------------#
add_executable(
rocprofiler-systems-causal
${CMAKE_CURRENT_LIST_DIR}/rocprof-sys-causal.cpp
${CMAKE_CURRENT_LIST_DIR}/rocprof-sys-causal.hpp ${CMAKE_CURRENT_LIST_DIR}/impl.cpp)
target_compile_definitions(rocprofiler-systems-causal PRIVATE TIMEMORY_CMAKE=1)
target_include_directories(rocprofiler-systems-causal PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(
rocprofiler-systems-causal
PRIVATE rocprofiler-systems::rocprofiler-systems-compile-definitions
rocprofiler-systems::rocprofiler-systems-headers
rocprofiler-systems::rocprofiler-systems-common-library
rocprofiler-systems::rocprofiler-systems-core)
set_target_properties(
rocprofiler-systems-causal
PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${ROCPROFSYS_EXE_INSTALL_RPATH}"
OUTPUT_NAME ${BINARY_NAME_PREFIX}-causal)
rocprofiler_systems_strip_target(rocprofiler-systems-causal)
install(
TARGETS rocprofiler-systems-causal
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include "omnitrace-causal.hpp"
#include "rocprof-sys-causal.hpp"
#include "common/defines.h"
#include "common/delimit.hpp"
@@ -61,7 +61,7 @@ namespace filepath = ::tim::filepath;
namespace console = ::tim::utility::console;
namespace argparse = ::tim::argparse;
using namespace ::timemory::join;
using ::omnitrace::utility::parse_numeric_range;
using ::rocprofsys::utility::parse_numeric_range;
using ::tim::get_env;
using ::tim::log::monochrome;
using ::tim::log::stream;
@@ -121,10 +121,10 @@ forward_signal(int sig)
int
get_verbose()
{
verbose = get_env("OMNITRACE_CAUSAL_VERBOSE",
get_env<int>("OMNITRACE_VERBOSE", verbose, false));
auto _debug =
get_env("OMNITRACE_CAUSAL_DEBUG", get_env<bool>("OMNITRACE_DEBUG", false, false));
verbose = get_env("ROCPROFSYS_CAUSAL_VERBOSE",
get_env<int>("ROCPROFSYS_VERBOSE", verbose, false));
auto _debug = get_env("ROCPROFSYS_CAUSAL_DEBUG",
get_env<bool>("ROCPROFSYS_DEBUG", false, false));
if(_debug) verbose += 8;
return verbose;
}
@@ -151,13 +151,13 @@ remove_child_pid(pid_t _v)
int
wait_pid(pid_t _pid, int _opts)
{
return ::omnitrace::mproc::wait_pid(_pid, _opts);
return ::rocprofsys::mproc::wait_pid(_pid, _opts);
}
int
diagnose_status(pid_t _pid, int _status)
{
return ::omnitrace::mproc::diagnose_status(_pid, _status, get_verbose());
return ::rocprofsys::mproc::diagnose_status(_pid, _status, get_verbose());
}
std::string
@@ -194,15 +194,15 @@ get_initial_environment()
}
}
update_env(_env, "OMNITRACE_MODE", "causal");
update_env(_env, "OMNITRACE_USE_CAUSAL", true);
update_env(_env, "OMNITRACE_USE_SAMPLING", false);
update_env(_env, "OMNITRACE_TRACE", false);
update_env(_env, "OMNITRACE_PROFILE", false);
update_env(_env, "OMNITRACE_USE_PROCESS_SAMPLING", false);
update_env(_env, "OMNITRACE_THREAD_POOL_SIZE",
get_env<int>("OMNITRACE_THREAD_POOL_SIZE", 0));
update_env(_env, "OMNITRACE_LAUNCHER", "omnitrace-causal");
update_env(_env, "ROCPROFSYS_MODE", "causal");
update_env(_env, "ROCPROFSYS_USE_CAUSAL", true);
update_env(_env, "ROCPROFSYS_USE_SAMPLING", false);
update_env(_env, "ROCPROFSYS_TRACE", false);
update_env(_env, "ROCPROFSYS_PROFILE", false);
update_env(_env, "ROCPROFSYS_USE_PROCESS_SAMPLING", false);
update_env(_env, "ROCPROFSYS_THREAD_POOL_SIZE",
get_env<int>("ROCPROFSYS_THREAD_POOL_SIZE", 0));
update_env(_env, "ROCPROFSYS_LAUNCHER", "rocprof-sys-causal");
return _env;
}
@@ -228,7 +228,7 @@ prepare_command_for_run(char* _exe, std::vector<char*>& _argv)
if(!_injected)
{
throw std::runtime_error(
join("", "omnitrace-causal was unable to match \"", launcher,
join("", "rocprof-sys-causal was unable to match \"", launcher,
"\" to any arguments on the command line: \"",
join(array_config{ " ", "", "" }, _argv), "\""));
}
@@ -244,7 +244,7 @@ prepare_environment_for_run(std::vector<char*>& _env)
{
update_env(_env, "LD_PRELOAD",
join(":", LIBPTHREAD_SO,
get_realpath(get_internal_libpath("libomnitrace-dl.so"))),
get_realpath(get_internal_libpath("librocprof-sys-dl.so"))),
true);
}
}
@@ -256,7 +256,7 @@ get_internal_libpath(const std::string& _lib)
auto _pos = _exe.find_last_of('/');
auto _dir = std::string{ "./" };
if(_pos != std::string_view::npos) _dir = _exe.substr(0, _pos);
return omnitrace::common::join("/", _dir, "..", "lib", _lib);
return rocprofsys::common::join("/", _dir, "..", "lib", _lib);
}
void
@@ -277,7 +277,7 @@ print_updated_environment(std::vector<char*> _env, std::string_view _prefix)
{
if(itr == nullptr) continue;
auto _is_omni = (std::string_view{ itr }.find("OMNITRACE") == 0);
auto _is_omni = (std::string_view{ itr }.find("ROCPROFSYS") == 0);
auto _updated = false;
for(const auto& vitr : updated_envs)
{
@@ -343,13 +343,13 @@ update_env(std::vector<char*>& _environ, std::string_view _env_var, Tp&& _env_va
else
{
free(itr);
itr = strdup(omnitrace::common::join('=', _env_var, _env_val).c_str());
itr = strdup(rocprofsys::common::join('=', _env_var, _env_val).c_str());
}
return;
}
}
_environ.emplace_back(
strdup(omnitrace::common::join('=', _env_var, _env_val).c_str()));
strdup(rocprofsys::common::join('=', _env_var, _env_val).c_str()));
}
template <typename Tp>
@@ -365,7 +365,7 @@ add_default_env(std::vector<char*>& _environ, std::string_view _env_var, Tp&& _e
updated_envs.emplace(_env_var);
_environ.emplace_back(
strdup(omnitrace::common::join('=', _env_var, _env_val).c_str()));
strdup(rocprofsys::common::join('=', _env_var, _env_val).c_str()));
}
void
@@ -419,24 +419,24 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
This executable is designed to streamline that process.
For example (assume all commands end with '-- <exe> <args>'):
omnitrace-causal -n 5 -- <exe> # runs <exe> 5x with causal profiling enabled
rocprof-sys-causal -n 5 -- <exe> # runs <exe> 5x with causal profiling enabled
omnitrace-causal -s 0 5,10,15,20 # runs <exe> 2x with virtual speedups:
rocprof-sys-causal -s 0 5,10,15,20 # runs <exe> 2x with virtual speedups:
# - 0
# - randomly selected from 5, 10, 15, and 20
omnitrace-causal -F func_A func_B func_(A|B) # runs <exe> 3x with the function scope limited to:
rocprof-sys-causal -F func_A func_B func_(A|B) # runs <exe> 3x with the function scope limited to:
# 1. func_A
# 2. func_B
# 3. func_A or func_B
General tips:
- Insert progress points at hotspots in your code or use omnitrace's runtime instrumentation
- Insert progress points at hotspots in your code or use rocprof-sys's runtime instrumentation
- Note: binary rewrite will produce a incompatible new binary
- Collect a flat profile via sampling
- E.g., omnitrace-sample -F -- <exe> <args>
- E.g., rocprof-sys-sample -F -- <exe> <args>
- Inspect sampling_wall_clock.txt and sampling_cpu_clock.txt for functions to target
- Run omnitrace-causal in "function" mode first (does not require debug info)
- Run omnitrace-causal in "line" mode when you are targeting one function (requires debug info)
- Run rocprof-sys-causal in "function" mode first (does not require debug info)
- Run rocprof-sys-causal in "line" mode when you are targeting one function (requires debug info)
- Preferably, use predictions from the "function" mode to determine which function to target
- Limit the virtual speedups to a smaller pool, e.g., 0,5,10,25,50, to get reliable predictions quicker
- Make use of the binary, source, and function scope to limit the functions/lines selected for experiments
@@ -451,7 +451,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
});
parser.enable_help();
parser.enable_version("omnitrace-causal", OMNITRACE_ARGPARSE_VERSION_INFO);
parser.enable_version("rocprof-sys-causal", ROCPROFSYS_ARGPARSE_VERSION_INFO);
auto _cols = std::get<0>(console::get_columns());
if(_cols > parser.get_help_width() + 8)
@@ -466,24 +466,24 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
auto _monochrome = p.get<bool>("monochrome");
monochrome() = _monochrome;
p.set_use_color(!_monochrome);
update_env(_env, "OMNITRACE_MONOCHROME", (_monochrome) ? "1" : "0");
update_env(_env, "ROCPROFSYS_MONOCHROME", (_monochrome) ? "1" : "0");
update_env(_env, "MONOCHROME", (_monochrome) ? "1" : "0");
});
parser.add_argument({ "--debug" }, "Debug output")
.max_count(1)
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_DEBUG", p.get<bool>("debug"));
update_env(_env, "ROCPROFSYS_DEBUG", p.get<bool>("debug"));
});
parser.add_argument({ "-v", "--verbose" }, "Verbose output")
.count(1)
.action([&](parser_t& p) {
auto _v = p.get<int>("verbose");
verbose = _v;
update_env(_env, "OMNITRACE_VERBOSE", _v);
update_env(_env, "ROCPROFSYS_VERBOSE", _v);
});
std::string _config_file = {};
std::string _config_folder = "omnitrace-causal-config";
std::string _config_folder = "rocprof-sys-causal-config";
bool _generate_configs = false;
bool _add_defaults = true;
@@ -498,11 +498,13 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
parser
.add_argument(
{ "-l", "--launcher" },
"When running MPI jobs, omnitrace-causal needs to be *before* the executable "
"When running MPI jobs, rocprof-sys-causal needs to be *before* the "
"executable "
"which launches the MPI processes (i.e. before `mpirun`, `srun`, etc.). Pass "
"the name of the target executable (or a regex for matching to the name of "
"the target) for causal profiling, e.g., `omnitrace-causal -l foo -- mpirun "
"-n 4 foo`. This ensures that the omnitrace library is LD_PRELOADed on the "
"the target) for causal profiling, e.g., `rocprof-sys-causal -l foo -- "
"mpirun "
"-n 4 foo`. This ensures that the rocprof-sys library is LD_PRELOADed on the "
"proper target")
.count(1)
.dtype("executable")
@@ -511,7 +513,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
.add_argument({ "-g", "--generate-configs" },
"Generate config files instead of passing environment variables "
"directly. If no arguments are provided, the config files will be "
"placed in ${PWD}/omnitrace-causal-config folder")
"placed in ${PWD}/rocprof-sys-causal-config folder")
.min_count(0)
.max_count(1)
.dtype("folder")
@@ -526,7 +528,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
"Do not activate default features which are recommended for causal "
"profiling. For example: PID-tagging of output files and "
"timestamped subdirectories are disabled by default. Kokkos tools "
"support is added by default (OMNITRACE_USE_KOKKOSP=ON) because, "
"support is added by default (ROCPROFSYS_USE_KOKKOSP=ON) because, "
"for Kokkos applications, the Kokkos-Tools callbacks are used for "
"progress points. Activation of OpenMP tools support is similar")
.min_count(0)
@@ -547,7 +549,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
.choices({ "function", "line" })
.choice_alias("function", { "func" })
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_CAUSAL_MODE", p.get<std::string>("mode"));
update_env(_env, "ROCPROFSYS_CAUSAL_MODE", p.get<std::string>("mode"));
});
parser.add_argument({ "-b", "--backend" }, "Causal profiling sampling backend.")
@@ -555,7 +557,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
.dtype("string")
.choices({ "auto", "perf", "timer" })
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_CAUSAL_BACKEND", p.get<std::string>("backend"));
update_env(_env, "ROCPROFSYS_CAUSAL_BACKEND", p.get<std::string>("backend"));
});
parser
@@ -564,7 +566,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
.min_count(1)
.dtype("filename")
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_CAUSAL_FILE", p.get<std::string>("output-name"));
update_env(_env, "ROCPROFSYS_CAUSAL_FILE", p.get<std::string>("output-name"));
});
bool _reset = false;
@@ -582,7 +584,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
.max_count(1)
.dtype("bool")
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_CAUSAL_END_TO_END", p.get<bool>("end-to-end"));
update_env(_env, "ROCPROFSYS_CAUSAL_END_TO_END", p.get<bool>("end-to-end"));
});
parser
@@ -592,7 +594,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_CAUSAL_DELAY", p.get<double>("wait"));
update_env(_env, "ROCPROFSYS_CAUSAL_DELAY", p.get<double>("wait"));
});
parser
@@ -605,7 +607,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_CAUSAL_DURATION", p.get<double>("duration"));
update_env(_env, "ROCPROFSYS_CAUSAL_DURATION", p.get<double>("duration"));
});
int64_t _niterations = 1;
@@ -750,7 +752,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
parser.end_group();
#if OMNITRACE_HIP_VERSION > 0 && OMNITRACE_HIP_VERSION < 50300
#if ROCPROFSYS_HIP_VERSION > 0 && ROCPROFSYS_HIP_VERSION < 50300
update_env(_env, "HSA_ENABLE_INTERRUPT", 0);
#endif
@@ -809,38 +811,38 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
if(_add_defaults)
{
add_default_env(_env, "OMNITRACE_TIME_OUTPUT", false);
add_default_env(_env, "OMNITRACE_USE_PID", false);
add_default_env(_env, "OMNITRACE_USE_KOKKOSP", true);
add_default_env(_env, "ROCPROFSYS_TIME_OUTPUT", false);
add_default_env(_env, "ROCPROFSYS_USE_PID", false);
add_default_env(_env, "ROCPROFSYS_USE_KOKKOSP", true);
#if defined(OMNITRACE_USE_OMPT) && OMNITRACE_USE_OMPT > 0
add_default_env(_env, "OMNITRACE_USE_OMPT", true);
#if defined(ROCPROFSYS_USE_OMPT) && ROCPROFSYS_USE_OMPT > 0
add_default_env(_env, "ROCPROFSYS_USE_OMPT", true);
#endif
#if(defined(OMNITRACE_USE_MPI) && OMNITRACE_USE_MPI > 0) || \
(defined(OMNITRACE_USE_MPI_HEADERS) && OMNITRACE_USE_MPI_HEADERS > 0)
add_default_env(_env, "OMNITRACE_USE_MPIP", true);
#if(defined(ROCPROFSYS_USE_MPI) && ROCPROFSYS_USE_MPI > 0) || \
(defined(ROCPROFSYS_USE_MPI_HEADERS) && ROCPROFSYS_USE_MPI_HEADERS > 0)
add_default_env(_env, "ROCPROFSYS_USE_MPIP", true);
#endif
#if defined(OMNITRACE_USE_ROCTRACER) && OMNITRACE_USE_ROCTRACER > 0
add_default_env(_env, "OMNITRACE_ROCTRACER_HIP_API", true);
add_default_env(_env, "OMNITRACE_ROCTRACER_HSA_API", true);
#if defined(ROCPROFSYS_USE_ROCTRACER) && ROCPROFSYS_USE_ROCTRACER > 0
add_default_env(_env, "ROCPROFSYS_ROCTRACER_HIP_API", true);
add_default_env(_env, "ROCPROFSYS_ROCTRACER_HSA_API", true);
#endif
#if defined(OMNITRACE_USE_RCCL) && OMNITRACE_USE_RCCL > 0
add_default_env(_env, "OMNITRACE_USE_RCCLP", true);
#if defined(ROCPROFSYS_USE_RCCL) && ROCPROFSYS_USE_RCCL > 0
add_default_env(_env, "ROCPROFSYS_USE_RCCLP", true);
#endif
}
_fill("OMNITRACE_CAUSAL_BINARY_EXCLUDE", _binary_excludes, _generate_configs);
_fill("OMNITRACE_CAUSAL_SOURCE_EXCLUDE", _source_excludes, _generate_configs);
_fill("OMNITRACE_CAUSAL_FUNCTION_EXCLUDE", _function_excludes, _generate_configs);
_fill("ROCPROFSYS_CAUSAL_BINARY_EXCLUDE", _binary_excludes, _generate_configs);
_fill("ROCPROFSYS_CAUSAL_SOURCE_EXCLUDE", _source_excludes, _generate_configs);
_fill("ROCPROFSYS_CAUSAL_FUNCTION_EXCLUDE", _function_excludes, _generate_configs);
_fill("OMNITRACE_CAUSAL_BINARY_SCOPE", _binary_scopes, _generate_configs);
_fill("OMNITRACE_CAUSAL_SOURCE_SCOPE", _source_scopes, _generate_configs);
_fill("OMNITRACE_CAUSAL_FUNCTION_SCOPE", _function_scopes, _generate_configs);
_fill("ROCPROFSYS_CAUSAL_BINARY_SCOPE", _binary_scopes, _generate_configs);
_fill("ROCPROFSYS_CAUSAL_SOURCE_SCOPE", _source_scopes, _generate_configs);
_fill("ROCPROFSYS_CAUSAL_FUNCTION_SCOPE", _function_scopes, _generate_configs);
_fill("OMNITRACE_CAUSAL_FIXED_SPEEDUP", _virtual_speedups, false);
_fill("ROCPROFSYS_CAUSAL_FIXED_SPEEDUP", _virtual_speedups, false);
// make sure at least one env exists
if(_causal_envs_tmp.empty()) _causal_envs_tmp.emplace_back();
@@ -857,10 +859,10 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
if(_generate_configs)
{
auto _is_omni_cfg = [](std::string_view itr) {
return (itr.find("OMNITRACE") == 0 && itr.find("OMNITRACE_MODE") != 0 &&
itr.find("OMNITRACE_DEBUG_") != 0 && itr.find('=') < itr.length());
// omnitrace has miscellaneous env options starting with OMNITRACE_DEBUG_ that
// are not official options
return (itr.find("ROCPROFSYS") == 0 && itr.find("ROCPROFSYS_MODE") != 0 &&
itr.find("ROCPROFSYS_DEBUG_") != 0 && itr.find('=') < itr.length());
// rocprof-sys has miscellaneous env options starting with ROCPROFSYS_DEBUG_
// that are not official options
};
auto _omni_env_m = std::map<std::string, std::string>{};
@@ -879,9 +881,9 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
_env.erase(std::remove_if(_env.begin(), _env.end(), _is_omni_cfg), _env.end());
auto _omni_env = std::vector<std::pair<std::string, std::string>>{};
// make sure that OMNITRACE_CONFIG_FILE is the first entry
// make sure that ROCPROFSYS_CONFIG_FILE is the first entry
{
auto citr = _omni_env_m.find("OMNITRACE_CONFIG_FILE");
auto citr = _omni_env_m.find("ROCPROFSYS_CONFIG_FILE");
if(citr != _omni_env_m.end())
{
_omni_env.emplace_back(citr->first, citr->second);
@@ -903,12 +905,12 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
for(const auto& itr : _data)
_width = std::max(_width, itr.first.length());
_os << "# omnitrace common settings\n";
_os << "# rocprofsys common settings\n";
for(const auto& itr : _omni_env)
_os << std::setw(_width + 1) << std::left << itr.first << " = "
<< itr.second << "\n";
_os << "\n# omnitrace causal settings\n";
_os << "\n# rocprofsys causal settings\n";
for(const auto& itr : _data)
_os << std::setw(_width + 1) << std::left << itr.first << " = "
<< itr.second << "\n";
@@ -926,20 +928,20 @@ parse_args(int argc, char** argv, std::vector<char*>& _env,
? fname.str()
: join(array_config{ ":" }, _config_file, fname.str());
auto _cfg =
std::map<std::string_view, std::string>{ { "OMNITRACE_CONFIG_FILE",
std::map<std::string_view, std::string>{ { "ROCPROFSYS_CONFIG_FILE",
_cfg_name } };
_causal_envs.emplace_back(_cfg);
}
}
if(_reset)
_causal_envs.front().emplace(std::string_view{ "OMNITRACE_CAUSAL_FILE_RESET" },
_causal_envs.front().emplace(std::string_view{ "ROCPROFSYS_CAUSAL_FILE_RESET" },
std::string{ "true" });
return _outv;
}
// explicit instantiation for usage in omnitrace-causal.cpp
// explicit instantiation for usage in rocprof-sys-causal.cpp
template void
update_env(std::vector<char*>&, std::string_view, const std::string& _env_val,
bool _append, std::string_view);
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include "omnitrace-causal.hpp"
#include "rocprof-sys-causal.hpp"
#include <timemory/log/macros.hpp>
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@
#pragma once
#define TIMEMORY_PROJECT_NAME "omnitrace-causal"
#define TIMEMORY_PROJECT_NAME "rocprof-sys-causal"
#include <csignal>
#include <map>
@@ -0,0 +1,25 @@
# ------------------------------------------------------------------------------#
#
# TODO: [DFG] Remove this file after 'rocprofsys' rebranding is complete
# rocprofiler-systems-exe target (deprecated 'omnitrace' executable, now 'rocprofiler-systems-instrument')
#
# ------------------------------------------------------------------------------#
add_executable(rocprofiler-systems-exe ${CMAKE_CURRENT_LIST_DIR}/rocprof-sys.cpp)
target_link_libraries(rocprofiler-systems-exe
PRIVATE rocprofiler-systems::rocprofiler-systems-threading)
set_target_properties(
rocprofiler-systems-exe
PROPERTIES OUTPUT_NAME rocprof-sys
BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${ROCPROFSYS_EXE_INSTALL_RPATH}"
INSTALL_RPATH_USE_LINK_PATH ON)
rocprofiler_systems_strip_target(rocprofiler-systems-exe)
install(
TARGETS rocprofiler-systems-exe
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -66,17 +66,17 @@ main(int argc, char** argv)
gggggg
OmniTrace has renamed the "omnitrace" executable to "omnitrace-instrument" to reduce confusion.
ROCm Systems Profiler has renamed the "rocprof-sys" executable to "rocprof-sys-instrument".
This executable only exists to provide this deprecation warning and maintain backwards compatibility for a few releases.
This executable will soon invoke "omnitrace-instrument" with the arguments you just provided after we've given you
This executable will soon invoke "rocprof-sys-instrument" with the arguments you just provided after we've given you
a chance to read this message.
If you are running this job interactively, please acknowledge that you've read this message and whether you want to continue.
If you are running this job non-interactively, we will resume executing after ~1 minute unless CI or OMNITRACE_CI is defined
If you are running this job non-interactively, we will resume executing after ~1 minute unless CI or ROCPROFSYS_CI is defined
in the environment, in which case, we will throw an error.
Thanks for using OmniTrace and happy optimizing!
Thanks for using ROCm Systems Profiler and happy optimizing!
)warning";
auto _completed = std::promise<void>{};
@@ -94,11 +94,12 @@ main(int argc, char** argv)
auto _env_failure = [_emit_warning, argv](std::string_view _env_var) {
// emit warning
_emit_warning();
std::cerr << "[" << argv[0] << "] Detected " << _env_var
<< " environment variable. Exiting to prevent consuming CI resources. "
"Use \"omnitrace-instrument\" executable instead of \"omnitrace\" "
"to prevent this error."
<< std::endl;
std::cerr
<< "[" << argv[0] << "] Detected " << _env_var
<< " environment variable. Exiting to prevent consuming CI resources. "
"Use \"rocprof-sys-instrument\" executable instead of \"rocprof-sys\" "
"to prevent this error."
<< std::endl;
std::exit(EXIT_FAILURE);
};
auto _wait_for_input = [&_completed, &_acknowledged, _emit_warning]() {
@@ -116,7 +117,7 @@ main(int argc, char** argv)
_completed.set_value();
};
for(const auto* itr : { "CI", "OMNITRACE_CI" })
for(const auto* itr : { "CI", "ROCPROFSYS_CI" })
{
if(_get_env(itr)) _env_failure(itr);
}
@@ -0,0 +1,62 @@
# ------------------------------------------------------------------------------#
#
# rocprofiler-systems-instrument target (formerly rocprofiler-systems-exe target prior to 1.8.1)
#
# ------------------------------------------------------------------------------#
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
add_executable(rocprofiler-systems-instrument)
target_sources(
rocprofiler-systems-instrument
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/details.cpp
${CMAKE_CURRENT_LIST_DIR}/function_signature.cpp
${CMAKE_CURRENT_LIST_DIR}/function_signature.hpp
${CMAKE_CURRENT_LIST_DIR}/fwd.hpp
${CMAKE_CURRENT_LIST_DIR}/info.hpp
${CMAKE_CURRENT_LIST_DIR}/internal_libs.cpp
${CMAKE_CURRENT_LIST_DIR}/internal_libs.hpp
${CMAKE_CURRENT_LIST_DIR}/log.cpp
${CMAKE_CURRENT_LIST_DIR}/log.hpp
${CMAKE_CURRENT_LIST_DIR}/module_function.cpp
${CMAKE_CURRENT_LIST_DIR}/module_function.hpp
${CMAKE_CURRENT_LIST_DIR}/rocprof-sys-instrument.cpp
${CMAKE_CURRENT_LIST_DIR}/rocprof-sys-instrument.hpp)
target_link_libraries(
rocprofiler-systems-instrument
PRIVATE rocprofiler-systems::rocprofiler-systems-headers
rocprofiler-systems::rocprofiler-systems-dyninst
rocprofiler-systems::rocprofiler-systems-compile-options
rocprofiler-systems::rocprofiler-systems-compile-definitions
rocprofiler-systems::rocprofiler-systems-sanitizer
timemory::timemory-headers
timemory::timemory-extensions
timemory::timemory-core)
set_target_properties(
rocprofiler-systems-instrument
PROPERTIES BUILD_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH "${ROCPROFSYS_EXE_INSTALL_RPATH}"
INSTALL_RPATH_USE_LINK_PATH ON
OUTPUT_NAME ${BINARY_NAME_PREFIX}-instrument)
if(ROCPROFSYS_BUILD_DYNINST)
target_compile_definitions(rocprofiler-systems-instrument
PRIVATE ROCPROFSYS_BUILD_DYNINST=1)
endif()
add_target_flag_if_avail(rocprofiler-systems-instrument "-Wno-deprecated-declarations")
rocprofiler_systems_strip_target(rocprofiler-systems-instrument)
if(CMAKE_BUILD_TYPE MATCHES "^(DEBUG|Debug)")
string(REPLACE " " ";" _FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
target_compile_options(rocprofiler-systems-instrument PRIVATE ${_FLAGS})
endif()
install(
TARGETS rocprofiler-systems-instrument
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,7 @@
#include "function_signature.hpp"
#include "fwd.hpp"
#include "log.hpp"
#include "omnitrace-instrument.hpp"
#include "rocprof-sys-instrument.hpp"
#include <timemory/components/rusage/components.hpp>
#include <timemory/components/timing/wall_clock.hpp>
@@ -216,7 +216,7 @@ get_func_file_line_info(module_t* module, procedure_t* func)
{
using address_t = Dyninst::Address;
OMNITRACE_ADD_LOG_ENTRY("Getting function line info for", get_name(func));
ROCPROFSYS_ADD_LOG_ENTRY("Getting function line info for", get_name(func));
auto _file_name = get_name(module);
auto _func_name = get_name(func);
@@ -249,7 +249,7 @@ function_signature
get_loop_file_line_info(module_t* module, procedure_t* func, flow_graph_t*,
basic_loop_t* loopToInstrument)
{
OMNITRACE_ADD_LOG_ENTRY("Getting loop line info for", get_name(func));
ROCPROFSYS_ADD_LOG_ENTRY("Getting loop line info for", get_name(func));
auto basic_blocks = std::vector<BPatch_basicBlock*>{};
loopToInstrument->getLoopBasicBlocksExclusive(basic_blocks);
@@ -343,7 +343,7 @@ get_basic_block_file_line_info(module_t* module, procedure_t* func)
std::map<basic_block_t*, basic_block_signature> _data{};
if(!func) return _data;
OMNITRACE_ADD_LOG_ENTRY("Getting basic block line info for", get_name(func));
ROCPROFSYS_ADD_LOG_ENTRY("Getting basic block line info for", get_name(func));
auto* _cfg = func->getCFG();
auto _basic_blocks = std::set<BPatch_basicBlock*>{};
@@ -421,7 +421,7 @@ get_basic_block_file_line_info(module_t* module, procedure_t* func)
std::vector<statement_t>
get_source_code(module_t* module, procedure_t* func)
{
OMNITRACE_ADD_LOG_ENTRY("Getting source code for", get_name(func));
ROCPROFSYS_ADD_LOG_ENTRY("Getting source code for", get_name(func));
std::vector<statement_t> _lines{};
if(!module || !func) return _lines;
@@ -523,15 +523,15 @@ is_text_file(const std::string& filename)
// Get the realpath to this exe
//
std::string&
omnitrace_get_exe_realpath()
rocprofsys_get_exe_realpath()
{
static std::string _v = []() {
auto _cmd_line = tim::read_command_line(tim::process::get_id());
if(!_cmd_line.empty())
{
using array_config_t = timemory::join::array_config;
OMNITRACE_ADD_DETAILED_LOG_ENTRY(array_config_t{ " ", "[ ", " ]" },
"cmdline:: ", _cmd_line);
ROCPROFSYS_ADD_DETAILED_LOG_ENTRY(array_config_t{ " ", "[ ", " ]" },
"cmdline:: ", _cmd_line);
return _cmd_line.front();
// return tim::filepath::realpath(_cmd_line.front(), nullptr, false);
}
@@ -545,8 +545,8 @@ omnitrace_get_exe_realpath()
// Error callback routine.
//
std::vector<std::string>
omnitrace_get_link_map(const char* _lib, const std::string& _exclude_linked_by,
const std::string& _exclude_re, std::vector<int>&& _open_modes)
rocprofsys_get_link_map(const char* _lib, const std::string& _exclude_linked_by,
const std::string& _exclude_re, std::vector<int>&& _open_modes)
{
if(_open_modes.empty()) _open_modes = { (RTLD_LAZY | RTLD_NOLOAD) };
@@ -573,7 +573,7 @@ omnitrace_get_link_map(const char* _lib, const std::string& _exclude_linked_by,
{
// only insert exe name if dlopened the exe and
// empty name is first entry
_chain.emplace_back(omnitrace_get_exe_realpath());
_chain.emplace_back(rocprofsys_get_exe_realpath());
}
else if(!std::string_view{ _next->l_name }.empty())
{
@@ -615,7 +615,7 @@ omnitrace_get_link_map(const char* _lib, const std::string& _exclude_linked_by,
// Get the path of a loaded dynamic binary
//
std::optional<std::string>
omnitrace_get_loaded_path(const char* _name, std::vector<int>&& _open_modes)
rocprofsys_get_loaded_path(const char* _name, std::vector<int>&& _open_modes)
{
if(_open_modes.empty()) _open_modes = { (RTLD_LAZY | RTLD_NOLOAD) };
@@ -647,7 +647,7 @@ omnitrace_get_loaded_path(const char* _name, std::vector<int>&& _open_modes)
// Get the path of a loaded dynamic binary
//
std::optional<std::string>
omnitrace_get_origin(const char* _name, std::vector<int>&& _open_modes)
rocprofsys_get_origin(const char* _name, std::vector<int>&& _open_modes)
{
if(_open_modes.empty()) _open_modes = { (RTLD_LAZY | RTLD_NOLOAD) };
@@ -695,8 +695,8 @@ error_func_real(error_level_t level, int num, const char* const* params)
const char* msg = bpatch->getEnglishErrorString(num);
bpatch->formatErrorString(line, sizeof(line), msg, params);
OMNITRACE_ADD_LOG_ENTRY("Dyninst error function called with level", level,
":: ID# =", num, "::", line)
ROCPROFSYS_ADD_LOG_ENTRY("Dyninst error function called with level", level,
":: ID# =", num, "::", line)
.force(level < BPatchInfo);
if(num == 0)
@@ -742,8 +742,8 @@ error_func_fake(error_level_t level, int num, const char* const* params)
bpatch->formatErrorString(line, sizeof(line), msg, params);
// just log it
OMNITRACE_ADD_LOG_ENTRY("Dyninst error function called with level", level,
":: ID# =", num, "::", line)
ROCPROFSYS_ADD_LOG_ENTRY("Dyninst error function called with level", level,
":: ID# =", num, "::", line)
.force(level < BPatchInfo);
}

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels Rādīt vairāk