diff --git a/src/core/loader.h b/src/core/loader.h index 1c4005dd3b..f2ba57ed9c 100644 --- a/src/core/loader.h +++ b/src/core/loader.h @@ -172,11 +172,10 @@ typedef BaseLoader RocTxLoader; #define LOADER_INSTANTIATE() \ template typename roctracer::BaseLoader::mutex_t roctracer::BaseLoader::mutex_; \ template std::atomic*> roctracer::BaseLoader::instance_{}; \ - template const bool roctracer::BaseLoader::strong_ld_check_ = false; + template const bool roctracer::BaseLoader::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_ diff --git a/src/core/roctracer.cpp b/src/core/roctracer.cpp index b062aca61f..155892c6dd 100644 --- a/src/core/roctracer.cpp +++ b/src/core/roctracer.cpp @@ -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 diff --git a/test/MatrixTranspose_test/MatrixTranspose.cpp b/test/MatrixTranspose_test/MatrixTranspose.cpp index c2a4ebad3c..40082f9f38 100644 --- a/test/MatrixTranspose_test/MatrixTranspose.cpp +++ b/test/MatrixTranspose_test/MatrixTranspose.cpp @@ -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 diff --git a/test/run.sh b/test/run.sh index 3b383da201..d3e317cc70 100755 --- a/test/run.sh +++ b/test/run.sh @@ -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)) diff --git a/test/tool/tracer_tool.cpp b/test/tool/tracer_tool.cpp index 59b33fba2a..b5c5c2bf6d 100644 --- a/test/tool/tracer_tool.cpp +++ b/test/tool/tracer_tool.cpp @@ -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");