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'); |
+ } |
+ """) |