Skip to content

Commit 5685b28

Browse files
Extract logging logic from DebugSettingsManager
Change-Id: I0ccc68216c1c3bb23d0389bec17124e09e4f98e1 Signed-off-by: Mateusz Hoppe <[email protected]>
1 parent d135944 commit 5685b28

29 files changed

+1875
-1625
lines changed

core/helpers/aligned_memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#pragma once
99
#include "core/helpers/debug_helpers.h"
1010
#include "core/memory_manager/memory_constants.h"
11-
#include "runtime/os_interface/debug_settings_manager.h"
11+
#include "runtime/utilities/logger.h"
1212

1313
#include <algorithm>
1414
#include <cstddef>

core/memory_manager/graphics_allocation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
#include "graphics_allocation.h"
99

1010
#include "core/helpers/aligned_memory.h"
11-
#include "runtime/os_interface/debug_settings_manager.h"
11+
#include "runtime/utilities/logger.h"
1212

1313
namespace NEO {
1414

1515
void GraphicsAllocation::setAllocationType(AllocationType allocationType) {
1616
this->allocationType = allocationType;
17-
DebugManager.logAllocation(this);
17+
FileLoggerInstance().logAllocation(this);
1818
}
1919

2020
GraphicsAllocation::GraphicsAllocation(uint32_t rootDeviceIndex, AllocationType allocationType, void *cpuPtrIn, uint64_t gpuAddress, uint64_t baseAddress,

offline_compiler/offline_compiler_helper.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ DebugSettingsManager<DebugLevel>::DebugSettingsManager() {
1818
template <DebugFunctionalityLevel DebugLevel>
1919
DebugSettingsManager<DebugLevel>::~DebugSettingsManager() = default;
2020

21-
template <DebugFunctionalityLevel DebugLevel>
22-
void DebugSettingsManager<DebugLevel>::writeToFile(std::string filename, const char *str, size_t length, std::ios_base::openmode mode) {
23-
std::ofstream outFile(filename, mode);
24-
if (outFile.is_open()) {
25-
outFile.write(str, length);
26-
outFile.close();
27-
}
28-
}
29-
3021
// Global Debug Settings Manager
3122
DebugSettingsManager<globalDebugFunctionalityLevel> DebugManager;
3223
} // namespace NEO

runtime/api/api.cpp

Lines changed: 160 additions & 163 deletions
Large diffs are not rendered by default.

runtime/command_queue/command_queue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ bool CommandQueue::isQueueBlocked() {
179179
taskLevel = getGpgpuCommandStreamReceiver().peekTaskLevel();
180180
}
181181

182-
DebugManager.log(DebugManager.flags.EventsDebugEnable.get(), "isQueueBlocked taskLevel change from", taskLevel, "to new from virtualEvent", this->virtualEvent, "new tasklevel", this->virtualEvent->taskLevel.load());
182+
FileLoggerInstance().log(DebugManager.flags.EventsDebugEnable.get(), "isQueueBlocked taskLevel change from", taskLevel, "to new from virtualEvent", this->virtualEvent, "new tasklevel", this->virtualEvent->taskLevel.load());
183183

184184
//close the access to virtual event, driver added only 1 ref count.
185185
this->virtualEvent->decRefInternal();

runtime/command_queue/enqueue_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
341341

342342
if (eventBuilder.getEvent()) {
343343
eventBuilder.getEvent()->updateCompletionStamp(completionStamp.taskCount, completionStamp.taskLevel, completionStamp.flushStamp);
344-
DebugManager.log(DebugManager.flags.EventsDebugEnable.get(), "updateCompletionStamp Event", eventBuilder.getEvent(), "taskLevel", eventBuilder.getEvent()->taskLevel.load());
344+
FileLoggerInstance().log(DebugManager.flags.EventsDebugEnable.get(), "updateCompletionStamp Event", eventBuilder.getEvent(), "taskLevel", eventBuilder.getEvent()->taskLevel.load());
345345
}
346346

347347
if (blockQueue) {
@@ -391,7 +391,7 @@ void CommandQueueHw<GfxFamily>::processDispatchForKernels(const MultiDispatchInf
391391
KernelOperation *blockedCommandsData,
392392
TimestampPacketDependencies &timestampPacketDependencies) {
393393
TagNode<HwPerfCounter> *hwPerfCounter = nullptr;
394-
DebugManager.dumpKernelArgs(&multiDispatchInfo);
394+
FileLoggerInstance().dumpKernelArgs(&multiDispatchInfo);
395395

396396
printfHandler.reset(PrintfHandler::create(multiDispatchInfo, *device));
397397
if (printfHandler) {

runtime/kernel/kernel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ class Kernel : public BaseObject<_cl_kernel> {
9090
*errcodeRet = retVal;
9191
}
9292

93-
if (DebugManager.debugKernelDumpingAvailable()) {
93+
if (FileLoggerInstance().enabled()) {
9494
std::string source;
9595
program->getSource(source);
96-
DebugManager.dumpKernel(kernelInfo.name, source);
96+
FileLoggerInstance().dumpKernel(kernelInfo.name, source);
9797
}
9898

9999
return pKernel;

runtime/memory_manager/memory_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemoryInPreferredPool(const A
323323
if (!allocation && status == AllocationStatus::RetryInNonDevicePool) {
324324
allocation = allocateGraphicsMemory(allocationData);
325325
}
326-
DebugManager.logAllocation(allocation);
326+
FileLoggerInstance().logAllocation(allocation);
327327
return allocation;
328328
}
329329

0 commit comments

Comments
 (0)