diff options
author | Steven Knight <knight@baldmt.com> | 2005-02-10 06:02:02 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-02-10 06:02:02 (GMT) |
commit | 11f1e91b731f3914d520b3bddb38da3ec55cb7ce (patch) | |
tree | b859c75a691e4a85bfce764b0a1940a2cc2f4c79 /bin/memlogs.py | |
parent | ac121612f842bbfe3cf35459dbd85c63c0fa7aa5 (diff) | |
download | SCons-11f1e91b731f3914d520b3bddb38da3ec55cb7ce.zip SCons-11f1e91b731f3914d520b3bddb38da3ec55cb7ce.tar.gz SCons-11f1e91b731f3914d520b3bddb38da3ec55cb7ce.tar.bz2 |
Don't create a Node for every file we try to find during scan.
Diffstat (limited to 'bin/memlogs.py')
-rw-r--r-- | bin/memlogs.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/bin/memlogs.py b/bin/memlogs.py new file mode 100644 index 0000000..1df691e --- /dev/null +++ b/bin/memlogs.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# +# Copyright (c) 2005 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import getopt +import sys + +filenames = sys.argv[1:] + +if not filenames: + print """Usage: memlogs.py file [...] + +Summarizes the --debug=memory numbers from one or more build logs. +""" + sys.exit(0) + +fmt = "%12s %12s %12s %12s %s" + +print fmt % ("pre-read", "post-read", "pre-build", "post-build", "") + +for fname in sys.argv[1:]: + lines = [l for l in open(fname).readlines() if l[:7] == 'Memory '] + t = tuple([l.split()[-1] for l in lines]) + (fname,) + print fmt % t |