Commit 7cd2a0a6 authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Record crash_keys::num_of_processors for the GPU watchdog.

Bug:949839

Change-Id: Iea808d532584089d974032e5eef3eeee8eb57a35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2126572Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754645}
parent 5fe1f7d5
...@@ -34,6 +34,7 @@ crash_reporter::CrashKeyString<4> gpu_watchdog_kill_after_power_resume( ...@@ -34,6 +34,7 @@ crash_reporter::CrashKeyString<4> gpu_watchdog_kill_after_power_resume(
"gpu-watchdog-kill-after-power-resume"); "gpu-watchdog-kill-after-power-resume");
crash_reporter::CrashKeyString<4> gpu_watchdog_crashed_in_gpu_init( crash_reporter::CrashKeyString<4> gpu_watchdog_crashed_in_gpu_init(
"gpu-watchdog-crashed-in-gpu-init"); "gpu-watchdog-crashed-in-gpu-init");
crash_reporter::CrashKeyString<16> num_of_processors("num-of-processors");
} // namespace crash_keys } // namespace crash_keys
} // namespace gpu } // namespace gpu
...@@ -39,6 +39,8 @@ extern GPU_EXPORT crash_reporter::CrashKeyString<4> ...@@ -39,6 +39,8 @@ extern GPU_EXPORT crash_reporter::CrashKeyString<4>
gpu_watchdog_kill_after_power_resume; gpu_watchdog_kill_after_power_resume;
extern GPU_EXPORT crash_reporter::CrashKeyString<4> extern GPU_EXPORT crash_reporter::CrashKeyString<4>
gpu_watchdog_crashed_in_gpu_init; gpu_watchdog_crashed_in_gpu_init;
extern GPU_EXPORT crash_reporter::CrashKeyString<16> num_of_processors;
} // namespace crash_keys } // namespace crash_keys
} // namespace gpu } // namespace gpu
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "base/native_library.h" #include "base/native_library.h"
#include "base/power_monitor/power_monitor.h" #include "base/power_monitor/power_monitor.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/system/sys_info.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -37,6 +38,8 @@ GpuWatchdogThreadImplV2::GpuWatchdogThreadImplV2( ...@@ -37,6 +38,8 @@ GpuWatchdogThreadImplV2::GpuWatchdogThreadImplV2(
is_test_mode_(is_test_mode), is_test_mode_(is_test_mode),
watched_gpu_task_runner_(base::ThreadTaskRunnerHandle::Get()) { watched_gpu_task_runner_(base::ThreadTaskRunnerHandle::Get()) {
base::MessageLoopCurrent::Get()->AddTaskObserver(this); base::MessageLoopCurrent::Get()->AddTaskObserver(this);
num_of_processors_ = base::SysInfo::NumberOfProcessors();
#if defined(OS_WIN) #if defined(OS_WIN)
// GetCurrentThread returns a pseudo-handle that cannot be used by one thread // GetCurrentThread returns a pseudo-handle that cannot be used by one thread
// to identify another. DuplicateHandle creates a "real" handle that can be // to identify another. DuplicateHandle creates a "real" handle that can be
...@@ -624,6 +627,8 @@ void GpuWatchdogThreadImplV2::DeliberatelyTerminateToRecoverFromHang() { ...@@ -624,6 +627,8 @@ void GpuWatchdogThreadImplV2::DeliberatelyTerminateToRecoverFromHang() {
crash_keys::gpu_watchdog_kill_after_power_resume.Set( crash_keys::gpu_watchdog_kill_after_power_resume.Set(
WithinOneMinFromPowerResumed() ? "1" : "0"); WithinOneMinFromPowerResumed() ? "1" : "0");
crash_keys::num_of_processors.Set(base::NumberToString(num_of_processors_));
// Check the arm_disarm_counter value one more time. // Check the arm_disarm_counter value one more time.
base::subtle::Atomic32 last_arm_disarm_counter = base::subtle::Atomic32 last_arm_disarm_counter =
base::subtle::NoBarrier_Load(&arm_disarm_counter_); base::subtle::NoBarrier_Load(&arm_disarm_counter_);
......
...@@ -210,6 +210,9 @@ class GPU_IPC_SERVICE_EXPORT GpuWatchdogThreadImplV2 ...@@ -210,6 +210,9 @@ class GPU_IPC_SERVICE_EXPORT GpuWatchdogThreadImplV2
// constructor. // constructor.
bool in_gpu_initialization_ = false; bool in_gpu_initialization_ = false;
// The number of logical processors/cores on the current machine.
unsigned num_of_processors_;
// Don't kill the GPU process immediately after a gpu hang is detected. Wait // Don't kill the GPU process immediately after a gpu hang is detected. Wait
// for extra cycles of timeout. Kill it, if the GPU still doesn't respond // for extra cycles of timeout. Kill it, if the GPU still doesn't respond
// after wait. // after wait.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment