Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import time | |
|
kouhei (in TOK)
2015/03/02 05:03:57
Remove.
peria
2015/03/02 05:27:58
Done.
| |
| 6 | 7 |
| 7 from measurements import smoothness_controller | 8 from measurements import smoothness_controller |
| 8 from measurements import timeline_controller | 9 from measurements import timeline_controller |
| 9 from telemetry.core.platform import tracing_category_filter | 10 from telemetry.core.platform import tracing_category_filter |
| 10 from telemetry.core.platform import tracing_options | 11 from telemetry.core.platform import tracing_options |
| 11 from telemetry.page import page_test | 12 from telemetry.page import page_test |
| 12 from telemetry.page.actions import action_runner | 13 from telemetry.page.actions import action_runner |
| 13 from telemetry.timeline.model import TimelineModel | 14 from telemetry.timeline.model import TimelineModel |
| 14 from telemetry.util import statistics | 15 from telemetry.util import statistics |
| 15 from telemetry.value import list_of_scalar_values | 16 from telemetry.value import list_of_scalar_values |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 28 'oilpan_coalesce'] | 29 'oilpan_coalesce'] |
| 29 | 30 |
| 30 def _AddTracingResults(events, results): | 31 def _AddTracingResults(events, results): |
| 31 # Prepare | 32 # Prepare |
| 32 values = {} | 33 values = {} |
| 33 for name in _NAMES_TO_DUMP: | 34 for name in _NAMES_TO_DUMP: |
| 34 values[name] = [] | 35 values[name] = [] |
| 35 | 36 |
| 36 # Parse in time line | 37 # Parse in time line |
| 37 gc_type = None | 38 gc_type = None |
| 38 forced = False | |
| 39 mark_time = 0 | 39 mark_time = 0 |
| 40 lazy_sweep_time = 0 | 40 lazy_sweep_time = 0 |
| 41 complete_sweep_time = 0 | 41 complete_sweep_time = 0 |
| 42 for event in events: | 42 for event in events: |
| 43 duration = event.thread_duration or event.duration | 43 duration = event.thread_duration or event.duration |
| 44 if event.name == 'ThreadHeap::coalesce': | 44 if event.name == 'ThreadHeap::coalesce': |
| 45 values['oilpan_coalesce'].append(duration) | 45 values['oilpan_coalesce'].append(duration) |
| 46 continue | 46 continue |
| 47 if event.name == 'Heap::collectGarbage': | 47 if event.name == 'Heap::collectGarbage': |
| 48 if not gc_type is None and not forced: | 48 if not gc_type is None: |
| 49 values['oilpan_%s_mark' % gc_type].append(mark_time) | 49 values['oilpan_%s_mark' % gc_type].append(mark_time) |
| 50 values['oilpan_%s_lazy_sweep' % gc_type].append(lazy_sweep_time) | 50 values['oilpan_%s_lazy_sweep' % gc_type].append(lazy_sweep_time) |
| 51 values['oilpan_%s_complete_sweep' % gc_type].append(complete_sweep_time) | 51 values['oilpan_%s_complete_sweep' % gc_type].append(complete_sweep_time) |
| 52 | 52 |
| 53 gc_type = 'precise' if event.args['precise'] else 'conservative' | 53 gc_type = 'precise' if event.args['precise'] else 'conservative' |
| 54 forced = event.args['forced'] | |
| 55 mark_time = duration | 54 mark_time = duration |
| 56 lazy_sweep_time = 0 | 55 lazy_sweep_time = 0 |
| 57 complete_sweep_time = 0 | 56 complete_sweep_time = 0 |
| 58 continue | 57 continue |
| 59 if event.name == 'ThreadHeap::lazySweepPages': | 58 if event.name == 'ThreadHeap::lazySweepPages': |
| 60 lazy_sweep_time += duration | 59 lazy_sweep_time += duration |
| 61 continue | 60 continue |
| 62 if event.name == 'ThreadState::completeSweep': | 61 if event.name == 'ThreadState::completeSweep': |
| 63 complete_sweep_time += duration | 62 complete_sweep_time += duration |
| 64 continue | 63 continue |
| 65 | 64 |
| 66 if not gc_type is None and not forced: | 65 if not gc_type is None: |
| 67 values['oilpan_%s_mark' % gc_type].append(mark_time) | 66 values['oilpan_%s_mark' % gc_type].append(mark_time) |
| 68 values['oilpan_%s_lazy_sweep' % gc_type].append(lazy_sweep_time) | 67 values['oilpan_%s_lazy_sweep' % gc_type].append(lazy_sweep_time) |
| 69 values['oilpan_%s_complete_sweep' % gc_type].append(complete_sweep_time) | 68 values['oilpan_%s_complete_sweep' % gc_type].append(complete_sweep_time) |
| 70 | 69 |
| 71 # Dump | 70 # Dump |
| 72 page = results.current_page | 71 page = results.current_page |
| 73 unit = 'ms' | 72 unit = 'ms' |
| 74 for name in _NAMES_TO_DUMP: | 73 for name in _NAMES_TO_DUMP: |
| 75 if values[name]: | 74 if values[name]: |
| 76 results.AddValue(list_of_scalar_values.ListOfScalarValues( | 75 results.AddValue(list_of_scalar_values.ListOfScalarValues( |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 | 169 |
| 171 class OilpanGCTimesForInternals(_OilpanGCTimesBase): | 170 class OilpanGCTimesForInternals(_OilpanGCTimesBase): |
| 172 def __init__(self): | 171 def __init__(self): |
| 173 super(OilpanGCTimesForInternals, self).__init__() | 172 super(OilpanGCTimesForInternals, self).__init__() |
| 174 | 173 |
| 175 @classmethod | 174 @classmethod |
| 176 def CustomizeBrowserOptions(cls, options): | 175 def CustomizeBrowserOptions(cls, options): |
| 177 # 'expose-internals-for-testing' can be enabled on content shell. | 176 # 'expose-internals-for-testing' can be enabled on content shell. |
| 178 assert 'content-shell' in options.browser_type | 177 assert 'content-shell' in options.browser_type |
| 179 options.AppendExtraBrowserArgs('--expose-internals-for-testing') | 178 options.AppendExtraBrowserArgs('--expose-internals-for-testing') |
| OLD | NEW |