performance: Check if print xe logs is needed before locking

Related-To: NEO-7996
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-07-03 11:14:02 +00:00
committed by Compute-Runtime-Automation
parent 30c5d8a681
commit 3f27b5225c
3 changed files with 38 additions and 11 deletions

View File

@@ -1145,17 +1145,17 @@ int IoctlHelperXe::ioctl(DrmIoctl request, void *arg) {
}
void IoctlHelperXe::xeShowBindTable() {
#if 1
std::unique_lock<std::mutex> lock(xeLock);
xeLog("show bind: (<index> <handle> <userptr> <addr> <size>)\n", "");
for (unsigned int i = 0; i < bindInfo.size(); i++) {
xeLog(" %3d x%08x x%016lx x%016lx x%016lx\n", i,
bindInfo[i].handle,
bindInfo[i].userptr,
bindInfo[i].addr,
bindInfo[i].size);
if (DebugManager.flags.PrintDebugMessages.get()) {
std::unique_lock<std::mutex> lock(xeLock);
xeLog("show bind: (<index> <handle> <userptr> <addr> <size>)\n", "");
for (unsigned int i = 0; i < bindInfo.size(); i++) {
xeLog(" %3d x%08x x%016lx x%016lx x%016lx\n", i,
bindInfo[i].handle,
bindInfo[i].userptr,
bindInfo[i].addr,
bindInfo[i].size);
}
}
#endif
}
int IoctlHelperXe::createDrmContext(Drm &drm, OsContextLinux &osContext, uint32_t drmVmId, uint32_t deviceIndex) {