HIP compiler table support (#50)
* Update lib/rocprofiler-register/details/dl.cpp - change default_link_open_modes to only use LAZY + NOLOAD * Update lib/rocprofiler-register/rocprofiler-register.cpp - Support HIP compiler table - changed FATAL logging to WARNING in rocp_load_rocprofiler_lib * Update VERSION - bump to 0.2.0
Este cometimento está contido em:
cometido por
GitHub
ascendente
ab02cb6570
cometimento
8ac1d556ce
+1
-1
@@ -1 +1 @@
|
||||
0.1.0
|
||||
0.2.0
|
||||
|
||||
@@ -44,8 +44,7 @@ namespace binary
|
||||
{
|
||||
namespace
|
||||
{
|
||||
const open_modes_vec_t default_link_open_modes = { (RTLD_LAZY | RTLD_NOLOAD),
|
||||
(RTLD_LAZY | RTLD_LOCAL) };
|
||||
const open_modes_vec_t default_link_open_modes = { (RTLD_LAZY | RTLD_NOLOAD) };
|
||||
} // namespace
|
||||
|
||||
std::vector<segment_address_ranges>
|
||||
|
||||
@@ -43,6 +43,8 @@ extern "C" {
|
||||
#pragma weak rocprofiler_set_api_table
|
||||
#pragma weak rocprofiler_register_import_hip
|
||||
#pragma weak rocprofiler_register_import_hip_static
|
||||
#pragma weak rocprofiler_register_import_hip_compiler
|
||||
#pragma weak rocprofiler_register_import_hip_compiler_static
|
||||
#pragma weak rocprofiler_register_import_hsa
|
||||
#pragma weak rocprofiler_register_import_hsa_static
|
||||
#pragma weak rocprofiler_register_import_roctx
|
||||
@@ -57,6 +59,9 @@ rocprofiler_set_api_table(const char*, uint64_t, uint64_t, void**, uint64_t);
|
||||
extern uint32_t
|
||||
rocprofiler_register_import_hip(void);
|
||||
|
||||
extern uint32_t
|
||||
rocprofiler_register_import_hip_compiler(void);
|
||||
|
||||
extern uint32_t
|
||||
rocprofiler_register_import_hsa(void);
|
||||
|
||||
@@ -66,6 +71,9 @@ rocprofiler_register_import_roctx(void);
|
||||
extern uint32_t
|
||||
rocprofiler_register_import_hip_static(void);
|
||||
|
||||
extern uint32_t
|
||||
rocprofiler_register_import_hip_compiler_static(void);
|
||||
|
||||
extern uint32_t
|
||||
rocprofiler_register_import_hsa_static(void);
|
||||
|
||||
@@ -96,6 +104,7 @@ enum rocp_reg_supported_library // NOLINT(performance-enum-size)
|
||||
ROCP_REG_HSA = 0,
|
||||
ROCP_REG_HIP,
|
||||
ROCP_REG_ROCTX,
|
||||
ROCP_REG_HIP_COMPILER,
|
||||
ROCP_REG_LAST,
|
||||
};
|
||||
|
||||
@@ -145,6 +154,11 @@ ROCP_REG_DEFINE_LIBRARY_TRAITS(ROCP_REG_ROCTX,
|
||||
"rocprofiler_register_import_roctx",
|
||||
"libroctx64.so.[4-9]($|\\.[0-9\\.]+)")
|
||||
|
||||
ROCP_REG_DEFINE_LIBRARY_TRAITS(ROCP_REG_HIP_COMPILER,
|
||||
"hip_compiler",
|
||||
"rocprofiler_register_import_hip_compiler",
|
||||
"libamdhip64.so.[6-9]($|\\.[0-9\\.]+)")
|
||||
|
||||
ROCP_REG_DEFINE_ERROR_MESSAGE(ROCP_REG_SUCCESS, "Success")
|
||||
ROCP_REG_DEFINE_ERROR_MESSAGE(ROCP_REG_NO_TOOLS, "rocprofiler-register found no tools")
|
||||
ROCP_REG_DEFINE_ERROR_MESSAGE(ROCP_REG_DEADLOCK, "rocprofiler-register deadlocked")
|
||||
@@ -234,12 +248,18 @@ rocp_reg_scan_for_tools()
|
||||
if(rocprofiler_lib_handle && rocprofiler_lib_config_fn)
|
||||
return std::make_pair(rocprofiler_lib_handle, rocprofiler_lib_config_fn);
|
||||
|
||||
if(_rocp_reg_lib.empty()) _rocp_reg_lib = rocprofiler_lib_name;
|
||||
|
||||
std::tie(rocprofiler_lib_handle, rocprofiler_lib_config_fn) =
|
||||
rocp_load_rocprofiler_lib(rocprofiler_lib_name);
|
||||
rocp_load_rocprofiler_lib(_rocp_reg_lib);
|
||||
|
||||
if(!rocprofiler_lib_config_fn)
|
||||
std::tie(rocprofiler_lib_handle, rocprofiler_lib_config_fn) =
|
||||
rocp_load_rocprofiler_lib("librocprofiler64.so");
|
||||
|
||||
LOG_IF(FATAL, !rocprofiler_lib_config_fn)
|
||||
<< rocprofiler_lib_register_entrypoint << " not found. Tried to dlopen "
|
||||
<< _rocp_reg_lib << " and librocprofiler64.so";
|
||||
}
|
||||
else if(_found_tool && rocprofiler_set_api_table)
|
||||
{
|
||||
@@ -296,13 +316,13 @@ rocp_load_rocprofiler_lib(std::string _rocp_reg_lib)
|
||||
LOG(INFO) << "loaded " << _rocp_reg_lib_path_fname.string() << " library at "
|
||||
<< _rocp_reg_lib_path.string();
|
||||
|
||||
LOG_IF(FATAL, rocprofiler_lib_handle == nullptr)
|
||||
LOG_IF(WARNING, rocprofiler_lib_handle == nullptr)
|
||||
<< _rocp_reg_lib << " failed to load\n";
|
||||
|
||||
*(void**) (&rocprofiler_lib_config_fn) =
|
||||
dlsym(rocprofiler_lib_handle, rocprofiler_lib_register_entrypoint);
|
||||
|
||||
LOG_IF(FATAL, rocprofiler_lib_config_fn == nullptr)
|
||||
LOG_IF(WARNING, rocprofiler_lib_config_fn == nullptr)
|
||||
<< _rocp_reg_lib << " did not contain '" << rocprofiler_lib_register_entrypoint
|
||||
<< "' symbol\n";
|
||||
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador