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

Unified Diff: tools/perf/measurements/oilpan_gc_times.py

Issue 968773002: [Oilpan] Measure time for forced/idle GC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test Created 5 years, 9 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/perf/measurements/oilpan_gc_times_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
« no previous file with comments | « no previous file | tools/perf/measurements/oilpan_gc_times_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698