OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/metrics/perf/perf_provider_chromeos.h" | 5 #include "chrome/browser/metrics/perf/perf_provider_chromeos.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 int32_t* minor_version, | 114 int32_t* minor_version, |
115 int32_t* bugfix_version) { | 115 int32_t* bugfix_version) { |
116 *major_version = *minor_version = *bugfix_version = 0; | 116 *major_version = *minor_version = *bugfix_version = 0; |
117 // Parse out the version numbers from the string. | 117 // Parse out the version numbers from the string. |
118 sscanf(version.c_str(), "%d.%d.%d", major_version, minor_version, | 118 sscanf(version.c_str(), "%d.%d.%d", major_version, minor_version, |
119 bugfix_version); | 119 bugfix_version); |
120 } | 120 } |
121 | 121 |
122 // Returns if a micro-architecture supports LBR callgraph profiling. | 122 // Returns if a micro-architecture supports LBR callgraph profiling. |
123 bool MicroarchitectureHasLBRCallgraph(const std::string& uarch) { | 123 bool MicroarchitectureHasLBRCallgraph(const std::string& uarch) { |
124 return uarch == "Haswell" || uarch == "Broadwell" || uarch == "Skylake"; | 124 return uarch == "Haswell" || uarch == "Broadwell" || uarch == "Skylake" || |
| 125 uarch == "Kabylake"; |
125 } | 126 } |
126 | 127 |
127 // Returns if a kernel release supports LBR callgraph profiling. | 128 // Returns if a kernel release supports LBR callgraph profiling. |
128 bool KernelReleaseHasLBRCallgraph(const std::string& release) { | 129 bool KernelReleaseHasLBRCallgraph(const std::string& release) { |
129 int32_t major, minor, bugfix; | 130 int32_t major, minor, bugfix; |
130 ExtractVersionNumbers(release, &major, &minor, &bugfix); | 131 ExtractVersionNumbers(release, &major, &minor, &bugfix); |
131 return major > 4 || (major == 4 && minor >= 4) || (major == 3 && minor == 18); | 132 return major > 4 || (major == 4 && minor >= 4) || (major == 3 && minor == 18); |
132 } | 133 } |
133 | 134 |
134 // Hopefully we never need a space in a command argument. | 135 // Hopefully we never need a space in a command argument. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 intel_uarch == "Broadwell") { | 189 intel_uarch == "Broadwell") { |
189 cmds.push_back(WeightAndValue(45.0, kPerfRecordCyclesCmd)); | 190 cmds.push_back(WeightAndValue(45.0, kPerfRecordCyclesCmd)); |
190 cmds.push_back(WeightAndValue(20.0, callgraph_cmd)); | 191 cmds.push_back(WeightAndValue(20.0, callgraph_cmd)); |
191 cmds.push_back(WeightAndValue(15.0, kPerfRecordLBRCmd)); | 192 cmds.push_back(WeightAndValue(15.0, kPerfRecordLBRCmd)); |
192 cmds.push_back(WeightAndValue(5.0, kPerfRecordInstructionTLBMissesCmd)); | 193 cmds.push_back(WeightAndValue(5.0, kPerfRecordInstructionTLBMissesCmd)); |
193 cmds.push_back(WeightAndValue(5.0, kPerfRecordDataTLBMissesCmd)); | 194 cmds.push_back(WeightAndValue(5.0, kPerfRecordDataTLBMissesCmd)); |
194 cmds.push_back(WeightAndValue(5.0, kPerfStatMemoryBandwidthCmd)); | 195 cmds.push_back(WeightAndValue(5.0, kPerfStatMemoryBandwidthCmd)); |
195 cmds.push_back(WeightAndValue(5.0, kPerfRecordCacheMissesCmd)); | 196 cmds.push_back(WeightAndValue(5.0, kPerfRecordCacheMissesCmd)); |
196 return cmds; | 197 return cmds; |
197 } | 198 } |
198 if (intel_uarch == "SandyBridge" || intel_uarch == "Skylake") { | 199 if (intel_uarch == "SandyBridge" || intel_uarch == "Skylake" || |
| 200 intel_uarch == "Kabylake") { |
199 cmds.push_back(WeightAndValue(50.0, kPerfRecordCyclesCmd)); | 201 cmds.push_back(WeightAndValue(50.0, kPerfRecordCyclesCmd)); |
200 cmds.push_back(WeightAndValue(20.0, callgraph_cmd)); | 202 cmds.push_back(WeightAndValue(20.0, callgraph_cmd)); |
201 cmds.push_back(WeightAndValue(15.0, kPerfRecordLBRCmd)); | 203 cmds.push_back(WeightAndValue(15.0, kPerfRecordLBRCmd)); |
202 cmds.push_back(WeightAndValue(5.0, kPerfRecordInstructionTLBMissesCmd)); | 204 cmds.push_back(WeightAndValue(5.0, kPerfRecordInstructionTLBMissesCmd)); |
203 cmds.push_back(WeightAndValue(5.0, kPerfRecordDataTLBMissesCmd)); | 205 cmds.push_back(WeightAndValue(5.0, kPerfRecordDataTLBMissesCmd)); |
204 cmds.push_back(WeightAndValue(5.0, kPerfRecordCacheMissesCmd)); | 206 cmds.push_back(WeightAndValue(5.0, kPerfRecordCacheMissesCmd)); |
205 return cmds; | 207 return cmds; |
206 } | 208 } |
207 if (intel_uarch == "Silvermont" || intel_uarch == "Airmont") { | 209 if (intel_uarch == "Silvermont" || intel_uarch == "Airmont" || |
| 210 intel_uarch == "Goldmont") { |
208 cmds.push_back(WeightAndValue(50.0, kPerfRecordCyclesCmd)); | 211 cmds.push_back(WeightAndValue(50.0, kPerfRecordCyclesCmd)); |
209 cmds.push_back(WeightAndValue(20.0, callgraph_cmd)); | 212 cmds.push_back(WeightAndValue(20.0, callgraph_cmd)); |
210 cmds.push_back(WeightAndValue(15.0, kPerfRecordLBRCmdAtom)); | 213 cmds.push_back(WeightAndValue(15.0, kPerfRecordLBRCmdAtom)); |
211 cmds.push_back(WeightAndValue(5.0, kPerfRecordInstructionTLBMissesCmd)); | 214 cmds.push_back(WeightAndValue(5.0, kPerfRecordInstructionTLBMissesCmd)); |
212 cmds.push_back(WeightAndValue(5.0, kPerfRecordDataTLBMissesCmd)); | 215 cmds.push_back(WeightAndValue(5.0, kPerfRecordDataTLBMissesCmd)); |
213 cmds.push_back(WeightAndValue(5.0, kPerfRecordCacheMissesCmd)); | 216 cmds.push_back(WeightAndValue(5.0, kPerfRecordCacheMissesCmd)); |
214 return cmds; | 217 return cmds; |
215 } | 218 } |
216 // Other 64-bit x86 | 219 // Other 64-bit x86 |
217 cmds.push_back(WeightAndValue(65.0, kPerfRecordCyclesCmd)); | 220 cmds.push_back(WeightAndValue(65.0, kPerfRecordCyclesCmd)); |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 std::unique_ptr<SampledProfile> sampled_profile(new SampledProfile); | 754 std::unique_ptr<SampledProfile> sampled_profile(new SampledProfile); |
752 sampled_profile->set_trigger_event(SampledProfile::RESTORE_SESSION); | 755 sampled_profile->set_trigger_event(SampledProfile::RESTORE_SESSION); |
753 sampled_profile->set_ms_after_restore(time_after_restore.InMilliseconds()); | 756 sampled_profile->set_ms_after_restore(time_after_restore.InMilliseconds()); |
754 sampled_profile->set_num_tabs_restored(num_tabs_restored); | 757 sampled_profile->set_num_tabs_restored(num_tabs_restored); |
755 | 758 |
756 CollectIfNecessary(std::move(sampled_profile)); | 759 CollectIfNecessary(std::move(sampled_profile)); |
757 last_session_restore_collection_time_ = base::TimeTicks::Now(); | 760 last_session_restore_collection_time_ = base::TimeTicks::Now(); |
758 } | 761 } |
759 | 762 |
760 } // namespace metrics | 763 } // namespace metrics |
OLD | NEW |