Add DEBUG_LOG macro
Add DEBUG_LOG that will optionally print error
message when RSMI_DEBUG_BITFIELD is set to 2.
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I6017e92d8a9e5f9861ae29ece0488d4bc198f996
[ROCm/amdsmi commit: 99be3451d7]
This commit is contained in:
@@ -133,8 +133,16 @@
|
||||
std::endl;\
|
||||
}
|
||||
|
||||
#define DEBUG_LOG(WR_STR, VR) \
|
||||
amd::smi::RocmSMI& smi = amd::smi::RocmSMI::getInstance(); \
|
||||
if (smi.getEnv().debug_output_bitfield & RSMI_DEBUG_VAL) { \
|
||||
if ((WR_STR) != nullptr) \
|
||||
std::cout << (WR_STR) << " " << (VR) << std::endl;\
|
||||
}
|
||||
|
||||
// Add different debug filters here, as powers of 2; e.g, 1, 2, 4, 8, ...
|
||||
#define RSMI_DEBUG_SYSFS_FILE_PATHS 1
|
||||
#define RSMI_DEBUG_SYSFS_FILE_PATHS 1<<0
|
||||
#define RSMI_DEBUG_VAL 1<<1
|
||||
|
||||
struct rsmi_func_id_iter_handle {
|
||||
uintptr_t func_id_iter;
|
||||
|
||||
@@ -112,6 +112,7 @@ class RocmSMI {
|
||||
int get_io_link_weight(uint32_t node_from, uint32_t node_to,
|
||||
uint64_t *weight);
|
||||
int get_node_index(uint32_t dv_ind, uint32_t *node_ind);
|
||||
const RocmSMI_env_vars& getEnv(void);
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<Device>> devices_;
|
||||
|
||||
@@ -376,6 +376,10 @@ void RocmSMI::GetEnvVariables(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
const RocmSMI_env_vars& RocmSMI::getEnv(void) {
|
||||
return env_vars_;
|
||||
}
|
||||
|
||||
std::shared_ptr<Monitor>
|
||||
RocmSMI::FindMonitor(std::string monitor_path) {
|
||||
std::string tmp;
|
||||
|
||||
Reference in New Issue
Block a user