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

Side by Side Diff: tools/binary_size/diagnose_bloat.py

Issue 2948683002: diagnose_bloat.py: Pasteable supersize instructions. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | 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 # Copyright 2017 The Chromium Authors. All rights reserved. 2 # Copyright 2017 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Tool for finding the cause of binary size bloat. 6 """Tool for finding the cause of binary size bloat.
7 7
8 See //tools/binary_size/README.md for example usage. 8 See //tools/binary_size/README.md for example usage.
9 9
10 Note: this tool will perform gclient sync/git checkout on your local repo if 10 Note: this tool will perform gclient sync/git checkout on your local repo if
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 os.remove(diff_path) 372 os.remove(diff_path)
373 with open(diff_path, 'a') as diff_file: 373 with open(diff_path, 'a') as diff_file:
374 for d in self.diffs: 374 for d in self.diffs:
375 d.RunDiff(diff_file, before.dir, after.dir) 375 d.RunDiff(diff_file, before.dir, after.dir)
376 logging.info('See detailed diff results here: %s', 376 logging.info('See detailed diff results here: %s',
377 os.path.relpath(diff_path)) 377 os.path.relpath(diff_path))
378 if len(self.build_archives) == 2: 378 if len(self.build_archives) == 2:
379 supersize_path = os.path.join(_BINARY_SIZE_DIR, 'supersize') 379 supersize_path = os.path.join(_BINARY_SIZE_DIR, 'supersize')
380 size_paths = [os.path.join(a.dir, a.build.size_name) 380 size_paths = [os.path.join(a.dir, a.build.size_name)
381 for a in self.build_archives] 381 for a in self.build_archives]
382 logging.info('Enter supersize console via: %s, console %s %s', 382 logging.info('Enter supersize console via: %s console %s %s',
383 os.path.relpath(supersize_path), 383 os.path.relpath(supersize_path),
384 os.path.relpath(size_paths[0]), 384 os.path.relpath(size_paths[0]),
385 os.path.relpath(size_paths[1])) 385 os.path.relpath(size_paths[1]))
386 metadata.Write() 386 metadata.Write()
387 self._AddDiffSummaryStat(before, after) 387 self._AddDiffSummaryStat(before, after)
388 388
389 def Summarize(self): 389 def Summarize(self):
390 if self._summary_stats: 390 if self._summary_stats:
391 path = os.path.join(self.archive_dir, 'last_diff_summary.txt') 391 path = os.path.join(self.archive_dir, 'last_diff_summary.txt')
392 with open(path, 'w') as f: 392 with open(path, 'w') as f:
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 819
820 if i != 0: 820 if i != 0:
821 diff_mngr.MaybeDiff(i - 1, i) 821 diff_mngr.MaybeDiff(i - 1, i)
822 822
823 diff_mngr.Summarize() 823 diff_mngr.Summarize()
824 824
825 825
826 if __name__ == '__main__': 826 if __name__ == '__main__':
827 sys.exit(main()) 827 sys.exit(main())
828 828
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698