 Chromium Code Reviews
 Chromium Code Reviews Issue 968773002:
  [Oilpan] Measure time for forced/idle GC  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 968773002:
  [Oilpan] Measure time for forced/idle GC  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: tools/perf/measurements/oilpan_gc_times.py | 
| diff --git a/tools/perf/measurements/oilpan_gc_times.py b/tools/perf/measurements/oilpan_gc_times.py | 
| index eb105ae4513b41e8071489a5920900d9fa8f41fe..dabb5349495a349fb65b88b62651c199df12f944 100644 | 
| --- a/tools/perf/measurements/oilpan_gc_times.py | 
| +++ b/tools/perf/measurements/oilpan_gc_times.py | 
| @@ -6,10 +6,12 @@ import os | 
| from measurements import smoothness_controller | 
| from measurements import timeline_controller | 
| +from telemetry import benchmark | 
| from telemetry.core.platform import tracing_category_filter | 
| from telemetry.core.platform import tracing_options | 
| from telemetry.page import page_test | 
| from telemetry.page.actions import action_runner | 
| +from telemetry.results import results_options | 
| from telemetry.timeline.model import TimelineModel | 
| from telemetry.util import statistics | 
| from telemetry.value import list_of_scalar_values | 
| @@ -27,7 +29,7 @@ _NAMES_TO_DUMP = ['oilpan_precise_mark', | 
| 'oilpan_conservative_complete_sweep', | 
| 'oilpan_coalesce'] | 
| -def _AddTracingResults(events, results): | 
| +def _AddTracingResults(events, include_forced_gc, results): | 
| # Prepare | 
| values = {} | 
| for name in _NAMES_TO_DUMP: | 
| @@ -45,7 +47,7 @@ def _AddTracingResults(events, results): | 
| values['oilpan_coalesce'].append(duration) | 
| continue | 
| if event.name == 'Heap::collectGarbage': | 
| - if not gc_type is None and not forced: | 
| + if not gc_type is None and (not forced or include_forced_gc): | 
| values['oilpan_%s_mark' % gc_type].append(mark_time) | 
| values['oilpan_%s_lazy_sweep' % gc_type].append(lazy_sweep_time) | 
| values['oilpan_%s_complete_sweep' % gc_type].append(complete_sweep_time) | 
| @@ -63,7 +65,7 @@ def _AddTracingResults(events, results): | 
| complete_sweep_time += duration | 
| continue | 
| - if not gc_type is None and not forced: | 
| + if not gc_type is None and (not forced or include_forced_gc): | 
| values['oilpan_%s_mark' % gc_type].append(mark_time) | 
| values['oilpan_%s_lazy_sweep' % gc_type].append(lazy_sweep_time) | 
| values['oilpan_%s_complete_sweep' % gc_type].append(complete_sweep_time) | 
| @@ -106,9 +108,10 @@ def _AddTracingResults(events, results): | 
| class _OilpanGCTimesBase(page_test.PageTest): | 
| - def __init__(self, action_name = ''): | 
| + def __init__(self, action_name='', include_forced_gc=False): | 
| super(_OilpanGCTimesBase, self).__init__(action_name) | 
| self._timeline_model = None | 
| + self._include_forced_gc = include_forced_gc | 
| def WillNavigateToPage(self, page, tab): | 
| # FIXME: Remove webkit.console when blink.console lands in chromium and | 
| @@ -130,12 +133,24 @@ class _OilpanGCTimesBase(page_test.PageTest): | 
| threads = self._timeline_model.GetAllThreads() | 
| for thread in threads: | 
| if thread.name == _CR_RENDERER_MAIN: | 
| - _AddTracingResults(thread.all_slices, results) | 
| + _AddTracingResults(thread.all_slices, self._include_forced_gc, results) | 
| def CleanUpAfterPage(self, page, tab): | 
| if tab.browser.platform.tracing_controller.is_tracing_running: | 
| tab.browser.platform.tracing_controller.Stop() | 
| + def _ParseEventsForTest(self, events, include_forced_gc, options): | 
| 
Sami
2015/03/09 16:29:52
Instead of adding this helper here, could we follo
 
peria
2015/04/02 08:26:01
Done.
 | 
| + options.output_dir = None | 
| + options.output_formats = ['none'] | 
| + options.suppress_gtest_report = True | 
| + options.output_trace_tag = None | 
| + results = results_options.CreateResults( | 
| + benchmark.BenchmarkMetadata(''), options) | 
| + # No pages are running in this test. | 
| + results.WillRunPage(None) | 
| + _AddTracingResults(events, include_forced_gc, results) | 
| + return results | 
| + | 
| class OilpanGCTimesForSmoothness(_OilpanGCTimesBase): | 
| def __init__(self): | 
| @@ -170,7 +185,7 @@ class OilpanGCTimesForBlinkPerf(_OilpanGCTimesBase): | 
| class OilpanGCTimesForInternals(_OilpanGCTimesBase): | 
| def __init__(self): | 
| - super(OilpanGCTimesForInternals, self).__init__() | 
| + super(OilpanGCTimesForInternals, self).__init__(include_forced_gc=True) | 
| @classmethod | 
| def CustomizeBrowserOptions(cls, options): |