[Lldb-commits] [lldb] r153294 - /lldb/trunk/examples/python/delta.py
Greg Clayton
gclayton at apple.com
Thu Mar 22 17:01:04 PDT 2012
Author: gclayton
Date: Thu Mar 22 19:01:02 2012
New Revision: 153294
URL: http://llvm.org/viewvc/llvm-project?rev=153294&view=rev
Log:
Fixed up the command so that it doesn't dump the first arguments when run from the command line which was causing this script to dump the script itself.
Modified:
lldb/trunk/examples/python/delta.py
Modified: lldb/trunk/examples/python/delta.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/delta.py?rev=153294&r1=153293&r2=153294&view=diff
==============================================================================
--- lldb/trunk/examples/python/delta.py (original)
+++ lldb/trunk/examples/python/delta.py Thu Mar 22 19:01:02 2012
@@ -49,6 +49,9 @@
# Any commands whose names might be followed by more valid C identifier
# characters must be listed here
command_args = shlex.split(command)
+ parse_time_log_args (command_args)
+
+def parse_time_log_args(command_args):
usage = "usage: parse_time_log [options] [<LOGFILEPATH>]"
description='''Parse a log file that contains timestamps and convert the timestamps to delta times between log lines.'''
parser = optparse.OptionParser(description=description, prog='parse_time_log',usage=usage)
@@ -72,6 +75,10 @@
handy when trying to figure out why some operation in the debugger is taking
a long time during a preset set of debugger commands.'''
+ print '#----------------------------------------------------------------------'
+ print "# Log file: '%s'" % file
+ print '#----------------------------------------------------------------------'
+
timestamp_regex = re.compile('(\s*)([1-9][0-9]+\.[0-9]+)([^0-9].*)$')
base_time = 0.0
@@ -97,13 +104,7 @@
if __name__ == '__main__':
import sys
- # This script is being run from the command line, create a debugger in case we are
- # going to use any debugger functions in our function.
- for file in sys.argv:
- print '#----------------------------------------------------------------------'
- print "# Log file: '%s'" % file
- print '#----------------------------------------------------------------------'
- parse_log_file (file, None)
+ parse_time_log_args (sys.argv[1:])
else:
import lldb
More information about the lldb-commits
mailing list