summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectLog.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2010-11-04 23:08:26 +0000
committerJim Ingham <jingham@apple.com>2010-11-04 23:08:26 +0000
commit932725fa112a5a430f6755b4777e17699b529059 (patch)
treec78f19ca0af74927fc2f78226fb2b494d87df9f0 /lldb/source/Commands/CommandObjectLog.cpp
parentc1fa8c5644e418964dd560aa242ff0d747d033b6 (diff)
downloadbcm5719-llvm-932725fa112a5a430f6755b4777e17699b529059.tar.gz
bcm5719-llvm-932725fa112a5a430f6755b4777e17699b529059.zip
Added a top level Timer to the interpreter execute command. Also added an option to pass the depth to "log timer enable". That allows you to time just command execution with:
log timer enable 1 <command> log timer dump llvm-svn: 118266
Diffstat (limited to 'lldb/source/Commands/CommandObjectLog.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectLog.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp
index e0655185f44..2060b1eba6c 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -413,7 +413,7 @@ public:
CommandObject (interpreter,
"log timers",
"Enable, disable, dump, and reset LLDB internal performance timers.",
- "log timers < enable | disable | dump | reset >")
+ "log timers < enable <depth> | disable | dump | reset >")
{
}
@@ -456,6 +456,24 @@ public:
}
}
+ else if (argc == 2)
+ {
+ const char *sub_command = args.GetArgumentAtIndex(0);
+
+ if (strcasecmp(sub_command, "enable") == 0)
+ {
+ bool success;
+ uint32_t depth = Args::StringToUInt32(args.GetArgumentAtIndex(1), 0, 0, &success);
+ if (success)
+ {
+ Timer::SetDisplayDepth (depth);
+ result.SetStatus(eReturnStatusSuccessFinishNoResult);
+ }
+ else
+ result.AppendError("Could not convert enable depth to an unsigned integer.");
+ }
+ }
+
if (!result.Succeeded())
{
result.AppendError("Missing subcommand");
OpenPOWER on IntegriCloud