rocm_smi_lib: Fix Refactoring gpu_metrics code
Uses new support for 'gpu_metrics_v1_4' Code changes related to the following: * rsmi gpu_metrics APIs * rsmi gpu_metrics Logs * new data structure fields added in 1.4 * added APIs for all other existing metrics before 1.4 * added support to older metrics; 1.1, and 1.2 * public APIs renamed to start with prefix 'rsmi_dev_metrics_' * Unit tests updated * Examples updated Build changes related to the following: None Change-Id: Ibdaf031be9d916020b4049544dbd725858c7711d Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
This commit is contained in:
+958
-64
File diff suppressed because it is too large
Load Diff
@@ -530,7 +530,7 @@ static const std::map<const char *, dev_depends_t> kDevFuncDependsMap = {
|
||||
|
||||
Device::Device(std::string p, RocmSMI_env_vars const *e) :
|
||||
monitor_(nullptr), path_(p), env_(e), evt_notif_anon_fd_(-1),
|
||||
gpu_metrics_ver_{0, 0, 0} {
|
||||
m_gpu_metrics_header{0, 0, 0} {
|
||||
#ifndef DEBUG
|
||||
env_ = nullptr;
|
||||
#endif
|
||||
@@ -875,7 +875,14 @@ int Device::readDevInfoBinary(DevInfoTypes type, std::size_t b_size,
|
||||
if ((num*b_size) != b_size) {
|
||||
ss << "Could not read DevInfoBinary for DevInfoType ("
|
||||
<< RocmSMI::devInfoTypesStrings.at(type) << ") - SYSFS ("
|
||||
<< sysfs_path << "), binary size error, "
|
||||
<< sysfs_path << "), binary size error; "
|
||||
<< "[buff: "
|
||||
<< p_binary_data
|
||||
<< " size: "
|
||||
<< b_size
|
||||
<< " read: "
|
||||
<< num
|
||||
<< "]"
|
||||
<< ", returning ENOENT (" << std::strerror(ENOENT) << ")";
|
||||
LOG_ERROR(ss);
|
||||
return ENOENT;
|
||||
|
||||
+1720
-700
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user