Added a setting to "log timer" so you can see the incremental timings as well:

log timer increment true/false

llvm-svn: 118268
This commit is contained in:
Jim Ingham 2010-11-04 23:19:21 +00:00
parent 302448352c
commit f7f4f50113
3 changed files with 22 additions and 2 deletions

View File

@ -52,6 +52,9 @@ public:
static void
SetDisplayDepth (uint32_t depth);
static void
SetQuiet (bool value);
static void
DumpCategoryTimes (Stream *s);

View File

@ -413,7 +413,7 @@ public:
CommandObject (interpreter,
"log timers",
"Enable, disable, dump, and reset LLDB internal performance timers.",
"log timers < enable <depth> | disable | dump | reset >")
"log timers < enable <depth> | disable | dump | increment <bool> | reset >")
{
}
@ -472,6 +472,18 @@ public:
else
result.AppendError("Could not convert enable depth to an unsigned integer.");
}
if (strcasecmp(sub_command, "increment") == 0)
{
bool success;
bool increment = Args::StringToBoolean(args.GetArgumentAtIndex(1), false, &success);
if (success)
{
Timer::SetQuiet (!increment);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
}
else
result.AppendError("Could not convert increment value to boolean.");
}
}
if (!result.Succeeded())

View File

@ -28,7 +28,6 @@ typedef std::vector<Timer *> TimerStack;
typedef std::map<const char *, uint64_t> CategoryMap;
static pthread_key_t g_key;
static Mutex &
GetCategoryMutex()
{
@ -62,6 +61,12 @@ ThreadSpecificCleanup (void *p)
delete (TimerStack *)p;
}
void
Timer::SetQuiet (bool value)
{
g_quiet = value;
}
void
Timer::Initialize ()
{