Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: Tools/Scripts/malloc-tree

Issue 20652002: Fix trailing whitespace in scripts and misc. files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't change literal diff. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Tools/Scripts/find-extra-includes ('k') | Tools/Scripts/parse-malloc-history » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (C) 2011 Apple Inc. All rights reserved. 3 # Copyright (C) 2011 Apple Inc. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions 6 # modification, are permitted provided that the following conditions
7 # are met: 7 # are met:
8 # 8 #
9 # 1. Redistributions of source code must retain the above copyright 9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 else: 164 else:
165 scaleSize = options.scaleSize 165 scaleSize = options.scaleSize
166 showBars = options.showBars 166 showBars = options.showBars
167 167
168 if len(args) < 1: 168 if len(args) < 1:
169 inputFile = sys.stdin 169 inputFile = sys.stdin
170 else: 170 else:
171 inputFile = open(args[0], "r") 171 inputFile = open(args[0], "r")
172 172
173 line = inputFile.readline() 173 line = inputFile.readline()
174 174
175 rootNodes = {} 175 rootNodes = {}
176 176
177 while line: 177 while line:
178 firstSep = line.find('|') 178 firstSep = line.find('|')
179 if firstSep > 0: 179 if firstSep > 0:
180 firstPart = line[:firstSep].strip() 180 firstPart = line[:firstSep].strip()
181 lineRemain = line[firstSep+1:] 181 lineRemain = line[firstSep+1:]
182 bytesSep = firstPart.find('bytes:') 182 bytesSep = firstPart.find('bytes:')
183 if bytesSep >= 0: 183 if bytesSep >= 0:
184 name = firstPart[bytesSep+7:] 184 name = firstPart[bytesSep+7:]
(...skipping 10 matching lines...) Expand all
195 node.processLine(bytes, lineRemain) 195 node.processLine(bytes, lineRemain)
196 196
197 line = inputFile.readline() 197 line = inputFile.readline()
198 198
199 sortedRootNodes = sorted(rootNodes.values(), key=sortKeyByBytes, reverse=Tru e) 199 sortedRootNodes = sorted(rootNodes.values(), key=sortKeyByBytes, reverse=Tru e)
200 200
201 print 'Call graph:' 201 print 'Call graph:'
202 try: 202 try:
203 for node in sortedRootNodes: 203 for node in sortedRootNodes:
204 node.printNode() 204 node.printNode()
205 print 205 print
206 except: 206 except:
207 pass 207 pass
208 208
209 if __name__ == "__main__": 209 if __name__ == "__main__":
210 main() 210 main()
OLDNEW
« no previous file with comments | « Tools/Scripts/find-extra-includes ('k') | Tools/Scripts/parse-malloc-history » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698