SWDEV-251360 - Add tracing for memory allocation/free.

This can be used to debug VM fault

Change-Id: I7685485b0450ea84d10b710639ad7b6c5ec2fcf3
Цей коміт міститься в:
Alex Xie
2020-09-27 19:02:57 -04:00
зафіксовано AlexBin Xie
джерело a224dc2a7b
коміт e4e6c46356
2 змінених файлів з 8 додано та 0 видалено
+4
Переглянути файл
@@ -261,6 +261,9 @@ bool Memory::createInteropBuffer(GLenum targetType, int miplevel) {
1, &agent, out.dmabuf_fd, 0, &size, &deviceMemory_, &metadata_size, (const void**)&metadata);
close(out.dmabuf_fd);
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "Map GL memory %p, size 0x%zx, offset=0x%llx",
deviceMemory_, size, out.buf_offset);
deviceMemory_ = static_cast<char*>(deviceMemory_) + out.buf_offset;
if (status != HSA_STATUS_SUCCESS) return false;
@@ -283,6 +286,7 @@ bool Memory::createInteropBuffer(GLenum targetType, int miplevel) {
void Memory::destroyInteropBuffer() {
assert(kind_ == MEMORY_KIND_INTEROP && "Memory must be interop type.");
hsa_amd_interop_unmap_buffer(deviceMemory_);
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "Unmap GL memory %p", deviceMemory_);
deviceMemory_ = nullptr;
}