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

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

Issue 1067503002: [Oilpan] Move global definitions into a scoped area (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a typo Created 5 years, 8 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 | no next file » | 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 757665f67f68ec26e0e2882961ac10659ec0187a..5e7f51d3831bf3e990848c279332952f08a1709f 100644
--- a/tools/perf/measurements/oilpan_gc_times.py
+++ b/tools/perf/measurements/oilpan_gc_times.py
@@ -21,29 +21,29 @@ from telemetry.value import trace
_CR_RENDERER_MAIN = 'CrRendererMain'
_RUN_SMOOTH_ACTIONS = 'RunSmoothAllActions'
-_GC_REASONS = ['precise', 'conservative', 'idle', 'forced']
-_GC_STAGES = ['mark', 'lazy_sweep', 'complete_sweep']
-def _GetGcReason(args):
- # Old style
- if 'precise' in args:
- if args['forced']:
+def _AddTracingResults(events, results):
+ _GC_REASONS = ['precise', 'conservative', 'idle', 'forced']
+ _GC_STAGES = ['mark', 'lazy_sweep', 'complete_sweep']
+
+ def GetGcReason(args):
+ # Old format
+ if 'precise' in args:
+ if args['forced']:
+ return 'forced'
+ return 'precise' if args['precise'] else 'conservative'
+
+ if args['gcReason'] == 'ConservativeGC':
+ return 'conservative'
+ if args['gcReason'] == 'PreciseGC':
+ return 'precise'
+ if args['gcReason'] == 'ForcedGCForTesting':
return 'forced'
- return 'precise' if args['precise'] else 'conservative'
-
- if args['gcReason'] == 'ConservativeGC':
- return 'conservative'
- if args['gcReason'] == 'PreciseGC':
- return 'precise'
- if args['gcReason'] == 'ForcedGCForTesting':
- return 'forced'
- if args['gcReason'] == 'IdleGC':
- return 'idle'
- return None # Unknown
+ if args['gcReason'] == 'IdleGC':
+ return 'idle'
+ return None # Unknown
-
-def _AddTracingResults(events, results):
def DumpMetric(page, name, values, unit, results):
if values[name]:
results.AddValue(list_of_scalar_values.ListOfScalarValues(
@@ -59,7 +59,7 @@ def _AddTracingResults(events, results):
for stage in _GC_STAGES:
values['oilpan_%s_%s' % (reason, stage)] = []
- # Parse in time line
+ # Parse trace events
reason = None
mark_time = 0
lazy_sweep_time = 0
@@ -75,7 +75,7 @@ def _AddTracingResults(events, results):
values['oilpan_%s_lazy_sweep' % reason].append(lazy_sweep_time)
values['oilpan_%s_complete_sweep' % reason].append(complete_sweep_time)
- reason = _GetGcReason(event.args)
+ reason = GetGcReason(event.args)
mark_time = duration
lazy_sweep_time = 0
complete_sweep_time = 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698