forked from OSchip/llvm-project
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:
parent
302448352c
commit
f7f4f50113
|
@ -51,6 +51,9 @@ public:
|
|||
|
||||
static void
|
||||
SetDisplayDepth (uint32_t depth);
|
||||
|
||||
static void
|
||||
SetQuiet (bool value);
|
||||
|
||||
static void
|
||||
DumpCategoryTimes (Stream *s);
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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 ()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue