mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add debug key for aub file generation per process id
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
a955eac9c7
commit
0a41c42854
@ -26,6 +26,7 @@
|
||||
#include "test.h"
|
||||
|
||||
#include "driver_version.h"
|
||||
#include "sys_calls.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
@ -1000,3 +1001,13 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePath
|
||||
auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", rootDeviceIndex);
|
||||
EXPECT_NE(std::string::npos, fullName.find("_123_aubfile.aub"));
|
||||
}
|
||||
|
||||
HWTEST_F(AubFileStreamTests, givenGenerateAubFilePerProcessIdDebugFlagAndAubCommandStreamReceiverWhenCreateFullFilePathIsCalledThenFileNameIsExtendedRootDeviceIndex) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
|
||||
DebugManager.flags.GenerateAubFilePerProcessId.set(1);
|
||||
auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", 1u);
|
||||
std::stringstream strExtendedFileName("_1_aubfile");
|
||||
strExtendedFileName << "_PID_" << SysCalls::getProcessId() << ".aub";
|
||||
EXPECT_NE(std::string::npos, fullName.find(strExtendedFileName.str()));
|
||||
}
|
||||
|
@ -96,6 +96,10 @@ int ioctl(int fileDescriptor, unsigned long int request, void *arg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int getProcessId() {
|
||||
return 0xABCEDF;
|
||||
}
|
||||
|
||||
int access(const char *pathName, int mode) {
|
||||
if (allowFakeDevicePath || strcmp(pathName, "/sys/dev/char/226:128") == 0) {
|
||||
return 0;
|
||||
|
@ -13,6 +13,10 @@ namespace NEO {
|
||||
|
||||
namespace SysCalls {
|
||||
|
||||
unsigned int getProcessId() {
|
||||
return 0xABCEDF;
|
||||
}
|
||||
|
||||
BOOL systemPowerStatusRetVal = 1;
|
||||
BYTE systemPowerStatusACLineStatusOverride = 1;
|
||||
const wchar_t *currentLibraryPath = L"";
|
||||
|
@ -27,6 +27,7 @@ UseAubStream = 1
|
||||
AUBDumpAllocsOnEnqueueReadOnly = 0
|
||||
AUBDumpAllocsOnEnqueueSVMMemcpyOnly = 0
|
||||
AUBDumpForceAllToLocalMemory = 0
|
||||
GenerateAubFilePerProcessId = 0
|
||||
EnableSWTags = 0
|
||||
DumpSWTagsBXML = 0
|
||||
ForceDeviceId = unk
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "shared/source/helpers/options.h"
|
||||
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
|
||||
#include "shared/source/os_interface/os_inc_base.h"
|
||||
#include "shared/source/os_interface/sys_calls_common.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
@ -35,7 +36,11 @@ std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwI
|
||||
if (subDevicesCount > 1) {
|
||||
strfilename << subDevicesCount << "tx";
|
||||
}
|
||||
strfilename << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << rootDeviceIndex << "_" << filename << ".aub";
|
||||
std::stringstream strExtendedFileName(filename.c_str());
|
||||
if (DebugManager.flags.GenerateAubFilePerProcessId.get()) {
|
||||
strExtendedFileName << "PID_" << SysCalls::getProcessId();
|
||||
}
|
||||
strfilename << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << rootDeviceIndex << "_" << strExtendedFileName.str() << ".aub";
|
||||
|
||||
// clean-up any fileName issues because of the file system incompatibilities
|
||||
auto fileName = strfilename.str();
|
||||
|
@ -36,6 +36,7 @@ DECLARE_DEBUG_VARIABLE(bool, UseAubStream, true, "Use aub_stream for aub dumping
|
||||
DECLARE_DEBUG_VARIABLE(bool, AUBDumpAllocsOnEnqueueReadOnly, false, "Force dumping buffers and images on clEnqueueReadBuffer/Image only (blocking calls)")
|
||||
DECLARE_DEBUG_VARIABLE(bool, AUBDumpAllocsOnEnqueueSVMMemcpyOnly, false, "Force dumping allocations on clEnqueueSVMMemcpy only (blocking calls)")
|
||||
DECLARE_DEBUG_VARIABLE(bool, AUBDumpForceAllToLocalMemory, false, "Force placing every allocation in local memory address space")
|
||||
DECLARE_DEBUG_VARIABLE(bool, GenerateAubFilePerProcessId, false, "Generate aub file with process id")
|
||||
|
||||
/*DEBUG FLAGS*/
|
||||
DECLARE_DEBUG_VARIABLE(bool, EnableSWTags, false, "Enable software tagging in batch buffer")
|
||||
|
@ -37,6 +37,7 @@ set(NEO_CORE_OS_INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_time.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/print.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_inc_base.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sys_calls_common.h
|
||||
)
|
||||
|
||||
if(SUPPORT_XEHP_PLUS)
|
||||
|
@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/os_interface/sys_calls_common.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <poll.h>
|
||||
#include <sys/mman.h>
|
||||
|
@ -18,7 +18,13 @@
|
||||
#include <unistd.h>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
namespace SysCalls {
|
||||
|
||||
unsigned int getProcessId() {
|
||||
return getpid();
|
||||
}
|
||||
|
||||
int close(int fileDescriptor) {
|
||||
return ::close(fileDescriptor);
|
||||
}
|
||||
|
18
shared/source/os_interface/sys_calls_common.h
Normal file
18
shared/source/os_interface/sys_calls_common.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace NEO {
|
||||
|
||||
namespace SysCalls {
|
||||
|
||||
unsigned int getProcessId();
|
||||
|
||||
} // namespace SysCalls
|
||||
|
||||
} // namespace NEO
|
@ -26,6 +26,10 @@ bool isShutdownInProgress() {
|
||||
|
||||
namespace SysCalls {
|
||||
|
||||
unsigned int getProcessId() {
|
||||
return GetCurrentProcessId();
|
||||
}
|
||||
|
||||
HANDLE createEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) {
|
||||
return CreateEventA(lpEventAttributes, bManualReset, bInitialState, lpName);
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/os_interface/sys_calls_common.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace NEO {
|
||||
|
Reference in New Issue
Block a user