From 4a817e3e83988c444d3301e642ab655b645beac7 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Tue, 7 Jan 2020 12:15:29 -0600 Subject: [PATCH] minor changes; Change-Id: I4266d6af1adef66637b3c971fa21c800240a79ef [ROCm/rocprofiler commit: 9bdd497a519a143881828d0d7d9084545692a9ec] --- projects/rocprofiler/LICENSE | 1 + projects/rocprofiler/bin/dform.py | 23 ++++++++++++++++++- projects/rocprofiler/bin/rpl_run.sh | 17 ++++++++++---- projects/rocprofiler/bin/run_tool.sh | 1 + projects/rocprofiler/bin/sqlitedb.py | 22 ++++++++++++++++++ projects/rocprofiler/bin/tblextr.py | 2 -- projects/rocprofiler/inc/rocprofiler.h | 2 +- .../rocprofiler/src/util/hsa_rsrc_factory.cpp | 8 ------- 8 files changed, 59 insertions(+), 17 deletions(-) diff --git a/projects/rocprofiler/LICENSE b/projects/rocprofiler/LICENSE index 9e78331e70..8384c9857d 100644 --- a/projects/rocprofiler/LICENSE +++ b/projects/rocprofiler/LICENSE @@ -1,4 +1,5 @@ Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +[MITx11 License] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/projects/rocprofiler/bin/dform.py b/projects/rocprofiler/bin/dform.py index 9319460828..82a81d087b 100644 --- a/projects/rocprofiler/bin/dform.py +++ b/projects/rocprofiler/bin/dform.py @@ -1,4 +1,25 @@ -#!/usr/bin/python +################################################################################ +# Copyright (c) 2018 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 +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +################################################################################ + from sqlitedb import SQLiteDB def gen_message(outfile): diff --git a/projects/rocprofiler/bin/rpl_run.sh b/projects/rocprofiler/bin/rpl_run.sh index ce492e812c..e019c396b8 100755 --- a/projects/rocprofiler/bin/rpl_run.sh +++ b/projects/rocprofiler/bin/rpl_run.sh @@ -164,12 +164,11 @@ usage() { echo " --heartbeat - to print progress heartbeats [0 - disabled]" echo "" echo " --stats - generating kernel execution stats, file .stats.csv" - echo " --roctx-trace - to enable rocTX trace" - echo " --kfd-trace - to trace KFD, generates API execution stats and JSON file chrome-tracing compatible" - echo " --hsa-trace - to trace HSA, generates API execution stats and JSON file chrome-tracing compatible" echo " --sys-trace - to trace HIP/HSA APIs and GPU activity, generates stats and JSON trace chrome-tracing compatible" echo " --hip-trace - to trace HIP, generates API execution stats and JSON file chrome-tracing compatible" - echo " Generated files: .hsa_stats.txt .json" + echo " --hsa-trace - to trace HSA, generates API execution stats and JSON file chrome-tracing compatible" + echo " --kfd-trace - to trace KFD, generates API execution stats and JSON file chrome-tracing compatible" + echo " Generated files: ._stats.txt .json" echo " Traced API list can be set by input .txt or .xml files." echo " Input .txt:" echo " hsa: hsa_queue_create hsa_amd_memory_pool_allocate" @@ -182,18 +181,26 @@ usage() { echo " --trace-start - to enable tracing on start [on]" echo " --trace-period - to enable trace with initial delay, with periodic sample length and rate" echo " Supported time formats: " + echo "" + echo " --roctx-trace - to enable rocTX applicatin code annotation trace; should be use in addition to the trace options above." + echo " Will show the application code annotation with rocTX events: roctxMark, roctxRangePush, roctxRangePop in JSON trace" + echo " \"Markers and Ranges\" section." + echo " Application code needs to be explicitely instrumented using rocTX events APIs." + echo " See roctracer documentation on rocTX API details." + echo "" echo " --obj-tracking - to turn on/off kernels code objects tracking [off]" echo "" echo "Configuration file:" echo " You can set your parameters defaults preferences in the configuration file 'rpl_rc.xml'. The search path sequence: .:${HOME}:" echo " First the configuration file is looking in the current directory, then in your home, and then in the package directory." - echo " Configurable options: 'basenames', 'timestamp', 'ctx-limit', 'heartbeat'." + echo " Configurable options: 'basenames', 'timestamp', 'ctx-limit', 'heartbeat', 'obj-tracking'." echo " An example of 'rpl_rc.xml':" echo " " echo "" exit 1 diff --git a/projects/rocprofiler/bin/run_tool.sh b/projects/rocprofiler/bin/run_tool.sh index ed1609face..04b1066441 100755 --- a/projects/rocprofiler/bin/run_tool.sh +++ b/projects/rocprofiler/bin/run_tool.sh @@ -1,4 +1,5 @@ #!/bin/sh + BIN_DIR=`dirname $0` BIN_DIR=`realpath $BIN_DIR` PKG_DIR=${BIN_DIR%/bin} diff --git a/projects/rocprofiler/bin/sqlitedb.py b/projects/rocprofiler/bin/sqlitedb.py index cd649e6a6a..e307002d7b 100644 --- a/projects/rocprofiler/bin/sqlitedb.py +++ b/projects/rocprofiler/bin/sqlitedb.py @@ -1,3 +1,25 @@ +################################################################################ +# Copyright (c) 2018 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 +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +################################################################################ + import csv, sqlite3, re, sys from functools import reduce diff --git a/projects/rocprofiler/bin/tblextr.py b/projects/rocprofiler/bin/tblextr.py index 2c4e442b26..6d05a644bf 100755 --- a/projects/rocprofiler/bin/tblextr.py +++ b/projects/rocprofiler/bin/tblextr.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - ################################################################################ # Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. # diff --git a/projects/rocprofiler/inc/rocprofiler.h b/projects/rocprofiler/inc/rocprofiler.h index dc00d83373..31082cf48b 100644 --- a/projects/rocprofiler/inc/rocprofiler.h +++ b/projects/rocprofiler/inc/rocprofiler.h @@ -27,7 +27,7 @@ THE SOFTWARE. // The goal of the implementation is to provide a HW specific low-level // performance analysis interface for profiling of GPU compute applications. // The profiling includes HW performance counters (PMC) with complex -// performance metrics and traces: SQTT, SPM. +// performance metrics and traces. // // The library can be used by a tool library loaded by HSA runtime or by // higher level HW independent performance analysis API like PAPI. diff --git a/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp b/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp index 674aa94b9f..9ce362d411 100644 --- a/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp +++ b/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp @@ -154,14 +154,6 @@ HsaRsrcFactory::HsaRsrcFactory(bool initialize_hsa) : initialize_hsa_(initialize const uint32_t corr_iters = 1000; CorrelateTime(HsaTimer::TIME_ID_CLOCK_REALTIME, corr_iters); CorrelateTime(HsaTimer::TIME_ID_CLOCK_MONOTONIC, corr_iters); -#if 0 - printf("ROCProfiler time CLOCK_REALTIME: shift(0x%016lx) error(0x%lx)\n", - time_shift_[HsaTimer::TIME_ID_CLOCK_REALTIME], - time_error_[HsaTimer::TIME_ID_CLOCK_REALTIME]); - printf("ROCProfiler time CLOCK_MONOTONIC: shift(0x%016lx) error(0x%lx)\n", - time_shift_[HsaTimer::TIME_ID_CLOCK_MONOTONIC], - time_error_[HsaTimer::TIME_ID_CLOCK_MONOTONIC]); -#endif // System timeout timeout_ = (timeout_ns_ == HsaTimer::TIMESTAMP_MAX) ? timeout_ns_ : timer_->ns_to_sysclock(timeout_ns_);