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

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py

Issue 543803004: Move heap profile dumping logic from memory measurement to tcmalloc_heap_profiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/perf/measurements/memory.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
index 3bbe6bf823fea02ea4f64a7c62e8649e2215e2b9..14cf6f7e4a2d566421ca8b61e1c59a2a1f3955ae 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
@@ -122,5 +122,19 @@ class TCMallocHeapProfiler(profiler.Profiler):
options.AppendExtraBrowserArgs('--no-sandbox')
options.AppendExtraBrowserArgs('--enable-memory-benchmarking')
+ @classmethod
+ def WillCloseBrowser(cls, browser_backend, platform_backend):
+ # The tcmalloc_heap_profiler dumps files at regular
+ # intervals (~20 secs).
+ # This is a minor optimization to ensure it'll dump the last file when
+ # the test completes.
+ for i in xrange(len(browser_backend.browser.tabs)):
+ browser_backend.browser.tabs[i].ExecuteJavaScript("""
+ if (chrome && chrome.memoryBenchmarking) {
+ chrome.memoryBenchmarking.heapProfilerDump('renderer', 'final');
+ chrome.memoryBenchmarking.heapProfilerDump('browser', 'final');
+ }
+ """)
+
def CollectProfile(self):
return self._platform_profiler.CollectProfile()
« no previous file with comments | « tools/perf/measurements/memory.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698