Index: content/gpu/gpu_watchdog_thread.cc |
diff --git a/content/gpu/gpu_watchdog_thread.cc b/content/gpu/gpu_watchdog_thread.cc |
index 08545c3b7c8adccb7beaba989d57e7b85101e73f..4ffec06ee5773a8e71a5132c2013acf24be9c9fd 100644 |
--- a/content/gpu/gpu_watchdog_thread.cc |
+++ b/content/gpu/gpu_watchdog_thread.cc |
@@ -11,6 +11,7 @@ |
#include "base/bind_helpers.h" |
#include "base/command_line.h" |
#include "base/compiler_specific.h" |
+#include "base/debug/alias.h" |
#include "base/files/file_util.h" |
#include "base/location.h" |
#include "base/macros.h" |
@@ -208,9 +209,12 @@ void GpuWatchdogThread::OnCheck(bool after_suspend) { |
#if defined(OS_WIN) |
arm_cpu_time_ = GetWatchedThreadTime(); |
+ |
+ QueryUnbiasedInterruptTime(&arm_interrupt_time_); |
#endif |
check_time_ = base::Time::Now(); |
+ check_timeticks_ = base::TimeTicks::Now(); |
// Immediately after the computer is woken up from being suspended it might |
// be pretty sluggish, so allow some extra time before the next timeout. |
base::TimeDelta timeout = timeout_ * (after_suspend ? 3 : 1); |
@@ -333,6 +337,28 @@ void GpuWatchdogThread::DeliberatelyTerminateToRecoverFromHang() { |
} |
#endif |
+// Store variables so they're available in crash dumps to help determine the |
+// cause of any hang. |
+#if defined(OS_WIN) |
+ ULONGLONG fire_interrupt_time; |
+ QueryUnbiasedInterruptTime(&fire_interrupt_time); |
+ |
+ // This is the time since the watchdog was armed, in 100ns intervals, |
+ // ignoring time where the computer is suspended. |
+ ULONGLONG interrupt_delay = fire_interrupt_time - arm_interrupt_time_; |
+ |
+ base::debug::Alias(&interrupt_delay); |
+ base::debug::Alias(&time_since_arm); |
+ |
+ bool using_high_res_timer = base::Time::IsHighResolutionTimerInUse(); |
+ base::debug::Alias(&using_high_res_timer); |
+#endif |
+ |
+ base::Time current_time = base::Time::Now(); |
+ base::TimeTicks current_timeticks = base::TimeTicks::Now(); |
+ base::debug::Alias(¤t_time); |
+ base::debug::Alias(¤t_timeticks); |
+ |
LOG(ERROR) << "The GPU process hung. Terminating after " |
<< timeout_.InMilliseconds() << " ms."; |