Commit cfba82bf authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Add GPU.WatchdogThread.WaitTime histogram

Bug: 949839
Change-Id: Ie6a8fe29ff2adedc08910834cebe831050e14b8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2097247Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749171}
parent fd181b21
...@@ -741,6 +741,10 @@ void GpuWatchdogThreadImplV2::WatchedThreadNeedsMoreThreadTimeHistogram( ...@@ -741,6 +741,10 @@ void GpuWatchdogThreadImplV2::WatchedThreadNeedsMoreThreadTimeHistogram(
// number to calculate the number of users who had already quit. // number to calculate the number of users who had already quit.
RecordNumOfUsersWaitingWithExtraThreadTimeHistogram( RecordNumOfUsersWaitingWithExtraThreadTimeHistogram(
count_of_more_gpu_thread_time_allowed_); count_of_more_gpu_thread_time_allowed_);
// Used by GPU.WatchdogThread.WaitTime later
time_in_wait_for_full_thread_time_ =
count_of_more_gpu_thread_time_allowed_ * watchdog_timeout_;
} }
} }
} }
...@@ -761,6 +765,23 @@ void GpuWatchdogThreadImplV2::WatchedThreadGetsExtraTimeoutHistogram( ...@@ -761,6 +765,23 @@ void GpuWatchdogThreadImplV2::WatchedThreadGetsExtraTimeoutHistogram(
GpuWatchdogTimeoutHistogram(GpuWatchdogTimeoutEvent::kProgressAfterWait); GpuWatchdogTimeoutHistogram(GpuWatchdogTimeoutEvent::kProgressAfterWait);
base::UmaHistogramExactLinear( base::UmaHistogramExactLinear(
"GPU.WatchdogThread.WaitTime.ProgressAfterWait", count, kMax); "GPU.WatchdogThread.WaitTime.ProgressAfterWait", count, kMax);
#if defined(OS_WIN)
// Add the time the GPU thread was given for the full thread time up to 60
// seconds. GPU.WatchdogThread.WaitTime is essentially equal to
// GPU.WatchdogThread.WaitTime.ProgressAfterWait on non-Windows systems.
base::TimeDelta wait_time = base::TimeDelta::FromSeconds(count);
wait_time += time_in_wait_for_full_thread_time_;
constexpr base::TimeDelta kMinTime = base::TimeDelta::FromSeconds(1);
constexpr base::TimeDelta kMaxTime = base::TimeDelta::FromSeconds(150);
constexpr int kBuckets = 50;
// The time the GPU main thread takes to finish a task after a "hang" is
// dectedted.
base::UmaHistogramCustomTimes("GPU.WatchdogThread.WaitTime", wait_time,
kMinTime, kMaxTime, kBuckets);
#endif
} }
} }
} }
......
...@@ -168,6 +168,10 @@ class GPU_IPC_SERVICE_EXPORT GpuWatchdogThreadImplV2 ...@@ -168,6 +168,10 @@ class GPU_IPC_SERVICE_EXPORT GpuWatchdogThreadImplV2
// continue due to not enough thread time. // continue due to not enough thread time.
int count_of_more_gpu_thread_time_allowed_ = 0; int count_of_more_gpu_thread_time_allowed_ = 0;
// The total timeout, up to 60 seconds, the watchdog thread waits for the GPU
// main thread to get full thread time.
base::TimeDelta time_in_wait_for_full_thread_time_;
// After detecting GPU hang and continuing running through // After detecting GPU hang and continuing running through
// OnGpuWatchdogTimeout for the max cycles, the GPU main thread still cannot // OnGpuWatchdogTimeout for the max cycles, the GPU main thread still cannot
// get the full thread time. // get the full thread time.
......
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