Suppress reporting no tools were found with rocprofiler-register
Change-Id: If853517d40e073202d12e2a6b16fb54be5529650
This commit is contained in:
committed by
Jonathan Madsen
parent
e20f41df62
commit
8f0ea44c09
@@ -2063,9 +2063,20 @@ void Runtime::LoadTools() {
|
|||||||
rocprofiler_register_library_api_table("hsa", &ROCPROFILER_REGISTER_IMPORT_FUNC(hsa),
|
rocprofiler_register_library_api_table("hsa", &ROCPROFILER_REGISTER_IMPORT_FUNC(hsa),
|
||||||
ROCP_REG_VERSION, &profiler_api_table_, 1, &lib_id);
|
ROCP_REG_VERSION, &profiler_api_table_, 1, &lib_id);
|
||||||
|
|
||||||
if (rocp_reg_status != ROCP_REG_SUCCESS && flag().report_tool_load_failures())
|
if (rocp_reg_status != ROCP_REG_SUCCESS && flag().report_tool_load_failures()) {
|
||||||
fprintf(stderr, "rocprofiler-register failed with error code %i: %s\n", rocp_reg_status,
|
// hsa-runtime, in non-debug mode, enables reporting tool load failures by default,
|
||||||
rocprofiler_register_error_string(rocp_reg_status));
|
// which is good scheme for when tools were only loaded via the HSA_TOOLS_LIB env variable
|
||||||
|
// but, with automatic detection, this will result in reporting that no tools were available.
|
||||||
|
// So if no tools were available and flag().report_tool_load_failures() is true, we make
|
||||||
|
// sure that HSA_TOOLS_REPORT_LOAD_FAILURE was explicitly set and, if not, we suppress
|
||||||
|
// reporting that no tools were found
|
||||||
|
if (rocp_reg_status != ROCP_REG_NO_TOOLS ||
|
||||||
|
(rocp_reg_status == ROCP_REG_NO_TOOLS &&
|
||||||
|
flag().report_tool_load_failures_explicitly_set())) {
|
||||||
|
fprintf(stderr, "[hsa-runtime][%i] rocprofiler-register failed with error code %i: %s\n",
|
||||||
|
getpid(), rocp_reg_status, rocprofiler_register_error_string(rocp_reg_status));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool allow_v1_registration = false;
|
bool allow_v1_registration = false;
|
||||||
if(os::IsEnvVarSet("HSA_TOOLS_ROCPROFILER_V1_TOOLS"))
|
if(os::IsEnvVarSet("HSA_TOOLS_ROCPROFILER_V1_TOOLS"))
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ class Flag {
|
|||||||
|
|
||||||
var = os::GetEnvVar("HSA_TOOLS_REPORT_LOAD_FAILURE");
|
var = os::GetEnvVar("HSA_TOOLS_REPORT_LOAD_FAILURE");
|
||||||
|
|
||||||
|
report_tool_load_failures_explicit_ = (var.empty()) ? false : true;
|
||||||
ifdebug {
|
ifdebug {
|
||||||
report_tool_load_failures_ = (var == "1") ? true : false;
|
report_tool_load_failures_ = (var == "1") ? true : false;
|
||||||
} else {
|
} else {
|
||||||
@@ -248,6 +249,10 @@ class Flag {
|
|||||||
|
|
||||||
bool report_tool_load_failures() const { return report_tool_load_failures_; }
|
bool report_tool_load_failures() const { return report_tool_load_failures_; }
|
||||||
|
|
||||||
|
bool report_tool_load_failures_explicitly_set() const {
|
||||||
|
return report_tool_load_failures_explicit_;
|
||||||
|
}
|
||||||
|
|
||||||
bool disable_fragment_alloc() const { return disable_fragment_alloc_; }
|
bool disable_fragment_alloc() const { return disable_fragment_alloc_; }
|
||||||
|
|
||||||
bool rev_copy_dir() const { return rev_copy_dir_; }
|
bool rev_copy_dir() const { return rev_copy_dir_; }
|
||||||
@@ -334,6 +339,7 @@ class Flag {
|
|||||||
bool sdma_wait_idle_;
|
bool sdma_wait_idle_;
|
||||||
bool enable_queue_fault_message_;
|
bool enable_queue_fault_message_;
|
||||||
bool report_tool_load_failures_;
|
bool report_tool_load_failures_;
|
||||||
|
bool report_tool_load_failures_explicit_;
|
||||||
bool disable_fragment_alloc_;
|
bool disable_fragment_alloc_;
|
||||||
bool rev_copy_dir_;
|
bool rev_copy_dir_;
|
||||||
bool fine_grain_pcie_;
|
bool fine_grain_pcie_;
|
||||||
|
|||||||
Reference in New Issue
Block a user