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

Unified Diff: tools/perf/perf_tools/memory_measurement.py

Issue 15093008: Telemetry: integrates memory_measurement with TCMalloc dumps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments Created 7 years, 7 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 | « no previous file | tools/telemetry/telemetry/core/chrome/android_browser_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/perf_tools/memory_measurement.py
diff --git a/tools/perf/perf_tools/memory_measurement.py b/tools/perf/perf_tools/memory_measurement.py
index 8d1724d146681d588c7afa23d47ff1dd287cef09..90465c8bbc2921a5aed6db60121ca02360c61f0d 100644
--- a/tools/perf/perf_tools/memory_measurement.py
+++ b/tools/perf/perf_tools/memory_measurement.py
@@ -23,6 +23,7 @@ class MemoryMeasurement(page_measurement.PageMeasurement):
[histogram_metric.HistogramMetric(
h, histogram_metric.BROWSER_HISTOGRAM)
for h in BROWSER_MEMORY_HISTOGRAMS])
+ self._is_running_tcmalloc_heap_profiler = False
def DidNavigateToPage(self, page, tab):
for h in self.histograms:
@@ -39,6 +40,8 @@ class MemoryMeasurement(page_measurement.PageMeasurement):
options.AppendExtraBrowserArg('--disable-histogram-customizer')
options.AppendExtraBrowserArg('--memory-metrics')
options.AppendExtraBrowserArg('--reduce-security-for-dom-automation-tests')
+ self._is_running_tcmalloc_heap_profiler = (options.profiler_tool ==
+ 'tcmalloc-heap')
def CanRunForPage(self, page):
return hasattr(page, 'stress_memory')
@@ -46,3 +49,14 @@ class MemoryMeasurement(page_measurement.PageMeasurement):
def MeasurePage(self, page, tab, results):
for h in self.histograms:
h.GetValue(page, tab, results)
+ if self._is_running_tcmalloc_heap_profiler:
tonyg 2013/05/15 15:46:17 I think you could remove the member variable and c
bulach 2013/05/16 09:01:30 that's actually a good point. browser doesn't expo
+ # 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.
+ tab.ExecuteJavaScript("""
+ if (chrome && chrome.memoryBenchmarking) {
+ chrome.memoryBenchmarking.heapProfilerDump('final', 'renderer');
+ chrome.memoryBenchmarking.heapProfilerDump('final', 'browser');
+ }
+ """)
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/chrome/android_browser_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698