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>
Bu işleme şunda yer alıyor:
işlemeyi yapan:
GitHub
ebeveyn
dc63370a1f
işleme
d07bf508a9
@@ -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
|
||||
|
||||
Çalıştırılabilir dosya
+223
@@ -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
|
||||
+10
-10
@@ -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
|
||||
}
|
||||
|
||||
|
||||
+6
-5
@@ -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)
|
||||
Yeni konuda referans
Bir kullanıcı engelle