Add Debugger specific log print macros
- use DebuggerLogBitmask while printing logs for SBA tracking Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
parent
3d13a9d855
commit
671d916c70
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -88,7 +88,7 @@ ze_result_t CommandQueueImp::synchronizeByPollingForTaskCount(uint64_t timeout)
|
|||
|
||||
printFunctionsPrintfOutput();
|
||||
|
||||
if (NEO::Debugger::isDebugEnabled(internalUsage) && device->getL0Debugger() && NEO::DebugManager.flags.PrintDebugMessages.get()) {
|
||||
if (NEO::Debugger::isDebugEnabled(internalUsage) && device->getL0Debugger() && NEO::DebugManager.flags.DebuggerLogBitmask.get()) {
|
||||
device->getL0Debugger()->printTrackedAddresses(csr->getOsContext().getContextId());
|
||||
}
|
||||
|
||||
|
|
|
@ -76,15 +76,14 @@ void DebuggerL0::printTrackedAddresses(uint32_t contextId) {
|
|||
auto memory = perContextSbaAllocations[contextId]->getUnderlyingBuffer();
|
||||
auto sba = reinterpret_cast<SbaTrackedAddresses *>(memory);
|
||||
|
||||
PRINT_DEBUG_STRING(NEO::DebugManager.flags.PrintDebugMessages.get(), stdout,
|
||||
"Debugger: SBA ssh = %" SCNx64
|
||||
" gsba = %" SCNx64
|
||||
" dsba = %" SCNx64
|
||||
" ioba = %" SCNx64
|
||||
" iba = %" SCNx64
|
||||
" bsurfsba = %" SCNx64 "\n",
|
||||
sba->SurfaceStateBaseAddress, sba->GeneralStateBaseAddress, sba->DynamicStateBaseAddress,
|
||||
sba->IndirectObjectBaseAddress, sba->InstructionBaseAddress, sba->BindlessSurfaceStateBaseAddress);
|
||||
PRINT_DEBUGGER_INFO_LOG("Debugger: SBA ssh = %" SCNx64
|
||||
" gsba = %" SCNx64
|
||||
" dsba = %" SCNx64
|
||||
" ioba = %" SCNx64
|
||||
" iba = %" SCNx64
|
||||
" bsurfsba = %" SCNx64 "\n",
|
||||
sba->SurfaceStateBaseAddress, sba->GeneralStateBaseAddress, sba->DynamicStateBaseAddress,
|
||||
sba->IndirectObjectBaseAddress, sba->InstructionBaseAddress, sba->BindlessSurfaceStateBaseAddress);
|
||||
}
|
||||
|
||||
DebuggerL0 ::~DebuggerL0() {
|
||||
|
|
|
@ -25,15 +25,14 @@ void DebuggerL0Hw<GfxFamily>::programSbaTrackingCommands(NEO::LinearStream &cmdS
|
|||
using MI_STORE_DATA_IMM = typename GfxFamily::MI_STORE_DATA_IMM;
|
||||
auto gpuAddress = NEO::GmmHelper::decanonize(sbaTrackingGpuVa.address);
|
||||
|
||||
PRINT_DEBUG_STRING(NEO::DebugManager.flags.PrintDebugMessages.get(), stdout,
|
||||
"Debugger: SBA stored ssh = %" SCNx64
|
||||
" gsba = %" SCNx64
|
||||
" dsba = %" SCNx64
|
||||
" ioba = %" SCNx64
|
||||
" iba = %" SCNx64
|
||||
" bsurfsba = %" SCNx64 "\n",
|
||||
sba.SurfaceStateBaseAddress, sba.GeneralStateBaseAddress, sba.DynamicStateBaseAddress,
|
||||
sba.IndirectObjectBaseAddress, sba.InstructionBaseAddress, sba.BindlessSurfaceStateBaseAddress);
|
||||
PRINT_DEBUGGER_INFO_LOG("Debugger: SBA stored ssh = %" SCNx64
|
||||
" gsba = %" SCNx64
|
||||
" dsba = %" SCNx64
|
||||
" ioba = %" SCNx64
|
||||
" iba = %" SCNx64
|
||||
" bsurfsba = %" SCNx64 "\n",
|
||||
sba.SurfaceStateBaseAddress, sba.GeneralStateBaseAddress, sba.DynamicStateBaseAddress,
|
||||
sba.IndirectObjectBaseAddress, sba.InstructionBaseAddress, sba.BindlessSurfaceStateBaseAddress);
|
||||
|
||||
if (sba.GeneralStateBaseAddress) {
|
||||
MI_STORE_DATA_IMM storeDataImmediate = GfxFamily::cmdInitStoreDataImm;
|
||||
|
|
|
@ -218,9 +218,9 @@ HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledAndRequiredGsbaWhenCommandListIsE
|
|||
commandQueue->destroy();
|
||||
}
|
||||
|
||||
HWTEST_F(L0DebuggerTest, givenDebuggingEnabledAndPrintDebugMessagesWhenCommandQueueIsSynchronizedThenSbaAddressesArePrinted) {
|
||||
HWTEST_F(L0DebuggerTest, givenDebuggingEnabledAndDebuggerLogsWhenCommandQueueIsSynchronizedThenSbaAddressesArePrinted) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::DebugManager.flags.PrintDebugMessages.set(1);
|
||||
NEO::DebugManager.flags.DebuggerLogBitmask.set(255);
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
|
||||
|
@ -239,7 +239,7 @@ HWTEST_F(L0DebuggerTest, givenDebuggingEnabledAndPrintDebugMessagesWhenCommandQu
|
|||
commandQueue->synchronize(0);
|
||||
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
size_t pos = output.find("Debugger: SBA stored ssh");
|
||||
size_t pos = output.find("INFO: Debugger: SBA stored ssh");
|
||||
EXPECT_NE(std::string::npos, pos);
|
||||
|
||||
pos = output.find("Debugger: SBA ssh");
|
||||
|
@ -253,9 +253,9 @@ HWTEST_F(L0DebuggerTest, givenDebuggingEnabledAndPrintDebugMessagesWhenCommandQu
|
|||
|
||||
using L0DebuggerSimpleTest = Test<DeviceFixture>;
|
||||
|
||||
HWTEST_F(L0DebuggerSimpleTest, givenNullL0DebuggerAndPrintDebugMessagesWhenCommandQueueIsSynchronizedThenSbaAddressesAreNotPrinted) {
|
||||
HWTEST_F(L0DebuggerSimpleTest, givenNullL0DebuggerAndDebuggerLogsWhenCommandQueueIsSynchronizedThenSbaAddressesAreNotPrinted) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::DebugManager.flags.PrintDebugMessages.set(1);
|
||||
NEO::DebugManager.flags.DebuggerLogBitmask.set(255);
|
||||
|
||||
EXPECT_EQ(nullptr, device->getL0Debugger());
|
||||
testing::internal::CaptureStdout();
|
||||
|
@ -284,9 +284,9 @@ HWTEST_F(L0DebuggerSimpleTest, givenNullL0DebuggerAndPrintDebugMessagesWhenComma
|
|||
commandQueue->destroy();
|
||||
}
|
||||
|
||||
HWTEST_F(L0DebuggerTest, givenL0DebuggerAndPrintDebugMessagesSetToFalseWhenCommandQueueIsSynchronizedThenSbaAddressesAreNotPrinted) {
|
||||
HWTEST_F(L0DebuggerTest, givenL0DebuggerAndDebuggerLogsDisabledWhenCommandQueueIsSynchronizedThenSbaAddressesAreNotPrinted) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::DebugManager.flags.PrintDebugMessages.set(0);
|
||||
NEO::DebugManager.flags.DebuggerLogBitmask.set(0);
|
||||
|
||||
EXPECT_NE(nullptr, device->getL0Debugger());
|
||||
testing::internal::CaptureStdout();
|
||||
|
@ -436,9 +436,9 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenDebuggingEnabledWhenCommandListIsInit
|
|||
commandList->destroy();
|
||||
}
|
||||
|
||||
HWTEST_F(L0DebuggerInternalUsageTest, givenPrintDebugMessagesSetToTrueWhenCommandListIsSynchronizedThenSbaAddressesAreNotPrinted) {
|
||||
HWTEST_F(L0DebuggerInternalUsageTest, givenDebuggerLogsDisabledWhenCommandListIsSynchronizedThenSbaAddressesAreNotPrinted) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::DebugManager.flags.PrintDebugMessages.set(0);
|
||||
NEO::DebugManager.flags.DebuggerLogBitmask.set(0);
|
||||
|
||||
EXPECT_NE(nullptr, device->getL0Debugger());
|
||||
testing::internal::CaptureStdout();
|
||||
|
|
|
@ -2081,7 +2081,7 @@ class MetricEnumerationTestMetricTypes : public MetricEnumerationTest,
|
|||
MetricEnumerationTestMetricTypes() {
|
||||
metricType = GetParam();
|
||||
}
|
||||
~MetricEnumerationTestMetricTypes() {}
|
||||
~MetricEnumerationTestMetricTypes() override {}
|
||||
};
|
||||
|
||||
TEST_P(MetricEnumerationTestMetricTypes, givenValidMetricTypesWhenSetAndGetIsSameThenReturnSuccess) {
|
||||
|
@ -2203,7 +2203,7 @@ class MetricEnumerationTestInformationTypes : public MetricEnumerationTest,
|
|||
validate[MetricsDiscovery::TInformationType::INFORMATION_TYPE_SAMPLE_PHASE] = ZET_METRIC_TYPE_RAW;
|
||||
validate[MetricsDiscovery::TInformationType::INFORMATION_TYPE_GPU_NODE] = ZET_METRIC_TYPE_RAW;
|
||||
}
|
||||
~MetricEnumerationTestInformationTypes() {}
|
||||
~MetricEnumerationTestInformationTypes() override {}
|
||||
};
|
||||
|
||||
TEST_P(MetricEnumerationTestInformationTypes, givenValidInformationTypesWhenSetAndGetIsSameThenReturnSuccess) {
|
||||
|
|
|
@ -133,6 +133,19 @@ class DebugSettingsManager {
|
|||
|
||||
extern DebugSettingsManager<globalDebugFunctionalityLevel> DebugManager;
|
||||
|
||||
#define PRINT_DEBUGGER_LOG(OUT, STR, ...) \
|
||||
NEO::printDebugString(true, OUT, STR, __VA_ARGS__);
|
||||
|
||||
#define PRINT_DEBUGGER_INFO_LOG(STR, ...) \
|
||||
if (NEO::DebugManager.flags.DebuggerLogBitmask.get() & NEO::DebugVariables::DEBUGGER_LOG_BITMASK::LOG_INFO) { \
|
||||
PRINT_DEBUGGER_LOG(stdout, "\nINFO: " STR, __VA_ARGS__) \
|
||||
}
|
||||
|
||||
#define PRINT_DEBUGGER_ERROR_LOG(STR, ...) \
|
||||
if (NEO::DebugManager.flags.DebuggerLogBitmask.get() & NEO::DebugVariables::DEBUGGER_LOG_BITMASK::LOG_ERROR) { \
|
||||
PRINT_DEBUGGER_LOG(stderr, "\nERROR: " STR, __VA_ARGS__) \
|
||||
}
|
||||
|
||||
template <DebugFunctionalityLevel DebugLevel>
|
||||
const char *DebugSettingsManager<DebugLevel>::settingsDumpFileName = "igdrcl_dumped.config";
|
||||
}; // namespace NEO
|
||||
|
|
|
@ -93,7 +93,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, GpuScratchRegWriteAfterWalker, -1, "-1: disabled
|
|||
DECLARE_DEBUG_VARIABLE(int32_t, GpuScratchRegWriteRegisterOffset, 0, "register offset for GPU scratch register write after walker")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, GpuScratchRegWriteRegisterData, 0, "register data for GPU scratch register write after walker")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, OverrideSlmAllocationSize, -1, "-1: default, >=0: program value for shared local memory size")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, DebuggerLogBitmask, 0, "0: logs disabled, != 0: see DebugVariables::DEBUGGER_LOG_BITMASK")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, DebuggerLogBitmask, 0, "0: logs disabled, 1 - INFO, 2 - ERROR, 1<<10 - Dump elf, see DebugVariables::DEBUGGER_LOG_BITMASK")
|
||||
|
||||
/*LOGGING FLAGS*/
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level")
|
||||
|
|
Loading…
Reference in New Issue