SWDEV-251360 - Add tracing for memory allocation/free.
This can be used to debug VM fault
Change-Id: I7685485b0450ea84d10b710639ad7b6c5ec2fcf3
[ROCm/clr commit: e4e6c46356]
이 커밋은 다음에 포함됨:
1 부모
7b0edf7aa0
커밋
23a7abc8e8
2 파일이 변경됨
+8
검색과 일치하는 파일 없음
@@ -1778,6 +1778,7 @@ void* Device::hostAlloc(size_t size, size_t alignment, bool atomics) const {
|
||||
: system_segment_;
|
||||
assert(segment.handle != 0);
|
||||
hsa_status_t stat = hsa_amd_memory_pool_allocate(segment, size, 0, &ptr);
|
||||
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "Allocate hsa host memory %p, size 0x%zx", ptr, size);
|
||||
if (stat != HSA_STATUS_SUCCESS) {
|
||||
LogError("Fail allocation host memory");
|
||||
return nullptr;
|
||||
@@ -1804,6 +1805,7 @@ void* Device::hostAgentAlloc(size_t size, const AgentInfo& agentInfo, bool atomi
|
||||
: agentInfo.fine_grain_pool;
|
||||
assert(segment.handle != 0);
|
||||
hsa_status_t stat = hsa_amd_memory_pool_allocate(segment, size, 0, &ptr);
|
||||
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "Allocate hsa host memory %p, size 0x%zx", ptr, size);
|
||||
if (stat != HSA_STATUS_SUCCESS) {
|
||||
LogPrintfError("Fail allocation host memory with err %d", stat);
|
||||
return nullptr;
|
||||
@@ -1910,6 +1912,7 @@ void* Device::deviceLocalAlloc(size_t size, bool atomics) const {
|
||||
|
||||
void* ptr = nullptr;
|
||||
hsa_status_t stat = hsa_amd_memory_pool_allocate(pool, size, 0, &ptr);
|
||||
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "Allocate hsa device memory %p, size 0x%zx", ptr, size);
|
||||
if (stat != HSA_STATUS_SUCCESS) {
|
||||
LogError("Fail allocation local memory");
|
||||
return nullptr;
|
||||
@@ -1925,6 +1928,7 @@ void* Device::deviceLocalAlloc(size_t size, bool atomics) const {
|
||||
|
||||
void Device::memFree(void* ptr, size_t size) const {
|
||||
hsa_status_t stat = hsa_amd_memory_pool_free(ptr);
|
||||
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "Free hsa memory %p", ptr);
|
||||
if (stat != HSA_STATUS_SUCCESS) {
|
||||
LogError("Fail freeing local memory");
|
||||
}
|
||||
|
||||
새 이슈에서 참조
사용자 차단