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..3cd23a7fefd126884fe6d9f4104880523e873f41 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,12 @@ 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: |
Dai Mikurube (NOT FULLTIME)
2013/05/14 17:02:10
Ah, I thought that this condition can coexist with
|
+ dumps = eval(tab.EvaluateJavaScript(""" |
tonyg
2013/05/14 18:54:13
Please use json instead of eval
bulach
2013/05/15 10:22:56
Done.
|
+ JSON.stringify([ |
+ chrome.memoryBenchmarking.heapProfilerDump('renderer'), |
+ chrome.memoryBenchmarking.heapProfilerDump('browser'), |
+ ]); |
+ """)) |
+ if dumps: |
+ print 'TCMalloc heap dumps available at ', dumps |
tonyg
2013/05/14 16:52:44
I don't like this code in the MemoryMeasurement be
bulach
2013/05/14 17:54:47
"it's complicated" :)
- Profiler knows nothing abo
tonyg
2013/05/14 18:54:13
How long is the interval? If it is sufficiently sh
bulach
2013/05/15 10:22:56
the interval is relatively large right now. it tak
|