[Lldb-commits] [lldb] r118266 - /lldb/trunk/source/Commands/CommandObjectLog.cpp

Jim Ingham jingham at apple.com
Thu Nov 4 16:08:26 PDT 2010


Author: jingham
Date: Thu Nov  4 18:08:26 2010
New Revision: 118266

URL: http://llvm.org/viewvc/llvm-project?rev=118266&view=rev
Log:
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

Modified:
    lldb/trunk/source/Commands/CommandObjectLog.cpp

Modified: lldb/trunk/source/Commands/CommandObjectLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectLog.cpp?rev=118266&r1=118265&r2=118266&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectLog.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectLog.cpp Thu Nov  4 18:08:26 2010
@@ -413,7 +413,7 @@
         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 @@
             }
 
         }
+        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");





More information about the lldb-commits mailing list