From f301053740b107595e98f121d132829bf6983fd2 Mon Sep 17 00:00:00 2001 From: SaleelK Date: Sat, 25 Oct 2025 15:55:27 -0700 Subject: [PATCH] clr: Improve logging (#1457) --- projects/clr/hipamd/src/hip_fatbin.cpp | 13 +------------ projects/clr/rocclr/device/rocm/rocvirtual.cpp | 4 ++-- projects/clr/rocclr/utils/debug.hpp | 1 + 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/projects/clr/hipamd/src/hip_fatbin.cpp b/projects/clr/hipamd/src/hip_fatbin.cpp index 0f923b1709..fd9b059c5c 100644 --- a/projects/clr/hipamd/src/hip_fatbin.cpp +++ b/projects/clr/hipamd/src/hip_fatbin.cpp @@ -119,7 +119,6 @@ FatBinaryInfo::~FatBinaryInfo() { } } for (auto itemData : toDelete) { - LogPrintfInfo("~FatBinaryInfo(%p) will delete binary_image_ %p", this, itemData); delete[] reinterpret_cast(itemData); } ReleaseImageAndFile(); @@ -383,8 +382,6 @@ static bool UncompressAndPopulateCodeObject( std::string bundle_entry = remove_file_extension( std::string(item_bundle_id.c_str() + sizeof(symbols::kOffloadHipV4FatBinName_) - 1)); - LogPrintfInfo("Inserting bundle entry of %s : size: %d, data: %p", bundle_entry.c_str(), - item_size, item_data); code_obj_map[bundle_entry] = std::make_pair(item_data, item_size); } } @@ -510,8 +507,6 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vectordevices()[0]->isa().isaName(); unique_isa_names.insert(device_name); auto generic_name = TargetToGeneric(device_name); - LogPrintfInfo("Looking up generic name of : %s - %s", device_name.c_str(), - generic_name.c_str()); if (!generic_name.empty()) { unique_isa_names.insert(generic_name); } @@ -537,13 +532,10 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vectordevices()[0]->isa().targetId()); - // We need to do this because there is existing mechanism which deletes code object in // destructor. Ideally next set of refactor should sort it. char* co = new char[native_co->second.second]; @@ -554,8 +546,6 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vectordevices()[0]->isa().targetId(), - generic_target_name.c_str()); char* co = new char[generic_co->second.second]; std::memcpy(co, reinterpret_cast(generic_co->second.first), generic_co->second.second); @@ -566,7 +556,6 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vectordevices()[0]->isa().targetId(); std::string isa = "amdgcn-amd-amdhsa--" + target_id; - LogPrintfInfo("Creating ISA for: %s from spirv", target_id.c_str()); comgr_helper::ComgrDataSetUniqueHandle spirv_data_set; comgr_helper::ComgrDataSetUniqueHandle reloc_data; diff --git a/projects/clr/rocclr/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/device/rocm/rocvirtual.cpp index 85f7e453cc..f8eab66861 100644 --- a/projects/clr/rocclr/device/rocm/rocvirtual.cpp +++ b/projects/clr/rocclr/device/rocm/rocvirtual.cpp @@ -1291,7 +1291,7 @@ bool VirtualGPU::dispatchGenericAqlPacketBatch(const std::vector& pa uint8_t packetType = extractAqlBits(header, HSA_PACKET_HEADER_TYPE, HSA_PACKET_HEADER_WIDTH_TYPE); if (packetType == HSA_PACKET_TYPE_KERNEL_DISPATCH) { - ClPrint(amd::LOG_DETAIL_DEBUG, amd::LOG_AQL, "Graph shader name : %s, device id : %u", + ClPrint(amd::LOG_DETAIL_DEBUG, amd::LOG_KERN2, "Graph ShaderName : %s, device id : %u", (*kernelNames)[packetIndex].c_str(), dev().index()); ClPrint( @@ -3499,7 +3499,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const reinterpret_cast(parameters + kernelParams.memoryObjOffset()); bool isGraphCapture = command_ != nullptr && command_->getPktCapturingState(); - ClPrint(amd::LOG_INFO, amd::LOG_KERN, "ShaderName : %s", gpuKernel.getDemangledName().c_str()); + ClPrint(amd::LOG_INFO, amd::LOG_KERN2, "ShaderName : %s", gpuKernel.getDemangledName().c_str()); amd::NDRange local_size(sizes.local()); address hidden_arguments = const_cast
(parameters); diff --git a/projects/clr/rocclr/utils/debug.hpp b/projects/clr/rocclr/utils/debug.hpp index be5ffc4517..3959e9d767 100644 --- a/projects/clr/rocclr/utils/debug.hpp +++ b/projects/clr/rocclr/utils/debug.hpp @@ -67,6 +67,7 @@ enum LogMask { LOG_MEM_POOL = 262144, //!< (0x40000) Memory pool allocation, including memory in graphs LOG_TS = 524288, //!< (0x80000) Timestamp details LOG_COMGR = 1048576, //!< (0x100000) Comgr path information print + LOG_KERN2 = 2097152, //!< (0x200000) More detailed kernel info shader name LOG_ALWAYS = -1 //!< (0xFFFFFFFF) Log always even mask flag is zero };