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

Unified Diff: gpu/config/gpu_util.cc

Issue 2751103008: gpu: Add a util method to set crash-keys from a GPUInfo. (Closed)
Patch Set: comment Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/config/gpu_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_util.cc
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
index a305c29698a9baa8e1a72d17c3427712ccf81de0..da0d3a8059ad7e4bb2df0e4e6b4ccdf5072873e0 100644
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -8,13 +8,16 @@
#include <vector>
#include "base/command_line.h"
+#include "base/debug/crash_logging.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
+#include "base/strings/stringprintf.h"
#include "base/sys_info.h"
#include "gpu/config/gpu_blacklist.h"
#include "gpu/config/gpu_control_list_jsons.h"
+#include "gpu/config/gpu_crash_keys.h"
#include "gpu/config/gpu_driver_bug_list.h"
#include "gpu/config/gpu_feature_type.h"
#include "gpu/config/gpu_finch_features.h"
@@ -199,4 +202,27 @@ GpuFeatureInfo GetGpuFeatureInfo(const GPUInfo& gpu_info,
return gpu_feature_info;
}
+void SetKeysForCrashLogging(const GPUInfo& gpu_info) {
+#if !defined(OS_ANDROID)
+ base::debug::SetCrashKeyValue(
+ crash_keys::kGPUVendorID,
+ base::StringPrintf("0x%04x", gpu_info.gpu.vendor_id));
+ base::debug::SetCrashKeyValue(
+ crash_keys::kGPUDeviceID,
+ base::StringPrintf("0x%04x", gpu_info.gpu.device_id));
+#endif
+ base::debug::SetCrashKeyValue(crash_keys::kGPUDriverVersion,
+ gpu_info.driver_version);
+ base::debug::SetCrashKeyValue(crash_keys::kGPUPixelShaderVersion,
+ gpu_info.pixel_shader_version);
+ base::debug::SetCrashKeyValue(crash_keys::kGPUVertexShaderVersion,
+ gpu_info.vertex_shader_version);
+#if defined(OS_MACOSX)
+ base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version);
+#elif defined(OS_POSIX)
+ base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor);
+ base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer);
+#endif
+}
+
} // namespace gpu
« no previous file with comments | « gpu/config/gpu_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698