Add support to retrieve process SDMA usage information.

Also, print SDMA usage information in TestProcInfoRead.

Change-Id: I8d19be3b8653e298c81237e5067eca75a1743e70
This commit is contained in:
Mukul Joshi committed 2020-07-13 17:32:08 -04:00
1 parent 68155baed5
commit eea1ed8c3d
3 files changed
+21 -1

No files matched your search

+16
View File
@@ -433,6 +433,7 @@ int GetProcessInfoForPID(uint32_t pid, rsmi_process_info_t *proc,
proc->pasid = std::stoi(tmp);
proc->vram_usage = 0;
proc->sdma_usage = 0;
for (itr = gpu_set->begin(); itr != gpu_set->end(); itr++) {
uint64_t gpu_id = (*itr);
@@ -451,6 +452,21 @@ int GetProcessInfoForPID(uint32_t pid, rsmi_process_info_t *proc,
}
proc->vram_usage += std::stoi(tmp);
std::string sdma_str_path = proc_str_path;
sdma_str_path += "/sdma_";
sdma_str_path += std::to_string(gpu_id);
err = ReadSysfsStr(sdma_str_path, &tmp);
if (err) {
return err;
}
if (!is_number(tmp)) {
return EINVAL;
}
proc->sdma_usage += std::stoi(tmp);
}
return 0;