mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
fix: add debug key to provide alternative directory for wddm residency logs
Related-To: NEO-8211 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b77b0e487d
commit
cb641226b5
@@ -1236,7 +1236,7 @@ uint32_t Wddm::getRequestedEUCount() const {
|
||||
|
||||
void Wddm::createPagingFenceLogger() {
|
||||
if (DebugManager.flags.WddmResidencyLogger.get()) {
|
||||
residencyLogger = std::make_unique<WddmResidencyLogger>(device, pagingFenceAddress);
|
||||
residencyLogger = std::make_unique<WddmResidencyLogger>(device, pagingFenceAddress, DebugManager.flags.WddmResidencyLoggerOutputDirectory.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/utilities/io_functions.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
|
||||
namespace NEO {
|
||||
@@ -23,13 +24,23 @@ constexpr bool wddmResidencyLoggingAvailable = false;
|
||||
|
||||
class WddmResidencyLogger {
|
||||
public:
|
||||
WddmResidencyLogger(unsigned int device, void *fenceValueCpuVirtualAddress) {
|
||||
WddmResidencyLogger(unsigned int device, void *fenceValueCpuVirtualAddress, std::string outDirectory) {
|
||||
const char *wddmResidencyLoggerDefaultDirectory = "unk";
|
||||
|
||||
std::stringstream id;
|
||||
id << std::hex;
|
||||
id << "device-0x" << device << "_"
|
||||
<< "pfencecpu-0x" << fenceValueCpuVirtualAddress;
|
||||
|
||||
std::stringstream filename;
|
||||
if (std::strcmp(wddmResidencyLoggerDefaultDirectory, outDirectory.c_str()) != 0) {
|
||||
filename << outDirectory;
|
||||
if (outDirectory.back() != '\\') {
|
||||
filename << "\\";
|
||||
}
|
||||
}
|
||||
filename << "pagingfence_" << id.str() << ".log";
|
||||
|
||||
pagingLog = IoFunctions::fopenPtr(filename.str().c_str(), "at");
|
||||
UNRECOVERABLE_IF(pagingLog == nullptr);
|
||||
IoFunctions::fprintf(pagingLog, "%s\n", id.str().c_str());
|
||||
|
||||
Reference in New Issue
Block a user