mirror of
https://gitee.com/openharmony/commonlibrary_memory_utils
synced 2024-11-27 09:21:58 +00:00
Rectification of encoding specification for libmeminfo
Signed-off-by: sakura_pc <yaopengcheng3@huawei.com> Signed-off-by: sakura_pc <yaopengcheng3@huawei.com>
This commit is contained in:
parent
f1c85af3ac
commit
26e0df0fa8
@ -120,22 +120,23 @@ bool GetGraphicsMemory(const int pid, uint64_t &gl, uint64_t &graph)
|
||||
|
||||
for (const auto &memTrackerType : MEMORY_TRACKER_TYPES) {
|
||||
std::vector<MemoryRecord> records;
|
||||
if (memtrack->GetDevMem(pid, memTrackerType.first, records) == HDF_SUCCESS) {
|
||||
uint64_t value = 0;
|
||||
for (const auto &record : records) {
|
||||
if ((static_cast<uint32_t>(record.flags) & FLAG_UNMAPPED) == FLAG_UNMAPPED) {
|
||||
value = static_cast<uint64_t>(record.size / BYTE_PER_KB);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (memTrackerType.first == MEMORY_TRACKER_TYPE_GL) {
|
||||
gl = value;
|
||||
ret = true;
|
||||
} else if (memTrackerType.first == MEMORY_TRACKER_TYPE_GRAPH) {
|
||||
graph = value;
|
||||
ret = true;
|
||||
if (memtrack->GetDevMem(pid, memTrackerType.first, records) != HDF_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
uint64_t value = 0;
|
||||
for (const auto &record : records) {
|
||||
if ((static_cast<uint32_t>(record.flags) & FLAG_UNMAPPED) == FLAG_UNMAPPED) {
|
||||
value = static_cast<uint64_t>(record.size / BYTE_PER_KB);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (memTrackerType.first == MEMORY_TRACKER_TYPE_GL) {
|
||||
gl = value;
|
||||
ret = true;
|
||||
} else if (memTrackerType.first == MEMORY_TRACKER_TYPE_GRAPH) {
|
||||
graph = value;
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user