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

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 2841273002: Add UMA histograms for GPU driver bug workaround entries. (Closed)
Patch Set: fix nits Created 3 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 (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
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>& workarounds) {
214 uint32_t max_entry_id = bug_list->max_entry_id();
215 if (max_entry_id == 0) {
216 // Driver bug list was not loaded. No need to go further.
217 return;
218 }
219
220 // Use entry 0 to capture the total number of times that data was recorded
221 // in this histogram in order to have a convenient denominator to compute
222 // driver bug list percentages for the rest of the entries.
223 UMA_HISTOGRAM_SPARSE_SLOWLY("GPU.DriverBugTestResultsPerEntry", 0);
224
225 if (workarounds.size() != 0) {
226 std::vector<uint32_t> flag_entries;
227 bug_list->GetDecisionEntries(&flag_entries);
Ilya Sherman 2017/05/04 21:17:38 It's not entirely clear to me: Are the ids used in
228 DCHECK_GT(flag_entries.size(), 0u);
229 for (size_t i = 0; i < flag_entries.size(); ++i) {
230 UMA_HISTOGRAM_SPARSE_SLOWLY("GPU.DriverBugTestResultsPerEntry",
231 flag_entries[i]);
232 }
233 }
234 }
235
212 // Combine the integers into a string, seperated by ','. 236 // Combine the integers into a string, seperated by ','.
213 std::string IntSetToString(const std::set<int>& list) { 237 std::string IntSetToString(const std::set<int>& list) {
214 std::string rt; 238 std::string rt;
215 for (std::set<int>::const_iterator it = list.begin(); 239 for (std::set<int>::const_iterator it = list.begin();
216 it != list.end(); ++it) { 240 it != list.end(); ++it) {
217 if (!rt.empty()) 241 if (!rt.empty())
218 rt += ","; 242 rt += ",";
219 rt += base::IntToString(*it); 243 rt += base::IntToString(*it);
220 } 244 }
221 return rt; 245 return rt;
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 disabled_command_line_exts.end()); 702 disabled_command_line_exts.end());
679 } 703 }
680 704
681 if (gpu_driver_bug_list_) { 705 if (gpu_driver_bug_list_) {
682 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( 706 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision(
683 gpu::GpuControlList::kOsAny, os_version, gpu_info_); 707 gpu::GpuControlList::kOsAny, os_version, gpu_info_);
684 708
685 disabled_driver_bug_exts = gpu_driver_bug_list_->GetDisabledExtensions(); 709 disabled_driver_bug_exts = gpu_driver_bug_list_->GetDisabledExtensions();
686 disabled_ext_set.insert(disabled_driver_bug_exts.begin(), 710 disabled_ext_set.insert(disabled_driver_bug_exts.begin(),
687 disabled_driver_bug_exts.end()); 711 disabled_driver_bug_exts.end());
712 UpdateDriverBugListStats(gpu_driver_bug_list_.get(), gpu_driver_bugs_);
688 } 713 }
689 disabled_extensions_ = 714 disabled_extensions_ =
690 base::JoinString(std::vector<base::StringPiece>(disabled_ext_set.begin(), 715 base::JoinString(std::vector<base::StringPiece>(disabled_ext_set.begin(),
691 disabled_ext_set.end()), 716 disabled_ext_set.end()),
692 " "); 717 " ");
693 718
694 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( 719 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine(
695 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); 720 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess());
696 721
697 // We have to update GpuFeatureType before notify all the observers. 722 // We have to update GpuFeatureType before notify all the observers.
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; 1409 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure;
1385 #if defined(OS_WIN) 1410 #if defined(OS_WIN)
1386 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; 1411 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure;
1387 #endif 1412 #endif
1388 complete_gpu_info_already_requested_ = true; 1413 complete_gpu_info_already_requested_ = true;
1389 // Some observers might be waiting. 1414 // Some observers might be waiting.
1390 NotifyGpuInfoUpdate(); 1415 NotifyGpuInfoUpdate();
1391 } 1416 }
1392 1417
1393 } // namespace content 1418 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698