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

Side by Side Diff: tools/deep_memory_profiler/subcommands/buckets.py

Issue 467563002: Refactor dmprof: remove no_dump flag for 'buckets' in load_basic_files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 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/deep_memory_profiler/lib/subcommand.py ('k') | 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 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import sys 6 import sys
7 7
8 from lib.subcommand import SubCommand 8 from lib.subcommand import SubCommand
9 9
10 10
11 LOGGER = logging.getLogger('dmprof') 11 LOGGER = logging.getLogger('dmprof')
12 12
13 13
14 class BucketsCommand(SubCommand): 14 class BucketsCommand(SubCommand):
15 def __init__(self): 15 def __init__(self):
16 super(BucketsCommand, self).__init__('Usage: %prog buckets <first-dump>') 16 super(BucketsCommand, self).__init__('Usage: %prog buckets <first-dump>')
17 17
18 def do(self, sys_argv, out=sys.stdout): 18 def do(self, sys_argv, out=sys.stdout):
19 _, args = self._parse_args(sys_argv, 1) 19 _, args = self._parse_args(sys_argv, 1)
20 dump_path = args[1] 20 dump_path = args[1]
21 bucket_set = SubCommand.load_basic_files(dump_path, True, True) 21 (bucket_set, _) = SubCommand.load_basic_files(dump_path, True)
22 22
23 BucketsCommand._output(bucket_set, out) 23 BucketsCommand._output(bucket_set, out)
24 return 0 24 return 0
25 25
26 @staticmethod 26 @staticmethod
27 def _output(bucket_set, out): 27 def _output(bucket_set, out):
28 """Prints all buckets with resolving symbols. 28 """Prints all buckets with resolving symbols.
29 29
30 Args: 30 Args:
31 bucket_set: A BucketSet object. 31 bucket_set: A BucketSet object.
32 out: An IO object to output. 32 out: An IO object to output.
33 """ 33 """
34 for bucket_id, bucket in sorted(bucket_set): 34 for bucket_id, bucket in sorted(bucket_set):
35 out.write('%d: %s\n' % (bucket_id, bucket)) 35 out.write('%d: %s\n' % (bucket_id, bucket))
OLDNEW
« no previous file with comments | « tools/deep_memory_profiler/lib/subcommand.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698