Index: tools/perf/metrics/memory.py |
diff --git a/tools/perf/metrics/memory.py b/tools/perf/metrics/memory.py |
index 74fe26efe0bf60da53e3cceecc93f05ecb6e1848..fc9159311cd473d683153885e40824328b752041 100644 |
--- a/tools/perf/metrics/memory.py |
+++ b/tools/perf/metrics/memory.py |
@@ -41,6 +41,7 @@ class MemoryMetric(Metric): |
""" |
for h in _HISTOGRAMS: |
histogram_data = histogram.GetHistogramData(h['type'], h['name'], tab) |
+ # Histogram data may not be available |
qyearsley
2013/08/12 20:57:48
Not sure if it's best not to repeat this comment b
|
if not histogram_data: |
continue |
self._histogram_start_values[h['name']] = histogram_data |
@@ -53,14 +54,20 @@ class MemoryMetric(Metric): |
""" |
assert self._histogram_start_values, 'Must call Start() first' |
for h in _HISTOGRAMS: |
+ # Histogram data may not be available |
+ if h['name'] not in self._histogram_start_values: |
+ continue |
histogram_data = histogram.GetHistogramData(h['type'], h['name'], tab) |
- self._histogram_delta_values = histogram.SubtractHistogram( |
+ self._histogram_delta_values[h['name']] = histogram.SubtractHistogram( |
qyearsley
2013/08/12 20:57:48
I forgot to use self._histogram_delta_values as a
|
histogram_data, self._histogram_start_values[h['name']]) |
qyearsley
2013/08/12 20:57:48
Here (and in AddResults) I'm assuming that if hist
|
def AddResults(self, tab, results): |
"""Add results for this page to the results object.""" |
assert self._histogram_delta_values, 'Must call Stop() first' |
for h in _HISTOGRAMS: |
+ # Histogram data may not be available |
+ if h['name'] not in self._histogram_delta_values: |
+ continue |
histogram_data = self._histogram_delta_values[h['name']] |
results.Add(h['name'], h['units'], histogram_data, |
data_type='unimportant-histogram') |