Add patch info comments to AUB dump

Collect patching information and add as comments to AUB dump.

Change-Id: Ib7c903a2589d68b6e3e614c1774c7cd5a000c29f
This commit is contained in:
Pawel Wilma
2018-03-14 11:07:51 +01:00
committed by sys_ocldev
parent d7fe01454b
commit ff1d2361f3
28 changed files with 853 additions and 47 deletions

View File

@@ -1093,7 +1093,12 @@ cl_int Kernel::setArgBuffer(uint32_t argIndex,
auto patchSize = kernelArgInfo.kernelArgPatchInfoVector[0].size;
buffer->setArgStateless(patchLocation, patchSize, !this->isBuiltIn);
uint64_t addressToPatch = buffer->setArgStateless(patchLocation, patchSize, !this->isBuiltIn);
if (DebugManager.flags.AddPatchInfoCommentsForAUBDump.get()) {
PatchInfoData patchInfoData = {addressToPatch - buffer->getOffset(), buffer->getOffset(), PatchInfoAllocationType::KernelArg, reinterpret_cast<uint64_t>(getCrossThreadData()), kernelArgInfo.kernelArgPatchInfoVector[0].crossthreadOffset, PatchInfoAllocationType::IndirectObjectHeap};
this->patchInfoDataList.push_back(patchInfoData);
}
if (requiresSshForBuffers()) {
auto surfaceState = ptrOffset(getSurfaceStateHeap(), kernelArgInfo.offsetHeap);

View File

@@ -26,6 +26,7 @@
#include "runtime/device_queue/device_queue.h"
#include "runtime/helpers/base_object.h"
#include "runtime/helpers/preamble.h"
#include "runtime/helpers/address_patch.h"
#include "runtime/program/program.h"
#include "runtime/program/kernel_info.h"
#include "runtime/os_interface/debug_settings_manager.h"
@@ -369,6 +370,8 @@ class Kernel : public BaseObject<_cl_kernel> {
return 0;
}
std::vector<PatchInfoData> &getPatchInfoDataList() { return patchInfoDataList; };
protected:
struct ObjectCounts {
uint32_t imageCount;
@@ -476,5 +479,7 @@ class Kernel : public BaseObject<_cl_kernel> {
bool usingSharedObjArgs;
uint32_t patchedArgumentsNum = 0;
std::vector<PatchInfoData> patchInfoDataList;
};
} // namespace OCLRT