OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/gpu/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 histogram_pointer = base::LinearHistogram::FactoryGet( | 202 histogram_pointer = base::LinearHistogram::FactoryGet( |
203 kGpuBlacklistFeatureHistogramNamesWin[i], 1, | 203 kGpuBlacklistFeatureHistogramNamesWin[i], 1, |
204 kNumWinSubVersions * gpu::kGpuFeatureStatusMax, | 204 kNumWinSubVersions * gpu::kGpuFeatureStatusMax, |
205 kNumWinSubVersions * gpu::kGpuFeatureStatusMax + 1, | 205 kNumWinSubVersions * gpu::kGpuFeatureStatusMax + 1, |
206 base::HistogramBase::kUmaTargetedHistogramFlag); | 206 base::HistogramBase::kUmaTargetedHistogramFlag); |
207 histogram_pointer->Add(GetGpuBlacklistHistogramValueWin(value)); | 207 histogram_pointer->Add(GetGpuBlacklistHistogramValueWin(value)); |
208 #endif | 208 #endif |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 void UpdateDriverBugListStats(const gpu::GpuDriverBugList* bug_list, | |
213 const std::set<int>& blacklisted_features) { | |
Zhenyao Mo
2017/05/04 17:32:36
maybe rename blacklisted_features to workarounds o
| |
214 uint32_t max_entry_id = bug_list->max_entry_id(); | |
215 if (max_entry_id == 0) { | |
216 // GPU Blacklist was not loaded. No need to go further. | |
Zhenyao Mo
2017/05/04 17:32:36
nit: Blacklist -> driver bug list
| |
217 return; | |
218 } | |
219 | |
220 // Use entry 0 to capture the total number of times that data | |
221 // was recorded in this histogram in order to have a convenient | |
222 // denominator to compute blacklist percentages for the rest of the | |
Zhenyao Mo
2017/05/04 17:32:36
nit: blacklist -> driver bug list
| |
223 // entries. | |
224 UMA_HISTOGRAM_SPARSE_SLOWLY("GPU.DriverBugTestResultsPerEntry", 0); | |
225 | |
226 if (blacklisted_features.size() != 0) { | |
227 std::vector<uint32_t> flag_entries; | |
228 bug_list->GetDecisionEntries(&flag_entries); | |
229 DCHECK_GT(flag_entries.size(), 0u); | |
230 for (size_t i = 0; i < flag_entries.size(); ++i) { | |
231 UMA_HISTOGRAM_SPARSE_SLOWLY("GPU.DriverBugTestResultsPerEntry", | |
232 flag_entries[i]); | |
233 } | |
234 } | |
235 } | |
236 | |
212 // Combine the integers into a string, seperated by ','. | 237 // Combine the integers into a string, seperated by ','. |
213 std::string IntSetToString(const std::set<int>& list) { | 238 std::string IntSetToString(const std::set<int>& list) { |
214 std::string rt; | 239 std::string rt; |
215 for (std::set<int>::const_iterator it = list.begin(); | 240 for (std::set<int>::const_iterator it = list.begin(); |
216 it != list.end(); ++it) { | 241 it != list.end(); ++it) { |
217 if (!rt.empty()) | 242 if (!rt.empty()) |
218 rt += ","; | 243 rt += ","; |
219 rt += base::IntToString(*it); | 244 rt += base::IntToString(*it); |
220 } | 245 } |
221 return rt; | 246 return rt; |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
678 disabled_command_line_exts.end()); | 703 disabled_command_line_exts.end()); |
679 } | 704 } |
680 | 705 |
681 if (gpu_driver_bug_list_) { | 706 if (gpu_driver_bug_list_) { |
682 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( | 707 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( |
683 gpu::GpuControlList::kOsAny, os_version, gpu_info_); | 708 gpu::GpuControlList::kOsAny, os_version, gpu_info_); |
684 | 709 |
685 disabled_driver_bug_exts = gpu_driver_bug_list_->GetDisabledExtensions(); | 710 disabled_driver_bug_exts = gpu_driver_bug_list_->GetDisabledExtensions(); |
686 disabled_ext_set.insert(disabled_driver_bug_exts.begin(), | 711 disabled_ext_set.insert(disabled_driver_bug_exts.begin(), |
687 disabled_driver_bug_exts.end()); | 712 disabled_driver_bug_exts.end()); |
713 UpdateDriverBugListStats(gpu_driver_bug_list_.get(), gpu_driver_bugs_); | |
688 } | 714 } |
689 disabled_extensions_ = | 715 disabled_extensions_ = |
690 base::JoinString(std::vector<base::StringPiece>(disabled_ext_set.begin(), | 716 base::JoinString(std::vector<base::StringPiece>(disabled_ext_set.begin(), |
691 disabled_ext_set.end()), | 717 disabled_ext_set.end()), |
692 " "); | 718 " "); |
693 | 719 |
694 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 720 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
695 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); | 721 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); |
696 | 722 |
697 // We have to update GpuFeatureType before notify all the observers. | 723 // We have to update GpuFeatureType before notify all the observers. |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1384 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1410 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1385 #if defined(OS_WIN) | 1411 #if defined(OS_WIN) |
1386 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1412 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1387 #endif | 1413 #endif |
1388 complete_gpu_info_already_requested_ = true; | 1414 complete_gpu_info_already_requested_ = true; |
1389 // Some observers might be waiting. | 1415 // Some observers might be waiting. |
1390 NotifyGpuInfoUpdate(); | 1416 NotifyGpuInfoUpdate(); |
1391 } | 1417 } |
1392 | 1418 |
1393 } // namespace content | 1419 } // namespace content |
OLD | NEW |