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

Unified Diff: content/gpu/gpu_watchdog_thread.cc

Issue 1804303002: Save variables on stack to help determine why GPU watchdog is firing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « content/gpu/gpu_watchdog_thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(&current_time);
+ base::debug::Alias(&current_timeticks);
+
LOG(ERROR) << "The GPU process hung. Terminating after "
<< timeout_.InMilliseconds() << " ms.";
« no previous file with comments | « content/gpu/gpu_watchdog_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698