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

Unified Diff: tools/deep_memory_profiler/subcommands/cat.py

Issue 141563014: Make dmprof handle long runs better (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add notes to DumpList class documentation. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/deep_memory_profiler/lib/dump.py ('k') | tools/deep_memory_profiler/subcommands/policies.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/deep_memory_profiler/subcommands/cat.py
diff --git a/tools/deep_memory_profiler/subcommands/cat.py b/tools/deep_memory_profiler/subcommands/cat.py
index 9fdc32d1f134da625ead3735de0aab95790c22c6..5430ce102c3579af8ca4073b18a262ad99d0fe93 100644
--- a/tools/deep_memory_profiler/subcommands/cat.py
+++ b/tools/deep_memory_profiler/subcommands/cat.py
@@ -43,12 +43,6 @@ class CatCommand(SubCommand):
json_root = OrderedDict()
json_root['version'] = 1
json_root['run_id'] = None
- for dump in dumps:
- if json_root['run_id'] and json_root['run_id'] != dump.run_id:
- LOGGER.error('Inconsistent heap profile dumps.')
- json_root['run_id'] = ''
- break
- json_root['run_id'] = dump.run_id
json_root['roots'] = []
for sorter in sorters:
if sorter.root:
@@ -72,6 +66,12 @@ class CatCommand(SubCommand):
json_root['snapshots'] = []
for dump in dumps:
+ if json_root['run_id'] and json_root['run_id'] != dump.run_id:
+ LOGGER.error('Inconsistent heap profile dumps.')
+ json_root['run_id'] = ''
+ else:
+ json_root['run_id'] = dump.run_id
+
LOGGER.info('Sorting a dump %s...' % dump.path)
json_root['snapshots'].append(
self._fill_snapshot(dump, bucket_set, sorters))
« no previous file with comments | « tools/deep_memory_profiler/lib/dump.py ('k') | tools/deep_memory_profiler/subcommands/policies.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698