adding allocate/device/memcopy/submit callbacks
Change-Id: Ie83ae3cd57cdf5038e83db70891b103439c37d55
이 커밋은 다음에 포함됨:
+12
-5
@@ -52,18 +52,22 @@ eval_test() {
|
||||
test_number=$((test_number + 1))
|
||||
}
|
||||
|
||||
# enable tools load failure reporting
|
||||
export HSA_TOOLS_REPORT_LOAD_FAILURE=1
|
||||
# paths to ROC profiler and oher libraries
|
||||
export LD_LIBRARY_PATH=$PWD
|
||||
|
||||
# enable tools load failure reporting
|
||||
export HSA_TOOLS_REPORT_LOAD_FAILURE=1
|
||||
# enable error messages logging to '/tmp/rocprofiler_log.txt'
|
||||
export ROCPROFILER_LOG=1
|
||||
# ROC profiler metrics config file
|
||||
# enable error messages logging to '/tmp/aql_profile_log.txt'
|
||||
export HSA_VEN_AMD_AQLPROFILE_LOG=1
|
||||
# test trace
|
||||
export ROC_TEST_TRACE=1
|
||||
|
||||
# Disabple profiler own proxy queue
|
||||
unset ROCP_PROXY_QUEUE
|
||||
# ROC profiler metrics config file
|
||||
export ROCP_METRICS=metrics.xml
|
||||
# test trace
|
||||
export ROC_TEST_TRACE=1
|
||||
|
||||
## C test
|
||||
eval_test "C test" ./test/c_test
|
||||
@@ -93,6 +97,9 @@ export ROCP_TIMESTAMP_ON=1
|
||||
# and SQTT trace files 'thread_trace.se<n>.out'
|
||||
export ROCP_OUTPUT_DIR=./RESULTS
|
||||
|
||||
# enable HSA intercepting
|
||||
export ROCP_HSA_INTERC=1
|
||||
|
||||
if [ ! -e $ROCP_TOOL_LIB ] ; then
|
||||
export ROCP_TOOL_LIB=test/libtool.so
|
||||
fi
|
||||
|
||||
@@ -826,6 +826,37 @@ static inline void check_env_var(const char* var_name, uint64_t& val) {
|
||||
if (str != NULL ) val = atoll(str);
|
||||
}
|
||||
|
||||
// HSA intercepting routines
|
||||
|
||||
// HSA unified callback function
|
||||
hsa_status_t hsa_unified_callback(
|
||||
rocprofiler_hsa_cb_id_t id,
|
||||
const rocprofiler_hsa_callback_data_t* data,
|
||||
void* arg)
|
||||
{
|
||||
printf("hsa_unified_callback(%d, %p, %p\n", (int)id, data, arg);
|
||||
|
||||
if (id == ROCPROFILER_HSA_CB_ID_SUBMIT) {
|
||||
if (data->submit.kernel_code != NULL) {
|
||||
printf(" submit:\n");
|
||||
printf(" kernel_code_entry_byte_offset %lx\n", data->submit.kernel_code->kernel_code_entry_byte_offset);
|
||||
printf(" kernel_code_prefetch_byte_offset %lx\n", data->submit.kernel_code->kernel_code_prefetch_byte_offset);
|
||||
printf(" kernel_code_prefetch_byte_size %lx\n", data->submit.kernel_code->kernel_code_prefetch_byte_size);
|
||||
}
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// HSA callbacks structure
|
||||
rocprofiler_hsa_callbacks_t hsa_callbacks {
|
||||
hsa_unified_callback,
|
||||
hsa_unified_callback,
|
||||
hsa_unified_callback,
|
||||
hsa_unified_callback
|
||||
};
|
||||
|
||||
// Tool constructor
|
||||
extern "C" PUBLIC_API void OnLoadToolProp(rocprofiler_settings_t* settings)
|
||||
{
|
||||
@@ -908,6 +939,8 @@ extern "C" PUBLIC_API void OnLoadToolProp(rocprofiler_settings_t* settings)
|
||||
check_env_var("ROCP_OBJ_TRACKING", settings->code_obj_tracking);
|
||||
// Set memcopies tracking
|
||||
check_env_var("ROCP_MCOPY_TRACKING", settings->memcopy_tracking);
|
||||
// Set HSA intercepting
|
||||
check_env_var("ROCP_HSA_INTERC", settings->hsa_intercepting);
|
||||
|
||||
is_trace_local = settings->trace_local;
|
||||
|
||||
|
||||
새 이슈에서 참조
사용자 차단