misc: Rename Debug namespace as debug

As part of recent decisions regarding namespace
naming conventions, all namespaces will be changed
to snake case.

gem5::Debug became gem5::debug.

Change-Id: Ic04606baab3317d2e58ab3ca9b37fc201c406ee8
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47305
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2021-06-08 14:39:58 -03:00
committed by Daniel Carvalho
parent 7ded9b414c
commit 5ff1fac819
53 changed files with 223 additions and 206 deletions

View File

@@ -1154,12 +1154,15 @@ def makeDebugFlagCC(target, source, env):
# file header
code('''
#include "base/compiler.hh" // For namespace deprecation
#include "base/debug.hh"
namespace gem5
{
namespace Debug {
GEM5_DEPRECATED_NAMESPACE(Debug, debug);
namespace debug
{
''')
@@ -1196,7 +1199,7 @@ namespace Debug {
code.append(comp_code)
code()
code('} // namespace Debug')
code('} // namespace debug')
code('} // namespace gem5')
code.write(str(target[0]))
@@ -1214,10 +1217,14 @@ def makeDebugFlagHH(target, source, env):
#ifndef __DEBUG_${name}_HH__
#define __DEBUG_${name}_HH__
#include "base/compiler.hh" // For namespace deprecation
namespace gem5
{
namespace Debug {
GEM5_DEPRECATED_NAMESPACE(Debug, debug);
namespace debug
{
''')
if compound:
@@ -1232,7 +1239,7 @@ namespace Debug {
code('extern SimpleFlag& $name;')
code('''
} // namespace Debug
} // namespace debug
} // namespace gem5
#endif // __DEBUG_${name}_HH__

View File

@@ -679,7 +679,7 @@ ArmKvmCPU::updateKvmStateCore()
setOneReg(ri->id, value);
}
if (Debug::KvmContext)
if (debug::KvmContext)
dumpKvmStateCore();
}
@@ -717,7 +717,7 @@ ArmKvmCPU::updateKvmStateMisc()
}
warned = true;
if (Debug::KvmContext)
if (debug::KvmContext)
dumpKvmStateMisc();
}
@@ -823,7 +823,7 @@ ArmKvmCPU::updateTCStateCore()
pc.set(getOneRegU32(REG_CORE32(usr_regs.ARM_pc)));
tc->pcState(pc);
if (Debug::KvmContext)
if (debug::KvmContext)
dumpKvmStateCore();
}
@@ -856,7 +856,7 @@ ArmKvmCPU::updateTCStateMisc()
warned = true;
if (Debug::KvmContext)
if (debug::KvmContext)
dumpKvmStateMisc();
}

View File

@@ -170,7 +170,7 @@ RiscvProcess::argsInit(int pageSize)
memState->setStackMin(memState->getStackMin() - (arg.size() + 1));
initVirtMem->writeString(memState->getStackMin(), arg.c_str());
argPointers.push_back(memState->getStackMin());
if (Debug::Stack) {
if (debug::Stack) {
std::string wrote;
initVirtMem->readString(wrote, argPointers.back());
DPRINTFN("Wrote arg \"%s\" to address %p\n",

View File

@@ -52,7 +52,9 @@
namespace gem5
{
namespace Debug {
GEM5_DEPRECATED_NAMESPACE(Debug, debug);
namespace debug
{
//
// This function will cause the process to signal itself with a
@@ -65,7 +67,7 @@ breakpoint()
#ifndef NDEBUG
kill(getpid(), SIGTRAP);
#else
cprintf("Debug::breakpoint suppressed, compiled with NDEBUG\n");
cprintf("debug::breakpoint suppressed, compiled with NDEBUG\n");
#endif
}
@@ -154,25 +156,25 @@ changeFlag(const char *s, bool value)
return true;
}
} // namespace Debug
} // namespace debug
// add a set of functions that can easily be invoked from gdb
void
setDebugFlag(const char *string)
{
Debug::changeFlag(string, true);
debug::changeFlag(string, true);
}
void
clearDebugFlag(const char *string)
{
Debug::changeFlag(string, false);
debug::changeFlag(string, false);
}
void
dumpDebugFlags(std::ostream &os)
{
using namespace Debug;
using namespace debug;
FlagsMap::iterator i = allFlags().begin();
FlagsMap::iterator end = allFlags().end();
for (; i != end; ++i) {

View File

@@ -48,10 +48,14 @@
#include <string>
#include <vector>
#include "base/compiler.hh"
namespace gem5
{
namespace Debug {
GEM5_DEPRECATED_NAMESPACE(Debug, debug);
namespace debug
{
void breakpoint();
@@ -139,7 +143,7 @@ Flag *findFlag(const std::string &name);
bool changeFlag(const char *s, bool value);
} // namespace Debug
} // namespace debug
void setDebugFlag(const char *string);
@@ -153,8 +157,8 @@ void dumpDebugFlags(std::ostream &os=std::cout);
* @ingroup api_trace
* @{
*/
#define DTRACE(x) GEM5_DEPRECATED_MACRO(DTRACE, Debug::x, \
"Replace DTRACE(x) with Debug::x.")
#define DTRACE(x) GEM5_DEPRECATED_MACRO(DTRACE, debug::x, \
"Replace DTRACE(x) with debug::x.")
/** @} */ // end of api_trace
} // namespace gem5

View File

@@ -36,15 +36,15 @@ using namespace gem5;
/** Test assignment of names and descriptions. */
TEST(DebugFlagTest, NameDesc)
{
Debug::SimpleFlag flag_a("FlagNameDescTestKidA", "Kid A");
debug::SimpleFlag flag_a("FlagNameDescTestKidA", "Kid A");
EXPECT_EQ("FlagNameDescTestKidA", flag_a.name());
EXPECT_EQ("Kid A", flag_a.desc());
Debug::SimpleFlag flag_b("FlagNameDescTestKidB", "Kid B");
debug::SimpleFlag flag_b("FlagNameDescTestKidB", "Kid B");
EXPECT_EQ("FlagNameDescTestKidB", flag_b.name());
EXPECT_EQ("Kid B", flag_b.desc());
Debug::CompoundFlag compound_flag("FlagNameDescTest", "Compound Flag",
debug::CompoundFlag compound_flag("FlagNameDescTest", "Compound Flag",
{&flag_a, &flag_b});
EXPECT_EQ("FlagNameDescTest", compound_flag.name());
EXPECT_EQ("Compound Flag", compound_flag.desc());
@@ -53,9 +53,9 @@ TEST(DebugFlagTest, NameDesc)
/** Test that names are unique. */
TEST(DebugFlagDeathTest, UniqueNames)
{
Debug::SimpleFlag flag("FlagUniqueNamesTest", "A");
debug::SimpleFlag flag("FlagUniqueNamesTest", "A");
gtestLogOutput.str("");
EXPECT_ANY_THROW(Debug::SimpleFlag("FlagUniqueNamesTest", "B"));
EXPECT_ANY_THROW(debug::SimpleFlag("FlagUniqueNamesTest", "B"));
const std::string expected = "panic: panic condition !result.second "
"occurred: Flag FlagUniqueNamesTest already defined!\n";
std::string actual = gtestLogOutput.str();
@@ -65,19 +65,19 @@ TEST(DebugFlagDeathTest, UniqueNames)
/** Test format attribute. */
TEST(DebugFlagTest, IsFormat)
{
Debug::SimpleFlag flag_a("FlagIsFormatTestA", "", true);
debug::SimpleFlag flag_a("FlagIsFormatTestA", "", true);
EXPECT_TRUE(flag_a.isFormat());
Debug::SimpleFlag flag_b("FlagIsFormatTestB", "", false);
debug::SimpleFlag flag_b("FlagIsFormatTestB", "", false);
EXPECT_FALSE(flag_b.isFormat());
Debug::SimpleFlag flag_c("FlagIsFormatTestC", "");
debug::SimpleFlag flag_c("FlagIsFormatTestC", "");
EXPECT_FALSE(flag_c.isFormat());
}
/** Test enabling and disabling simple flags, as well as the global enabler. */
TEST(DebugSimpleFlagTest, Enabled)
{
Debug::Flag::globalDisable();
Debug::SimpleFlag flag("SimpleFlagEnabledTest", "");
debug::Flag::globalDisable();
debug::SimpleFlag flag("SimpleFlagEnabledTest", "");
// By default flags are initialized disabled
ASSERT_FALSE(flag.tracing());
@@ -85,13 +85,13 @@ TEST(DebugSimpleFlagTest, Enabled)
// Flags must be globally enabled before individual flags are enabled
flag.enable();
ASSERT_FALSE(flag.tracing());
Debug::Flag::globalEnable();
debug::Flag::globalEnable();
ASSERT_TRUE(!TRACING_ON || flag.tracing());
// Verify that the global enabler works
Debug::Flag::globalDisable();
debug::Flag::globalDisable();
ASSERT_FALSE(flag.tracing());
Debug::Flag::globalEnable();
debug::Flag::globalEnable();
ASSERT_TRUE(!TRACING_ON || flag.tracing());
// Test disabling the flag with global enabled
@@ -105,10 +105,10 @@ TEST(DebugSimpleFlagTest, Enabled)
*/
TEST(DebugCompoundFlagTest, Enabled)
{
Debug::Flag::globalDisable();
Debug::SimpleFlag flag_a("CompoundFlagEnabledTestKidA", "");
Debug::SimpleFlag flag_b("CompoundFlagEnabledTestKidB", "");
Debug::CompoundFlag flag("CompoundFlagEnabledTest", "",
debug::Flag::globalDisable();
debug::SimpleFlag flag_a("CompoundFlagEnabledTestKidA", "");
debug::SimpleFlag flag_b("CompoundFlagEnabledTestKidB", "");
debug::CompoundFlag flag("CompoundFlagEnabledTest", "",
{&flag_a, &flag_b});
// By default flags are initialized disabled
@@ -119,7 +119,7 @@ TEST(DebugCompoundFlagTest, Enabled)
ASSERT_FALSE(flag_a.tracing());
ASSERT_FALSE(flag_b.tracing());
ASSERT_FALSE(flag.tracing());
Debug::Flag::globalEnable();
debug::Flag::globalEnable();
for (auto &kid : flag.kids()) {
ASSERT_TRUE(!TRACING_ON || kid->tracing());
}
@@ -139,8 +139,8 @@ TEST(DebugCompoundFlagTest, Enabled)
/** Test that the conversion operator matches the enablement status. */
TEST(DebugFlagTest, ConversionOperator)
{
Debug::Flag::globalEnable();
Debug::SimpleFlag flag("FlagConversionOperatorTest", "");
debug::Flag::globalEnable();
debug::SimpleFlag flag("FlagConversionOperatorTest", "");
ASSERT_EQ(flag, flag.tracing());
flag.enable();
@@ -154,10 +154,10 @@ TEST(DebugFlagTest, ConversionOperator)
*/
TEST(DebugCompoundFlagTest, EnabledKids)
{
Debug::Flag::globalEnable();
Debug::SimpleFlag flag_a("CompoundFlagEnabledKidsTestKidA", "");
Debug::SimpleFlag flag_b("CompoundFlagEnabledKidsTestKidB", "");
Debug::CompoundFlag flag("CompoundFlagEnabledKidsTest", "",
debug::Flag::globalEnable();
debug::SimpleFlag flag_a("CompoundFlagEnabledKidsTestKidA", "");
debug::SimpleFlag flag_b("CompoundFlagEnabledKidsTestKidB", "");
debug::CompoundFlag flag("CompoundFlagEnabledKidsTest", "",
{&flag_a, &flag_b});
// Test enabling only flag A
@@ -187,58 +187,58 @@ TEST(DebugCompoundFlagTest, EnabledKids)
/** Search for existent and non-existent flags. */
TEST(DebugFlagTest, FindFlag)
{
Debug::Flag::globalEnable();
Debug::SimpleFlag flag_a("FlagFindFlagTestA", "");
Debug::SimpleFlag flag_b("FlagFindFlagTestB", "");
debug::Flag::globalEnable();
debug::SimpleFlag flag_a("FlagFindFlagTestA", "");
debug::SimpleFlag flag_b("FlagFindFlagTestB", "");
// Enable the found flags and verify that the original flags are
// enabled too
Debug::Flag *flag;
EXPECT_TRUE(flag = Debug::findFlag("FlagFindFlagTestA"));
debug::Flag *flag;
EXPECT_TRUE(flag = debug::findFlag("FlagFindFlagTestA"));
ASSERT_FALSE(flag_a.tracing());
flag->enable();
ASSERT_TRUE(!TRACING_ON || flag_a.tracing());
EXPECT_TRUE(flag = Debug::findFlag("FlagFindFlagTestB"));
EXPECT_TRUE(flag = debug::findFlag("FlagFindFlagTestB"));
ASSERT_FALSE(flag_b.tracing());
flag->enable();
ASSERT_TRUE(!TRACING_ON || flag_b.tracing());
// Search for a non-existent flag
EXPECT_FALSE(Debug::findFlag("FlagFindFlagTestC"));
EXPECT_FALSE(debug::findFlag("FlagFindFlagTestC"));
}
/** Test changing flag enabled. */
TEST(DebugFlagTest, ChangeFlag)
{
Debug::Flag::globalEnable();
Debug::SimpleFlag flag_a("FlagChangeFlagTestA", "");
Debug::SimpleFlag flag_b("FlagChangeFlagTestB", "");
debug::Flag::globalEnable();
debug::SimpleFlag flag_a("FlagChangeFlagTestA", "");
debug::SimpleFlag flag_b("FlagChangeFlagTestB", "");
// Enable the found flags and verify that the original flags are
// enabled too
ASSERT_FALSE(flag_a.tracing());
EXPECT_TRUE(Debug::changeFlag("FlagChangeFlagTestA", true));
EXPECT_TRUE(debug::changeFlag("FlagChangeFlagTestA", true));
ASSERT_TRUE(!TRACING_ON || flag_a.tracing());
EXPECT_TRUE(Debug::changeFlag("FlagChangeFlagTestA", false));
EXPECT_TRUE(debug::changeFlag("FlagChangeFlagTestA", false));
ASSERT_FALSE(flag_a.tracing());
// Disable and enable a flag
ASSERT_FALSE(flag_b.tracing());
EXPECT_TRUE(Debug::changeFlag("FlagChangeFlagTestB", false));
EXPECT_TRUE(debug::changeFlag("FlagChangeFlagTestB", false));
ASSERT_FALSE(flag_b.tracing());
EXPECT_TRUE(Debug::changeFlag("FlagChangeFlagTestB", true));
EXPECT_TRUE(debug::changeFlag("FlagChangeFlagTestB", true));
ASSERT_TRUE(!TRACING_ON || flag_b.tracing());
// Change a non-existent flag
ASSERT_FALSE(Debug::changeFlag("FlagChangeFlagTestC", true));
ASSERT_FALSE(debug::changeFlag("FlagChangeFlagTestC", true));
}
/** Test changing flag enabled with aux functions. */
TEST(DebugFlagTest, SetClearDebugFlag)
{
Debug::Flag::globalEnable();
Debug::SimpleFlag flag_a("FlagSetClearDebugFlagTestA", "");
Debug::SimpleFlag flag_b("FlagSetClearDebugFlagTestB", "");
debug::Flag::globalEnable();
debug::SimpleFlag flag_a("FlagSetClearDebugFlagTestA", "");
debug::SimpleFlag flag_b("FlagSetClearDebugFlagTestB", "");
// Enable and disable a flag
ASSERT_FALSE(flag_a.tracing());
@@ -262,8 +262,8 @@ TEST(DebugFlagTest, SetClearDebugFlag)
/** Test dumping no enabled debug flags. */
TEST(DebugFlagTest, NoDumpDebugFlags)
{
Debug::Flag::globalEnable();
Debug::SimpleFlag flag("FlagDumpDebugFlagTest", "");
debug::Flag::globalEnable();
debug::SimpleFlag flag("FlagDumpDebugFlagTest", "");
// Verify that the names of the enabled flags are printed
gtestLogOutput.str("");
@@ -276,15 +276,15 @@ TEST(DebugFlagTest, NoDumpDebugFlags)
/** Test dumping enabled debug flags with a larger set of flags. */
TEST(DebugFlagTest, DumpDebugFlags)
{
Debug::Flag::globalEnable();
Debug::SimpleFlag flag_a("FlagDumpDebugFlagTestA", "");
Debug::SimpleFlag flag_b("FlagDumpDebugFlagTestB", "");
Debug::SimpleFlag flag_c("FlagDumpDebugFlagTestC", "");
Debug::SimpleFlag flag_d("FlagDumpDebugFlagTestD", "");
Debug::SimpleFlag flag_e("FlagDumpDebugFlagTestE", "");
Debug::CompoundFlag compound_flag_a("CompoundFlagDumpDebugFlagTestA", "",
debug::Flag::globalEnable();
debug::SimpleFlag flag_a("FlagDumpDebugFlagTestA", "");
debug::SimpleFlag flag_b("FlagDumpDebugFlagTestB", "");
debug::SimpleFlag flag_c("FlagDumpDebugFlagTestC", "");
debug::SimpleFlag flag_d("FlagDumpDebugFlagTestD", "");
debug::SimpleFlag flag_e("FlagDumpDebugFlagTestE", "");
debug::CompoundFlag compound_flag_a("CompoundFlagDumpDebugFlagTestA", "",
{&flag_d});
Debug::CompoundFlag compound_flag_b("CompoundFlagDumpDebugFlagTestB", "",
debug::CompoundFlag compound_flag_b("CompoundFlagDumpDebugFlagTestB", "",
{&flag_e});
// Enable a few flags

View File

@@ -691,8 +691,8 @@ BaseRemoteGDB::read(Addr vaddr, size_t size, char *data)
proxy.readBlob(vaddr, data, size);
#if TRACING_ON
if (Debug::GDBRead) {
if (Debug::GDBExtra) {
if (debug::GDBRead) {
if (debug::GDBExtra) {
char buf[1024];
mem2hex(buf, data, size);
DPRINTFNR(": %s\n", buf);
@@ -708,9 +708,9 @@ BaseRemoteGDB::read(Addr vaddr, size_t size, char *data)
bool
BaseRemoteGDB::write(Addr vaddr, size_t size, const char *data)
{
if (Debug::GDBWrite) {
if (debug::GDBWrite) {
DPRINTFN("write: addr=%#x, size=%d", vaddr, size);
if (Debug::GDBExtra) {
if (debug::GDBExtra) {
char buf[1024];
mem2hex(buf, data, size);
DPRINTFNR(": %s\n", buf);

View File

@@ -72,7 +72,7 @@ Group::regStats()
g->regStats();
for (auto &g : statGroups) {
if (Debug::Stats) {
if (debug::Stats) {
M5_VAR_USED const Named *named = dynamic_cast<const Named *>(this);
DPRINTF(Stats, "%s: regStats in group %s\n",
named ? named->name() : "?",

View File

@@ -75,7 +75,7 @@ Info::Info()
{
id = id_count++;
if (debug_break_id >= 0 and debug_break_id == id)
Debug::breakpoint();
debug::breakpoint();
}
Info::~Info()

View File

@@ -93,13 +93,13 @@ setDebugLogger(Logger *logger)
void
enable()
{
Debug::Flag::globalEnable();
debug::Flag::globalEnable();
}
void
disable()
{
Debug::Flag::globalDisable();
debug::Flag::globalDisable();
}
ObjectMatch ignore;
@@ -152,10 +152,10 @@ OstreamLogger::logMessage(Tick when, const std::string &name,
if (!name.empty() && ignore.match(name))
return;
if (!Debug::FmtTicksOff && (when != MaxTick))
if (!debug::FmtTicksOff && (when != MaxTick))
ccprintf(stream, "%7d: ", when);
if (Debug::FmtFlag && !flag.empty())
if (debug::FmtFlag && !flag.empty())
stream << flag << ": ";
if (!name.empty())
@@ -164,7 +164,7 @@ OstreamLogger::logMessage(Tick when, const std::string &name,
stream << message;
stream.flush();
if (Debug::FmtStackTrace) {
if (debug::FmtStackTrace) {
print_backtrace();
STATIC_ERR("\n");
}

View File

@@ -158,10 +158,10 @@ struct StringWrap
* If you desire that the automatic printing not occur, use DPRINTFR
* (R for raw)
*
* With DPRINTFV it is possible to pass a Debug::SimpleFlag variable
* With DPRINTFV it is possible to pass a debug::SimpleFlag variable
* as first argument. Example:
*
* Debug::Flag some_flag = Debug::DMA;
* debug::Flag some_flag = debug::DMA;
* DPRINTFV(some_flag, ...);
*
* \def DDUMP(x, data, count)
@@ -178,27 +178,27 @@ struct StringWrap
*/
#define DDUMP(x, data, count) do { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::Debug::x)) \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) \
::gem5::Trace::getDebugLogger()->dump( \
::gem5::curTick(), name(), data, count, #x); \
} while (0)
#define DPRINTF(x, ...) do { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::Debug::x)) { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
::gem5::Trace::getDebugLogger()->dprintf_flag( \
::gem5::curTick(), name(), #x, __VA_ARGS__); \
} \
} while (0)
#define DPRINTFS(x, s, ...) do { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::Debug::x)) { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
::gem5::Trace::getDebugLogger()->dprintf_flag( \
::gem5::curTick(), (s)->name(), #x, __VA_ARGS__); \
} \
} while (0)
#define DPRINTFR(x, ...) do { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::Debug::x)) { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
::gem5::Trace::getDebugLogger()->dprintf_flag( \
(::gem5::Tick)-1, std::string(), #x, __VA_ARGS__); \
} \

View File

@@ -50,11 +50,12 @@ GTestTickHandler tickHandler;
namespace gem5
{
namespace Debug {
namespace debug
{
/** Debug flag used for the tests in this file. */
SimpleFlag TraceTestDebugFlag("TraceTestDebugFlag",
"Exclusive debug flag for the trace tests");
}
} // namespace debug
} // namespace gem5
/** @return The ostream as a std::string. */
@@ -127,7 +128,7 @@ TEST(TraceTest, LogMessageTickDisabledAndEnableDisable)
ASSERT_EQ(getString(&logger), " 100: Foo: Test message");
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("FmtTicksOff", true));
EXPECT_TRUE(debug::changeFlag("FmtTicksOff", true));
logger.logMessage(Tick(200), "Foo", "", "Test message");
#if TRACING_ON
@@ -136,7 +137,7 @@ TEST(TraceTest, LogMessageTickDisabledAndEnableDisable)
ASSERT_EQ(getString(&logger), " 200: Foo: Test message");
#endif
Debug::changeFlag("FmtTicksOff", false);
debug::changeFlag("FmtTicksOff", false);
Trace::disable();
logger.logMessage(Tick(300), "Foo", "", "Test message");
@@ -152,7 +153,7 @@ TEST(TraceTest, LogMessageFlagEnabled)
std::stringstream ss;
Trace::OstreamLogger logger(ss);
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
logger.logMessage(Tick(100), "Foo", "Bar", "Test message");
#if TRACING_ON
@@ -161,7 +162,7 @@ TEST(TraceTest, LogMessageFlagEnabled)
ASSERT_EQ(getString(&logger), " 100: Foo: Test message");
#endif
Debug::changeFlag("FmtFlag", false);
debug::changeFlag("FmtFlag", false);
Trace::disable();
}
@@ -246,7 +247,7 @@ TEST(TraceTest, DumpSimple)
Trace::OstreamLogger logger(ss);
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
std::string message = "Test message";
logger.dump(Tick(100), "Foo", message.c_str(), message.size(), "Bar");
#if TRACING_ON
@@ -270,7 +271,7 @@ TEST(TraceTest, DumpSimple)
// 1 space + 12 chars + \n
" Test message\n");
#endif
Debug::changeFlag("FmtFlag", false);
debug::changeFlag("FmtFlag", false);
Trace::disable();
}
@@ -383,14 +384,14 @@ TEST(TraceTest, DprintfFlagEnabled)
Trace::OstreamLogger logger(ss);
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
logger.dprintf_flag(Tick(100), "Foo", "Bar", "Test %s", "message");
#if TRACING_ON
ASSERT_EQ(getString(&logger), " 100: Bar: Foo: Test message");
#else
ASSERT_EQ(getString(&logger), " 100: Foo: Test message");
#endif
Debug::changeFlag("FmtFlag", false);
debug::changeFlag("FmtFlag", false);
Trace::disable();
}
@@ -413,10 +414,10 @@ TEST(TraceTest, DprintfEnabled)
Trace::OstreamLogger logger(ss);
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
logger.dprintf(Tick(100), "Foo", "Test %s", "message");
ASSERT_EQ(getString(&logger), " 100: Foo: Test message");
Debug::changeFlag("FmtFlag", false);
debug::changeFlag("FmtFlag", false);
Trace::disable();
}
@@ -442,8 +443,8 @@ TEST(TraceTest, MacroDDUMP)
// Flag enabled
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
DDUMP(TraceTestDebugFlag, message.c_str(), message.size());
#if TRACING_ON
ASSERT_EQ(getString(Trace::output()),
@@ -455,7 +456,7 @@ TEST(TraceTest, MacroDDUMP)
// Flag disabled
Trace::disable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", false));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", false));
DDUMP(TraceTestDebugFlag, message.c_str(), message.size());
ASSERT_EQ(getString(Trace::output()), "");
}
@@ -467,8 +468,8 @@ TEST(TraceTest, MacroDPRINTF)
// Flag enabled
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
DPRINTF(TraceTestDebugFlag, "Test message");
#if TRACING_ON
ASSERT_EQ(getString(Trace::output()),
@@ -479,7 +480,7 @@ TEST(TraceTest, MacroDPRINTF)
// Flag disabled
Trace::disable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", false));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", false));
DPRINTF(TraceTestDebugFlag, "Test message");
ASSERT_EQ(getString(Trace::output()), "");
}
@@ -494,8 +495,8 @@ TEST(TraceTest, MacroDPRINTFS)
// Flag enabled
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
#if TRACING_ON
DPRINTFS(TraceTestDebugFlag, named_ptr, "Test message");
ASSERT_EQ(getString(Trace::output()),
@@ -504,7 +505,7 @@ TEST(TraceTest, MacroDPRINTFS)
// Flag disabled
Trace::disable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", false));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", false));
#if TRACING_ON
DPRINTFS(TraceTestDebugFlag, named_ptr, "Test message");
ASSERT_EQ(getString(Trace::output()), "");
@@ -516,8 +517,8 @@ TEST(TraceTest, MacroDPRINTFR)
{
// Flag enabled
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
DPRINTFR(TraceTestDebugFlag, "Test message");
#if TRACING_ON
ASSERT_EQ(getString(Trace::output()), "TraceTestDebugFlag: Test message");
@@ -527,7 +528,7 @@ TEST(TraceTest, MacroDPRINTFR)
// Flag disabled
Trace::disable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", false));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", false));
DPRINTFR(TraceTestDebugFlag, "Test message");
ASSERT_EQ(getString(Trace::output()), "");
}
@@ -562,8 +563,8 @@ TEST(TraceTest, MacroDPRINTF_UNCONDITIONAL)
// Flag enabled
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
DPRINTF_UNCONDITIONAL(TraceTestDebugFlag, "Test message");
#if TRACING_ON
ASSERT_EQ(getString(Trace::output()),
@@ -574,7 +575,7 @@ TEST(TraceTest, MacroDPRINTF_UNCONDITIONAL)
// Flag disabled
Trace::disable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", false));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", false));
DPRINTF_UNCONDITIONAL(TraceTestDebugFlag, "Test message");
#if TRACING_ON
ASSERT_EQ(getString(Trace::output()), " 0: Foo: Test message");
@@ -591,8 +592,8 @@ TEST(TraceTest, GlobalName)
{
// Flag enabled
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(debug::changeFlag("FmtFlag", true));
DPRINTF(TraceTestDebugFlag, "Test message");
#if TRACING_ON
ASSERT_EQ(getString(Trace::output()),
@@ -603,7 +604,7 @@ TEST(TraceTest, GlobalName)
// Flag disabled
Trace::disable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", false));
EXPECT_TRUE(debug::changeFlag("TraceTestDebugFlag", false));
DPRINTF(TraceTestDebugFlag, "Test message");
ASSERT_EQ(getString(Trace::output()), "");
}

View File

@@ -583,7 +583,7 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU)
/* This code no longer works since the zero register (e.g.,
* r31 on Alpha) doesn't necessarily contain zero at this
* point.
if (Debug::Context)
if (debug::Context)
ThreadContext::compare(oldTC, newTC);
*/

View File

@@ -63,23 +63,23 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
std::stringstream outs;
const bool in_user_mode = thread->getIsaPtr()->inUserMode();
if (in_user_mode && !Debug::ExecUser)
if (in_user_mode && !debug::ExecUser)
return;
if (!in_user_mode && !Debug::ExecKernel)
if (!in_user_mode && !debug::ExecKernel)
return;
if (Debug::ExecAsid) {
if (debug::ExecAsid) {
outs << "A" << std::dec <<
thread->getIsaPtr()->getExecutingAsid() << " ";
}
if (Debug::ExecThread)
if (debug::ExecThread)
outs << "T" << thread->threadId() << " : ";
Addr cur_pc = pc.instAddr();
loader::SymbolTable::const_iterator it;
ccprintf(outs, "%#x", cur_pc);
if (Debug::ExecSymbol && (!FullSystem || !in_user_mode) &&
if (debug::ExecSymbol && (!FullSystem || !in_user_mode) &&
(it = loader::debugSymbolTable.findNearest(cur_pc)) !=
loader::debugSymbolTable.end()) {
Addr delta = cur_pc - it->address;
@@ -107,15 +107,15 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
if (ran) {
outs << " : ";
if (Debug::ExecOpClass) {
if (debug::ExecOpClass) {
outs << enums::OpClassStrings[inst->opClass()] << " : ";
}
if (Debug::ExecResult && !predicate) {
if (debug::ExecResult && !predicate) {
outs << "Predicated False";
}
if (Debug::ExecResult && data_status != DataInvalid) {
if (debug::ExecResult && data_status != DataInvalid) {
switch (data_status) {
case DataVec:
ccprintf(outs, " D=%s", *data.as_vec);
@@ -129,16 +129,16 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
}
}
if (Debug::ExecEffAddr && getMemValid())
if (debug::ExecEffAddr && getMemValid())
outs << " A=0x" << std::hex << addr;
if (Debug::ExecFetchSeq && fetch_seq_valid)
if (debug::ExecFetchSeq && fetch_seq_valid)
outs << " FetchSeq=" << std::dec << fetch_seq;
if (Debug::ExecCPSeq && cp_seq_valid)
if (debug::ExecCPSeq && cp_seq_valid)
outs << " CPSeq=" << std::dec << cp_seq;
if (Debug::ExecFlags) {
if (debug::ExecFlags) {
outs << " flags=(";
inst->printFlags(outs, "|");
outs << ")";
@@ -166,14 +166,14 @@ Trace::ExeTracerRecord::dump()
* finishes. Macroops then behave like regular instructions and don't
* complete/print when they fault.
*/
if (Debug::ExecMacro && staticInst->isMicroop() &&
((Debug::ExecMicro &&
if (debug::ExecMacro && staticInst->isMicroop() &&
((debug::ExecMicro &&
macroStaticInst && staticInst->isFirstMicroop()) ||
(!Debug::ExecMicro &&
(!debug::ExecMicro &&
macroStaticInst && staticInst->isLastMicroop()))) {
traceInst(macroStaticInst, false);
}
if (Debug::ExecMicro || !staticInst->isMicroop()) {
if (debug::ExecMicro || !staticInst->isMicroop()) {
traceInst(staticInst, true);
}
}

View File

@@ -71,7 +71,7 @@ class ExeTracer : public InstTracer
const StaticInstPtr staticInst, TheISA::PCState pc,
const StaticInstPtr macroStaticInst = NULL)
{
if (!Debug::ExecEnable)
if (!debug::ExecEnable)
return NULL;
return new ExeTracerRecord(when, tc,

View File

@@ -124,7 +124,7 @@ InstPBTrace::getInstRecord(Tick when, ThreadContext *tc, const StaticInstPtr si,
TheISA::PCState pc, const StaticInstPtr mi)
{
// Only record the trace if Exec debugging is enabled
if (!Debug::ExecEnable)
if (!debug::ExecEnable)
return NULL;
return new InstPBTraceRecord(*this, when, tc, si, pc, mi);

View File

@@ -68,7 +68,7 @@ class IntelTrace : public InstTracer
const StaticInstPtr staticInst, TheISA::PCState pc,
const StaticInstPtr macroStaticInst = NULL)
{
if (!Debug::ExecEnable)
if (!debug::ExecEnable)
return NULL;
return new IntelTraceRecord(when, tc, staticInst, pc, macroStaticInst);

View File

@@ -288,7 +288,7 @@ BaseKvmCPU::StatGroup::StatGroup(statistics::Group *parent)
void
BaseKvmCPU::serializeThread(CheckpointOut &cp, ThreadID tid) const
{
if (Debug::Checkpoint) {
if (debug::Checkpoint) {
DPRINTF(Checkpoint, "KVM: Serializing thread %i:\n", tid);
dump();
}

View File

@@ -687,7 +687,7 @@ X86KvmCPU::updateKvmState()
updateKvmStateMSRs();
DPRINTF(KvmContext, "X86KvmCPU::updateKvmState():\n");
if (Debug::KvmContext)
if (debug::KvmContext)
dump();
}
@@ -951,7 +951,7 @@ X86KvmCPU::updateThreadContext()
getSpecialRegisters(sregs);
DPRINTF(KvmContext, "X86KvmCPU::updateThreadContext():\n");
if (Debug::KvmContext)
if (debug::KvmContext)
dump();
updateThreadContextRegs(regs, sregs);

View File

@@ -783,7 +783,7 @@ Execute::issue(ThreadID thread_id)
if (issued) {
/* Generate MinorTrace's MinorInst lines. Do this at commit
* to allow better instruction annotation? */
if (Debug::MinorTrace && !inst->isBubble()) {
if (debug::MinorTrace && !inst->isBubble()) {
inst->minorTraceInst(*this,
cpu.threads[0]->getIsaPtr()->regClasses());
}
@@ -989,7 +989,7 @@ Execute::commitInst(MinorDynInstPtr inst, bool early_memory_issue,
if (fault != NoFault) {
if (inst->traceData) {
if (Debug::ExecFaulting) {
if (debug::ExecFaulting) {
inst->traceData->setFaulting(true);
} else {
delete inst->traceData;
@@ -1393,7 +1393,7 @@ Execute::commit(ThreadID thread_id, bool only_commit_microops, bool discard,
/* Don't show no cost instructions as having taken a commit
* slot */
if (Debug::MinorTrace && !is_no_cost_inst)
if (debug::MinorTrace && !is_no_cost_inst)
ex_info.instsBeingCommitted.insts[num_insts_committed] = inst;
if (!is_no_cost_inst)

View File

@@ -258,7 +258,7 @@ Fetch1::handleTLBResponse(FetchRequestPtr response)
response->request->getPaddr() : 0),
response->request->getVaddr());
if (Debug::MinorTrace)
if (debug::MinorTrace)
minorTraceResponseLine(name(), response);
} else {
DPRINTF(Fetch, "Got ITLB response\n");
@@ -427,7 +427,7 @@ Fetch1::recvTimingResp(PacketPtr response)
numFetchesInMemorySystem--;
fetch_request->state = FetchRequest::Complete;
if (Debug::MinorTrace)
if (debug::MinorTrace)
minorTraceResponseLine(name(), fetch_request);
if (response->isError()) {

View File

@@ -491,7 +491,7 @@ Fetch2::evaluate()
/* Output MinorTrace instruction info for
* pre-microop decomposition macroops */
if (Debug::MinorTrace && !dyn_inst->isFault() &&
if (debug::MinorTrace && !dyn_inst->isFault() &&
dyn_inst->staticInst->isMacroop())
{
dyn_inst->minorTraceInst(*this,

View File

@@ -109,7 +109,7 @@ FUPipeline::FUPipeline(const std::string &name, const MinorFU &description_,
for (unsigned int i = 0; i < description.timings.size(); i++) {
MinorFUTiming &timing = *(description.timings[i]);
if (Debug::MinorTiming) {
if (debug::MinorTiming) {
std::ostringstream lats;
unsigned int num_lats = timing.srcRegsRelativeLats.size();

View File

@@ -136,7 +136,7 @@ Pipeline::evaluate()
fetch2.evaluate();
fetch1.evaluate();
if (Debug::MinorTrace)
if (debug::MinorTrace)
minorTrace();
/* Update the time buffers after the stages */

View File

@@ -264,7 +264,7 @@ Scoreboard::canInstIssue(MinorDynInstPtr inst,
src_index++;
}
if (Debug::MinorTiming) {
if (debug::MinorTiming) {
if (ret && num_srcs > num_relative_latencies &&
num_relative_latencies != 0)
{

View File

@@ -1264,7 +1264,7 @@ Commit::commitHead(const DynInstPtr &head_inst, unsigned inst_num)
if (head_inst->traceData) {
// We ignore ReExecution "faults" here as they are not real
// (architectural) faults but signal flush/replays.
if (Debug::ExecFaulting
if (debug::ExecFaulting
&& dynamic_cast<ReExec*>(inst_fault.get()) == nullptr) {
head_inst->traceData->setFaulting(true);
@@ -1314,7 +1314,7 @@ Commit::commitHead(const DynInstPtr &head_inst, unsigned inst_num)
rob->retireHead(tid);
#if TRACING_ON
if (Debug::O3PipeView) {
if (debug::O3PipeView) {
head_inst->commitTick = curTick() - head_inst->fetchTick;
}
#endif

View File

@@ -688,7 +688,7 @@ Decode::decodeInsts(ThreadID tid)
--insts_available;
#if TRACING_ON
if (Debug::O3PipeView) {
if (debug::O3PipeView) {
inst->decodeTick = curTick() - inst->fetchTick;
}
#endif

View File

@@ -98,7 +98,7 @@ DynInst::DynInst(const StaticInstPtr &_staticInst,
DynInst::~DynInst()
{
#if TRACING_ON
if (Debug::O3PipeView) {
if (debug::O3PipeView) {
Tick fetch = this->fetchTick;
// fetchTick can be -1 if the instruction fetched outside the trace
// window.

View File

@@ -1277,7 +1277,7 @@ Fetch::fetch(bool &status_change)
numInst++;
#if TRACING_ON
if (Debug::O3PipeView) {
if (debug::O3PipeView) {
instruction->fetchTick = curTick();
}
#endif

View File

@@ -1566,7 +1566,7 @@ IEW::updateExeInstStats(const DynInstPtr& inst)
iewStats.executedInstStats.numInsts++;
#if TRACING_ON
if (Debug::O3PipeView) {
if (debug::O3PipeView) {
inst->completeTick = curTick() - inst->fetchTick;
}
#endif

View File

@@ -1181,7 +1181,7 @@ LSQUnit::completeStore(typename StoreQueue::iterator store_idx)
store_inst->seqNum, store_idx.idx() - 1, storeQueue.head() - 1);
#if TRACING_ON
if (Debug::O3PipeView) {
if (debug::O3PipeView) {
store_inst->storeTick =
curTick() - store_inst->fetchTick;
}

View File

@@ -164,7 +164,7 @@ MemDepUnit::insertBarrierSN(const DynInstPtr &barr_inst)
if (barr_inst->isWriteBarrier() || barr_inst->isHtmCmd())
storeBarrierSNs.insert(barr_sn);
if (Debug::MemDepUnit) {
if (debug::MemDepUnit) {
const char *barrier_type = nullptr;
if (barr_inst->isReadBarrier() && barr_inst->isWriteBarrier())
barrier_type = "memory";
@@ -439,7 +439,7 @@ MemDepUnit::completeInst(const DynInstPtr &inst)
assert(hasLoadBarrier());
loadBarrierSNs.erase(barr_sn);
}
if (Debug::MemDepUnit) {
if (debug::MemDepUnit) {
const char *barrier_type = nullptr;
if (inst->isWriteBarrier() && inst->isReadBarrier())
barrier_type = "Memory";

View File

@@ -798,7 +798,7 @@ Rename::sortInsts()
const DynInstPtr &inst = fromDecode->insts[i];
insts[inst->threadNumber].push_back(inst);
#if TRACING_ON
if (Debug::O3PipeView) {
if (debug::O3PipeView) {
inst->renameTick = curTick() - inst->fetchTick;
}
#endif

View File

@@ -125,7 +125,7 @@ BreakPCEvent::process(ThreadContext *tc)
{
StringWrap name("break_event");
DPRINTFN("break event %s triggered\n", descr());
Debug::breakpoint();
debug::breakpoint();
if (remove)
delete this;
}

View File

@@ -90,7 +90,7 @@ class BaseStackTrace
const std::vector<Addr> &getstack() const { return stack; }
void dprintf() { if (Debug::Stack) dump(); }
void dprintf() { if (debug::Stack) dump(); }
// This function can be overridden so that special addresses which don't
// actually refer to PCs can be translated into special names. For

View File

@@ -246,7 +246,7 @@ BaseSimpleCPU::wakeup(ThreadID tid)
void
BaseSimpleCPU::traceFault()
{
if (Debug::ExecFaulting) {
if (debug::ExecFaulting) {
traceData->setFaulting(true);
} else {
delete traceData;

View File

@@ -267,7 +267,7 @@ TraceCPU::ElasticDataGen::init()
depGraph.size());
// Print readyList
if (Debug::TraceCPUData) {
if (debug::TraceCPUData) {
printReadyList();
}
auto free_itr = readyList.begin();
@@ -519,7 +519,7 @@ TraceCPU::ElasticDataGen::execute()
} // end of while loop
// Print readyList, sizes of queues and resource status after updating
if (Debug::TraceCPUData) {
if (debug::TraceCPUData) {
printReadyList();
DPRINTF(TraceCPUData, "Execute end occupancy:\n");
DPRINTFR(TraceCPUData, "\tdepGraph = %d, readyList = %d, "
@@ -723,7 +723,7 @@ TraceCPU::ElasticDataGen::completeMemAccess(PacketPtr pkt)
depGraph.erase(graph_itr);
}
if (Debug::TraceCPUData) {
if (debug::TraceCPUData) {
printReadyList();
}

View File

@@ -1802,7 +1802,7 @@ IGbE::TxDescCache::pktComplete()
tsoPrevSeq = tsoUsedLen;
}
if (Debug::EthernetDesc) {
if (debug::EthernetDesc) {
IpPtr ip(pktPtr);
if (ip)
DPRINTF(EthernetDesc, "Proccesing Ip packet with Id=%d\n",
@@ -2295,7 +2295,7 @@ IGbE::txWire()
if (etherInt->sendPacket(txFifo.front())) {
if (Debug::EthernetSM) {
if (debug::EthernetSM) {
IpPtr ip(txFifo.front());
if (ip)
DPRINTF(EthernetSM, "Transmitting Ip packet with Id=%d\n",

View File

@@ -1166,7 +1166,7 @@ NSGigE::rxKick()
rxPacketBufPtr = rxPacket->data;
#if TRACING_ON
if (Debug::Ethernet) {
if (debug::Ethernet) {
IpPtr ip(rxPacket);
if (ip) {
DPRINTF(Ethernet, "ID is %d\n", ip->id());
@@ -1363,7 +1363,7 @@ NSGigE::transmit()
txFifo.size());
if (interface->sendPacket(txFifo.front())) {
#if TRACING_ON
if (Debug::Ethernet) {
if (debug::Ethernet) {
IpPtr ip(txFifo.front());
if (ip) {
DPRINTF(Ethernet, "ID is %d\n", ip->id());
@@ -1607,7 +1607,7 @@ NSGigE::txKick()
udp->sum(cksum(udp));
etherDeviceStats.txUdpChecksums++;
} else {
Debug::breakpoint();
debug::breakpoint();
warn_once("UDPPKT set, but not UDP!\n");
}
} else if (extsts & EXTSTS_TCPPKT) {

View File

@@ -721,7 +721,7 @@ Device::rxKick()
switch (rxState) {
case rxFifoBlock:
if (Debug::EthernetSM) {
if (debug::EthernetSM) {
PacketFifo::iterator end = rxFifo.end();
int size = virtualRegs.size();
for (int i = 0; i < size; ++i) {
@@ -976,7 +976,7 @@ Device::transmit()
txFifo.pop();
#if TRACING_ON
if (Debug::Ethernet) {
if (debug::Ethernet) {
IpPtr ip(packet);
if (ip) {
DPRINTF(Ethernet, "ID is %d\n", ip->id());

View File

@@ -327,7 +327,7 @@ void
Terminal::writeData(uint8_t c)
{
#if TRACING_ON == 1
if (Debug::Terminal) {
if (debug::Terminal) {
static char last = '\0';
if ((c != '\n' && c != '\r') || (last != '\n' && last != '\r')) {

View File

@@ -108,7 +108,7 @@ VirtDescriptor::updateChain()
void
VirtDescriptor::dump() const
{
if (!Debug::VIO)
if (!debug::VIO)
return;
DPRINTF(VIO, "Descriptor[%i]: "
@@ -125,7 +125,7 @@ VirtDescriptor::dump() const
void
VirtDescriptor::dumpChain() const
{
if (!Debug::VIO)
if (!debug::VIO)
return;
const VirtDescriptor *desc(this);
@@ -317,7 +317,7 @@ VirtQueue::produceDescriptor(VirtDescriptor *desc, uint32_t len)
void
VirtQueue::dump() const
{
if (!Debug::VIO)
if (!debug::VIO)
return;
for (const VirtDescriptor &d : descriptors)

View File

@@ -198,7 +198,7 @@ void
VirtIO9PBase::dumpMsg(const P9MsgHeader &header, const uint8_t *data, size_t size)
{
#ifndef NDEBUG
if (!Debug::VIO9P)
if (!debug::VIO9P)
return;
const P9MsgInfoMap::const_iterator it_msg(p9_msg_info.find(header.type));
@@ -390,7 +390,7 @@ VirtIO9PDiod::startDiod()
// Start diod
execlp(p.diod.c_str(), p.diod.c_str(),
"-d", Debug::VIO9P ? "1" : "0", // show debug output
"-d", debug::VIO9P ? "1" : "0", // show debug output
"-f", // start in foreground
"-r", diod_rfd_s.c_str(), // setup read FD
"-w", diod_wfd_s.c_str(), // setup write FD

View File

@@ -154,7 +154,7 @@ void
ExecStage::exec()
{
initStatistics();
if (Debug::GPUSched) {
if (debug::GPUSched) {
dumpDispList();
}
for (int unitId = 0; unitId < computeUnit.numExeUnits(); ++unitId) {

View File

@@ -69,7 +69,7 @@ class DebugPrintk : public Base
void
process(ThreadContext *tc) override
{
if (Debug::DebugPrintf) {
if (debug::DebugPrintf) {
std::string str;
std::function<int(ThreadContext *, Addr, PrintkVarArgs)> func =
[&str](ThreadContext *tc, Addr format_ptr,

View File

@@ -100,7 +100,7 @@ class StubSlavePortHandler : public
Tick
StubSlavePort::recvAtomic(PacketPtr packet)
{
if (Debug::ExternalPort) {
if (debug::ExternalPort) {
GEM5_VAR_USED unsigned int size = packet->getSize();
DPRINTF(ExternalPort, "StubSlavePort: recvAtomic a: 0x%x size: %d"

View File

@@ -228,7 +228,7 @@ MemSinkCtrl::processNextReqEvent()
"%s DUMPING %s queues status\n", __func__,
(busState == WRITE ? "WRITE" : "READ"));
if (Debug::QOS) {
if (debug::QOS) {
for (uint8_t i = 0; i < numPriorities(); ++i) {
std::string plist = "";
for (auto& e : (busState == WRITE ? writeQueue[i]: readQueue[i])) {

View File

@@ -45,6 +45,7 @@
#include <map>
#include <vector>
#include "base/compiler.hh"
#include "base/debug.hh"
#include "base/output.hh"
#include "base/trace.hh"
@@ -55,9 +56,11 @@ namespace py = pybind11;
namespace gem5
{
namespace Debug {
GEM5_DEPRECATED_NAMESPACE(Debug, debug);
namespace debug
{
extern int allFlagsVersion;
}
} // namespace debug
static void
output(const char *filename)
@@ -84,40 +87,40 @@ pybind_init_debug(py::module_ &m_native)
py::module_ m_debug = m_native.def_submodule("debug");
m_debug
.def("getAllFlagsVersion", []() { return Debug::allFlagsVersion; })
.def("allFlags", &Debug::allFlags, py::return_value_policy::reference)
.def("getAllFlagsVersion", []() { return debug::allFlagsVersion; })
.def("allFlags", &debug::allFlags, py::return_value_policy::reference)
.def("schedBreak", &schedBreak)
.def("setRemoteGDBPort", &setRemoteGDBPort)
;
py::class_<Debug::Flag> c_flag(m_debug, "Flag");
py::class_<debug::Flag> c_flag(m_debug, "Flag");
c_flag
.def_property_readonly("name", &Debug::Flag::name)
.def_property_readonly("desc", &Debug::Flag::desc)
.def("enable", &Debug::Flag::enable)
.def("disable", &Debug::Flag::disable)
.def_property_readonly("name", &debug::Flag::name)
.def_property_readonly("desc", &debug::Flag::desc)
.def("enable", &debug::Flag::enable)
.def("disable", &debug::Flag::disable)
.def_property("tracing",
[](const Debug::Flag *flag) {
[](const debug::Flag *flag) {
return flag->tracing();
},
[](Debug::Flag *flag, bool state) {
[](debug::Flag *flag, bool state) {
if (state) {
flag->enable();
} else {
flag->disable();
}
})
.def("__bool__", [](const Debug::Flag *flag) {
.def("__bool__", [](const debug::Flag *flag) {
return (bool)*flag;
})
;
py::class_<Debug::SimpleFlag>(m_debug, "SimpleFlag", c_flag)
.def_property_readonly("isFormat", &Debug::SimpleFlag::isFormat)
py::class_<debug::SimpleFlag>(m_debug, "SimpleFlag", c_flag)
.def_property_readonly("isFormat", &debug::SimpleFlag::isFormat)
;
py::class_<Debug::CompoundFlag>(m_debug, "CompoundFlag", c_flag)
.def("kids", &Debug::CompoundFlag::kids)
py::class_<debug::CompoundFlag>(m_debug, "CompoundFlag", c_flag)
.def("kids", &debug::CompoundFlag::kids)
;

View File

@@ -68,7 +68,7 @@ DebugBreakEvent::DebugBreakEvent(Tick when)
void
DebugBreakEvent::process()
{
Debug::breakpoint();
debug::breakpoint();
}

View File

@@ -73,7 +73,7 @@ DrainManager::tryDrain()
_state = DrainState::Draining;
for (auto *obj : _allDrainable) {
DrainState status = obj->dmDrain();
if (Debug::Drain && status != DrainState::Drained) {
if (debug::Drain && status != DrainState::Drained) {
Named *temp = dynamic_cast<Named*>(obj);
if (temp)
DPRINTF(Drain, "Failed to drain %s\n", temp->name());

View File

@@ -218,7 +218,7 @@ EventQueue::serviceOne()
if (!event->squashed()) {
// forward current cycle to the time when this event occurs.
setCurTick(event->when());
if (Debug::Event)
if (debug::Event)
event->trace("executed");
event->process();
if (event->isExitEvent()) {

View File

@@ -784,7 +784,7 @@ class EventQueue
event->flags.set(Event::Scheduled);
event->acquire();
if (Debug::Event)
if (debug::Event)
event->trace("scheduled");
}
@@ -805,7 +805,7 @@ class EventQueue
event->flags.clear(Event::Squashed);
event->flags.clear(Event::Scheduled);
if (Debug::Event)
if (debug::Event)
event->trace("descheduled");
event->release();
@@ -836,7 +836,7 @@ class EventQueue
event->flags.clear(Event::Squashed);
event->flags.set(Event::Scheduled);
if (Debug::Event)
if (debug::Event)
event->trace("rescheduled");
}

View File

@@ -444,7 +444,7 @@ void
debugbreak(ThreadContext *tc)
{
DPRINTF(PseudoInst, "pseudo_inst::debugbreak()\n");
Debug::breakpoint();
debug::breakpoint();
}
void