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

Side by Side Diff: tools/perf/benchmarks/memory_infra.py

Issue 2162283002: [telemetry] Trace config should be used to disable periodic dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/perf/benchmarks/oortonline.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 re 5 import re
6 6
7 from core import perf_benchmark 7 from core import perf_benchmark
8 8
9 from telemetry import benchmark 9 from telemetry import benchmark
10 from telemetry.timeline import chrome_trace_category_filter 10 from telemetry.timeline import chrome_trace_category_filter
11 from telemetry.timeline import chrome_trace_config
11 from telemetry.web_perf import timeline_based_measurement 12 from telemetry.web_perf import timeline_based_measurement
12 13
13 import page_sets 14 import page_sets
14 15
15 16
16 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() 17 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames()
17 # https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value /numeric.html#L323 18 # https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value /numeric.html#L323
18 _IGNORED_STATS_RE = re.compile( 19 _IGNORED_STATS_RE = re.compile(
19 r'(?<!dump)(?<!process)_(std|count|max|min|sum|pct_\d{4}(_\d+)?)$') 20 r'(?<!dump)(?<!process)_(std|count|max|min|sum|pct_\d{4}(_\d+)?)$')
20 21
21 22
22 class _MemoryInfra(perf_benchmark.PerfBenchmark): 23 class _MemoryInfra(perf_benchmark.PerfBenchmark):
23 """Base class for new-generation memory benchmarks based on memory-infra. 24 """Base class for new-generation memory benchmarks based on memory-infra.
24 25
25 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which 26 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which
26 is part of chrome tracing, and extracts it using timeline-based measurements. 27 is part of chrome tracing, and extracts it using timeline-based measurements.
27 """ 28 """
28 29
29 def SetExtraBrowserOptions(self, options):
30 options.AppendExtraBrowserArgs([
31 # TODO(perezju): Temporary workaround to disable periodic memory dumps.
32 # See: http://crbug.com/513692
33 '--enable-memory-benchmarking',
34 ])
35
36 def CreateTimelineBasedMeasurementOptions(self): 30 def CreateTimelineBasedMeasurementOptions(self):
37 # Enable only memory-infra, to get memory dumps, and blink.console, to get 31 # Enable only memory-infra, to get memory dumps, and blink.console, to get
38 # the timeline markers used for mapping threads to tabs. 32 # the timeline markers used for mapping threads to tabs.
39 trace_memory = chrome_trace_category_filter.ChromeTraceCategoryFilter( 33 trace_memory = chrome_trace_category_filter.ChromeTraceCategoryFilter(
40 filter_string='-*,blink.console,disabled-by-default-memory-infra') 34 filter_string='-*,blink.console,disabled-by-default-memory-infra')
41 tbm_options = timeline_based_measurement.Options( 35 tbm_options = timeline_based_measurement.Options(
42 overhead_level=trace_memory) 36 overhead_level=trace_memory)
43 tbm_options.config.enable_android_graphics_memtrack = True 37 tbm_options.config.enable_android_graphics_memtrack = True
44 tbm_options.SetTimelineBasedMetrics(['memoryMetric']) 38 tbm_options.SetTimelineBasedMetrics(['memoryMetric'])
39 # Setting an empty memory dump config disables periodic dumps.
40 tbm_options.config.chrome_trace_config.SetMemoryDumpConfig(
41 chrome_trace_config.MemoryDumpConfig())
45 return tbm_options 42 return tbm_options
46 43
47 44
48 # TODO(bashi): Workaround for http://crbug.com/532075. 45 # TODO(bashi): Workaround for http://crbug.com/532075.
49 # @benchmark.Enabled('android') shouldn't be needed. 46 # @benchmark.Enabled('android') shouldn't be needed.
50 @benchmark.Enabled('android') 47 @benchmark.Enabled('android')
51 class MemoryBenchmarkTop10Mobile(_MemoryInfra): 48 class MemoryBenchmarkTop10Mobile(_MemoryInfra):
52 """Measure foreground/background memory on top 10 mobile page set. 49 """Measure foreground/background memory on top 10 mobile page set.
53 50
54 This metric provides memory measurements for the System Health Plan of 51 This metric provides memory measurements for the System Health Plan of
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 r'(reported_by_chrome:v8|reported_by_os:system_memory:[^:]+$)') 172 r'(reported_by_chrome:v8|reported_by_os:system_memory:[^:]+$)')
176 173
177 def CreateTimelineBasedMeasurementOptions(self): 174 def CreateTimelineBasedMeasurementOptions(self):
178 v8_categories = [ 175 v8_categories = [
179 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] 176 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console']
180 memory_categories = ['blink.console', 'disabled-by-default-memory-infra'] 177 memory_categories = ['blink.console', 'disabled-by-default-memory-infra']
181 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( 178 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter(
182 ','.join(['-*'] + v8_categories + memory_categories)) 179 ','.join(['-*'] + v8_categories + memory_categories))
183 options = timeline_based_measurement.Options(category_filter) 180 options = timeline_based_measurement.Options(category_filter)
184 options.SetTimelineBasedMetrics(['v8AndMemoryMetrics']) 181 options.SetTimelineBasedMetrics(['v8AndMemoryMetrics'])
182 # Setting an empty memory dump config disables periodic dumps.
183 options.config.chrome_trace_config.SetMemoryDumpConfig(
184 chrome_trace_config.MemoryDumpConfig())
185 return options 185 return options
186 186
187 @classmethod 187 @classmethod
188 def ValueCanBeAddedPredicate(cls, value, _): 188 def ValueCanBeAddedPredicate(cls, value, _):
189 if 'memory:chrome' in value.name: 189 if 'memory:chrome' in value.name:
190 # TODO(petrcermak): Remove the first two cases once 190 # TODO(petrcermak): Remove the first two cases once
191 # https://codereview.chromium.org/2018503002/ lands in Catapult and rolls 191 # https://codereview.chromium.org/2018503002/ lands in Catapult and rolls
192 # into Chromium. 192 # into Chromium.
193 return ('renderer:subsystem:v8' in value.name or 193 return ('renderer:subsystem:v8' in value.name or
194 'renderer:vmstats:overall' in value.name or 194 'renderer:vmstats:overall' in value.name or
(...skipping 21 matching lines...) Expand all
216 of long running idle Gmail page """ 216 of long running idle Gmail page """
217 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet 217 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet
218 218
219 @classmethod 219 @classmethod
220 def Name(cls): 220 def Name(cls):
221 return 'memory.long_running_idle_gmail_background_tbmv2' 221 return 'memory.long_running_idle_gmail_background_tbmv2'
222 222
223 @classmethod 223 @classmethod
224 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530 224 def ShouldDisable(cls, possible_browser): # http://crbug.com/616530
225 return cls.IsSvelte(possible_browser) 225 return cls.IsSvelte(possible_browser)
OLDNEW
« no previous file with comments | « no previous file | tools/perf/benchmarks/oortonline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698