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

Side by Side Diff: content/browser/tracing/background_tracing_config_impl.cc

Issue 1981823003: Add deep report for BENCHMARK_MEMORY (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed heavy Created 4 years, 7 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
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 #include "content/browser/tracing/background_tracing_config_impl.h" 5 #include "content/browser/tracing/background_tracing_config_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 13 matching lines...) Expand all
24 const char kConfigEnableBlinkFeatures[] = "enable_blink_features"; 24 const char kConfigEnableBlinkFeatures[] = "enable_blink_features";
25 const char kConfigDisableBlinkFeatures[] = "disable_blink_features"; 25 const char kConfigDisableBlinkFeatures[] = "disable_blink_features";
26 26
27 const char kConfigCategoryKey[] = "category"; 27 const char kConfigCategoryKey[] = "category";
28 const char kConfigCategoryBenchmark[] = "BENCHMARK"; 28 const char kConfigCategoryBenchmark[] = "BENCHMARK";
29 const char kConfigCategoryBenchmarkDeep[] = "BENCHMARK_DEEP"; 29 const char kConfigCategoryBenchmarkDeep[] = "BENCHMARK_DEEP";
30 const char kConfigCategoryBenchmarkGPU[] = "BENCHMARK_GPU"; 30 const char kConfigCategoryBenchmarkGPU[] = "BENCHMARK_GPU";
31 const char kConfigCategoryBenchmarkIPC[] = "BENCHMARK_IPC"; 31 const char kConfigCategoryBenchmarkIPC[] = "BENCHMARK_IPC";
32 const char kConfigCategoryBenchmarkStartup[] = "BENCHMARK_STARTUP"; 32 const char kConfigCategoryBenchmarkStartup[] = "BENCHMARK_STARTUP";
33 const char kConfigCategoryBenchmarkBlinkGC[] = "BENCHMARK_BLINK_GC"; 33 const char kConfigCategoryBenchmarkBlinkGC[] = "BENCHMARK_BLINK_GC";
34 const char kConfigCategoryBenchmarkMemoryHeavy[] = "BENCHMARK_MEMORY_HEAVY";
34 const char kConfigCategoryBenchmarkExecutionMetric[] = 35 const char kConfigCategoryBenchmarkExecutionMetric[] =
35 "BENCHMARK_EXECUTION_METRIC"; 36 "BENCHMARK_EXECUTION_METRIC";
36 const char kConfigCategoryBlinkStyle[] = "BLINK_STYLE"; 37 const char kConfigCategoryBlinkStyle[] = "BLINK_STYLE";
37 38
38 } // namespace 39 } // namespace
39 40
40 BackgroundTracingConfigImpl::BackgroundTracingConfigImpl( 41 BackgroundTracingConfigImpl::BackgroundTracingConfigImpl(
41 TracingMode tracing_mode) 42 TracingMode tracing_mode)
42 : BackgroundTracingConfig(tracing_mode), 43 : BackgroundTracingConfig(tracing_mode),
43 category_preset_(BackgroundTracingConfigImpl::BENCHMARK) {} 44 category_preset_(BackgroundTracingConfigImpl::BENCHMARK) {}
44 45
45 BackgroundTracingConfigImpl::~BackgroundTracingConfigImpl() {} 46 BackgroundTracingConfigImpl::~BackgroundTracingConfigImpl() {}
46 47
47 std::string BackgroundTracingConfigImpl::CategoryPresetToString( 48 std::string BackgroundTracingConfigImpl::CategoryPresetToString(
48 BackgroundTracingConfigImpl::CategoryPreset category_preset) { 49 BackgroundTracingConfigImpl::CategoryPreset category_preset) {
49 switch (category_preset) { 50 switch (category_preset) {
50 case BackgroundTracingConfigImpl::BENCHMARK: 51 case BackgroundTracingConfigImpl::BENCHMARK:
51 return kConfigCategoryBenchmark; 52 return kConfigCategoryBenchmark;
52 case BackgroundTracingConfigImpl::BENCHMARK_DEEP: 53 case BackgroundTracingConfigImpl::BENCHMARK_DEEP:
53 return kConfigCategoryBenchmarkDeep; 54 return kConfigCategoryBenchmarkDeep;
54 case BackgroundTracingConfigImpl::BENCHMARK_GPU: 55 case BackgroundTracingConfigImpl::BENCHMARK_GPU:
55 return kConfigCategoryBenchmarkGPU; 56 return kConfigCategoryBenchmarkGPU;
56 case BackgroundTracingConfigImpl::BENCHMARK_IPC: 57 case BackgroundTracingConfigImpl::BENCHMARK_IPC:
57 return kConfigCategoryBenchmarkIPC; 58 return kConfigCategoryBenchmarkIPC;
58 case BackgroundTracingConfigImpl::BENCHMARK_STARTUP: 59 case BackgroundTracingConfigImpl::BENCHMARK_STARTUP:
59 return kConfigCategoryBenchmarkStartup; 60 return kConfigCategoryBenchmarkStartup;
60 case BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC: 61 case BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC:
61 return kConfigCategoryBenchmarkBlinkGC; 62 return kConfigCategoryBenchmarkBlinkGC;
63 case BackgroundTracingConfigImpl::BENCHMARK_MEMORY_HEAVY:
64 return kConfigCategoryBenchmarkMemoryHeavy;
62 case BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC: 65 case BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC:
63 return kConfigCategoryBenchmarkExecutionMetric; 66 return kConfigCategoryBenchmarkExecutionMetric;
64 case BackgroundTracingConfigImpl::BLINK_STYLE: 67 case BackgroundTracingConfigImpl::BLINK_STYLE:
65 return kConfigCategoryBlinkStyle; 68 return kConfigCategoryBlinkStyle;
66 case BackgroundTracingConfigImpl::CATEGORY_PRESET_UNSET: 69 case BackgroundTracingConfigImpl::CATEGORY_PRESET_UNSET:
67 NOTREACHED(); 70 NOTREACHED();
68 } 71 }
69 NOTREACHED(); 72 NOTREACHED();
70 return ""; 73 return "";
71 } 74 }
(...skipping 24 matching lines...) Expand all
96 if (category_preset_string == kConfigCategoryBenchmarkStartup) { 99 if (category_preset_string == kConfigCategoryBenchmarkStartup) {
97 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_STARTUP; 100 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_STARTUP;
98 return true; 101 return true;
99 } 102 }
100 103
101 if (category_preset_string == kConfigCategoryBenchmarkBlinkGC) { 104 if (category_preset_string == kConfigCategoryBenchmarkBlinkGC) {
102 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC; 105 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC;
103 return true; 106 return true;
104 } 107 }
105 108
109 if (category_preset_string == kConfigCategoryBenchmarkMemoryHeavy) {
110 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_MEMORY_HEAVY;
111 return true;
112 }
113
106 if (category_preset_string == kConfigCategoryBenchmarkExecutionMetric) { 114 if (category_preset_string == kConfigCategoryBenchmarkExecutionMetric) {
107 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC; 115 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC;
108 return true; 116 return true;
109 } 117 }
110 118
111 if (category_preset_string == kConfigCategoryBlinkStyle) { 119 if (category_preset_string == kConfigCategoryBlinkStyle) {
112 *category_preset = BackgroundTracingConfigImpl::BLINK_STYLE; 120 *category_preset = BackgroundTracingConfigImpl::BLINK_STYLE;
113 return true; 121 return true;
114 } 122 }
115 123
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 config->AddReactiveRule(config_dict, new_category_preset); 265 config->AddReactiveRule(config_dict, new_category_preset);
258 } 266 }
259 267
260 if (config->rules().empty()) 268 if (config->rules().empty())
261 return nullptr; 269 return nullptr;
262 270
263 return config; 271 return config;
264 } 272 }
265 273
266 } // namspace content 274 } // namspace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698