OLD | NEW |
---|---|
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 "chrome/browser/tracing/navigation_tracing.h" | 5 #include "chrome/browser/tracing/navigation_tracing.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 new base::DictionaryValue()); | 75 new base::DictionaryValue()); |
76 rules_dict->SetString("rule", | 76 rules_dict->SetString("rule", |
77 "MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE"); | 77 "MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE"); |
78 rules_dict->SetString("category", "BENCHMARK_MEMORY_HEAVY"); | 78 rules_dict->SetString("category", "BENCHMARK_MEMORY_HEAVY"); |
79 rules_dict->SetString("histogram_name", "V8.GCLowMemoryNotification"); | 79 rules_dict->SetString("histogram_name", "V8.GCLowMemoryNotification"); |
80 rules_dict->SetInteger("trigger_delay", 5); | 80 rules_dict->SetInteger("trigger_delay", 5); |
81 rules_dict->SetInteger("histogram_lower_value", 0); | 81 rules_dict->SetInteger("histogram_lower_value", 0); |
82 rules_dict->SetInteger("histogram_upper_value", 10000); | 82 rules_dict->SetInteger("histogram_upper_value", 10000); |
83 rules_list->Append(std::move(rules_dict)); | 83 rules_list->Append(std::move(rules_dict)); |
84 } | 84 } |
85 { | |
86 std::unique_ptr<base::DictionaryValue> rules_dict( | |
87 new base::DictionaryValue()); | |
88 rules_dict->SetString("rule", | |
89 "MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE"); | |
90 rules_dict->SetString("category", "BENCHMARK_MEMORY_LIGHT"); | |
91 rules_dict->SetString("histogram_name", "V8.GCLowMemoryNotification"); | |
ssid
2016/06/02 00:14:15
Not sure why I should write the rules for low memo
oystein (OOO til 10th of July)
2016/06/02 06:11:33
Unfortunate legacy naming. Navigation tracing is w
oystein (OOO til 10th of July)
2016/06/02 06:11:33
Also: Two different trigger with the same conditio
ssid
2016/06/03 06:34:33
Sorry about this confusion. This rule shouldn't be
| |
92 rules_dict->SetInteger("trigger_delay", 30); | |
93 rules_dict->SetInteger("histogram_lower_value", 0); | |
94 rules_dict->SetInteger("histogram_upper_value", 10000); | |
95 rules_list->Append(std::move(rules_dict)); | |
96 } | |
85 dict.Set("configs", std::move(rules_list)); | 97 dict.Set("configs", std::move(rules_list)); |
86 | 98 |
87 std::unique_ptr<content::BackgroundTracingConfig> config( | 99 std::unique_ptr<content::BackgroundTracingConfig> config( |
88 content::BackgroundTracingConfig::FromDict(&dict)); | 100 content::BackgroundTracingConfig::FromDict(&dict)); |
89 DCHECK(config); | 101 DCHECK(config); |
90 | 102 |
91 content::BackgroundTracingManager::GetInstance()->SetActiveScenario( | 103 content::BackgroundTracingManager::GetInstance()->SetActiveScenario( |
92 std::move(config), base::Bind(&UploadCallback), | 104 std::move(config), base::Bind(&UploadCallback), |
93 content::BackgroundTracingManager::NO_DATA_FILTERING); | 105 content::BackgroundTracingManager::NO_DATA_FILTERING); |
94 } | 106 } |
(...skipping 24 matching lines...) Expand all Loading... | |
119 content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent( | 131 content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent( |
120 navigation_handle, | 132 navigation_handle, |
121 content::BackgroundTracingManager::StartedFinalizingCallback()); | 133 content::BackgroundTracingManager::StartedFinalizingCallback()); |
122 } | 134 } |
123 } | 135 } |
124 | 136 |
125 content::BackgroundTracingManager::TriggerHandle | 137 content::BackgroundTracingManager::TriggerHandle |
126 NavigationTracingObserver::navigation_handle = -1; | 138 NavigationTracingObserver::navigation_handle = -1; |
127 | 139 |
128 } // namespace tracing | 140 } // namespace tracing |
OLD | NEW |