Этот коммит содержится в:
Evgeny
2019-10-25 00:53:26 -05:00
родитель 064a7021a0
Коммит eb4bf2dac6
5 изменённых файлов: 17 добавлений и 7 удалений
+2 -3
Просмотреть файл
@@ -172,11 +172,10 @@ typedef BaseLoader<RocTxApi> RocTxLoader;
#define LOADER_INSTANTIATE() \
template<class T> typename roctracer::BaseLoader<T>::mutex_t roctracer::BaseLoader<T>::mutex_; \
template<class T> std::atomic<roctracer::BaseLoader<T>*> roctracer::BaseLoader<T>::instance_{}; \
template<class T> const bool roctracer::BaseLoader<T>::strong_ld_check_ = false;
template<class T> const bool roctracer::BaseLoader<T>::strong_ld_check_ = true; \
template<> const char* roctracer::HipLoader::lib_name_ = "libhip_hcc.so"; \
template<> const char* roctracer::HccLoader::lib_name_ = "libmcwamp_hsa.so"; \
template<> const char* roctracer::KfdLoader::lib_name_ = "libkfdwrapper64.so"; \
template<> const char* roctracer::RocTxLoader::lib_name_ = "libroctx64.so"; \
template<> const bool roctracer::RocTxLoader::strong_ld_check_ = false;
template<> const char* roctracer::RocTxLoader::lib_name_ = "libroctx64.so";
#endif // SRC_CORE_LOADER_H_
+2
Просмотреть файл
@@ -324,10 +324,12 @@ void* HIP_SyncActivityCallback(
if ((data == NULL) && (pool != NULL)) EXC_ABORT(ROCTRACER_STATUS_ERROR, "ActivityCallback enter: pool is not NULL");
// Allocating a record if NULL passed
if (record == NULL) {
if (data != NULL) EXC_ABORT(ROCTRACER_STATUS_ERROR, "ActivityCallback enter: record is NULL");
record_pair_stack.push({});
auto& top = record_pair_stack.top();
record = &(top.record);
data_ptr = &(top.data.hip);
data = data_ptr;
}
// Filing record info
+3
Просмотреть файл
@@ -291,6 +291,8 @@ void activity_callback(const char* begin, const char* end, void* arg) {
// Init tracing routine
void init_tracing() {
std::cout << "# INIT #############################" << std::endl << std::flush;
// roctracer properties
roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, NULL);
// Allocating tracing pool
roctracer_properties_t properties{};
properties.buffer_size = 0x1000;
@@ -320,6 +322,7 @@ void stop_tracing() {
std::cout << "# STOP #############################" << std::endl << std::flush;
}
#else
void init_tracing() {}
void start_tracing() {}
void stop_tracing() {}
#endif
+8 -2
Просмотреть файл
@@ -25,7 +25,7 @@
# enable tools load failure reporting
export HSA_TOOLS_REPORT_LOAD_FAILURE=1
# paths to ROC profiler and oher libraries
export LD_LIBRARY_PATH=$PWD
export LD_LIBRARY_PATH=$PWD:/opt/rocm/hip/lib
# test filter input
test_filter=-1
@@ -33,6 +33,12 @@ if [ -n "$1" ] ; then
test_filter=$1
fi
# debugger
debugger=""
if [ -n "$2" ] ; then
debugger=$2
fi
# test check routin
test_status=0
test_runnum=0
@@ -46,7 +52,7 @@ eval_test() {
if [ $test_filter = -1 -o $test_filter = $test_number ] ; then
echo "$label: \"$cmdline\""
test_runnum=$((test_runnum + 1))
eval "$cmdline"
eval "$debugger $cmdline"
if [ $? != 0 ] ; then
echo "$label: FAILED"
test_status=$(($test_status + 1))
+2 -2
Просмотреть файл
@@ -680,6 +680,8 @@ extern "C" PUBLIC_API bool OnLoad(HsaApiTable* table, uint64_t runtime_version,
hcc_activity_file_handle = open_output_file(output_prefix, "hcc_ops_trace.txt");
fprintf(stdout, " HIP-trace()\n"); fflush(stdout);
// roctracer properties
roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, (void*)mark_api_callback);
// Allocating tracing pool
roctracer_properties_t properties{};
properties.buffer_size = 0x80000;
@@ -688,8 +690,6 @@ extern "C" PUBLIC_API bool OnLoad(HsaApiTable* table, uint64_t runtime_version,
ROCTRACER_CALL(roctracer_enable_domain_activity(ACTIVITY_DOMAIN_HCC_OPS));
ROCTRACER_CALL(roctracer_enable_domain_activity(ACTIVITY_DOMAIN_HIP_API));
ROCTRACER_CALL(roctracer_enable_domain_callback(ACTIVITY_DOMAIN_HIP_API, hip_api_callback, NULL));
roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, (void*)mark_api_callback);
}
const char* ctrl_str = getenv("ROCP_CTRL_RATE");