Commit 13c6f13a authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Revert "Record the GPU watchdog arm_disarm_counter in the main thread"

This reverts commit 15ab8559.

Reason for revert: <The data has been collected from the crash dumps. Debugging code is no longer needed. >

Original change's description:
> Record the GPU watchdog arm_disarm_counter in the main thread
> 
> It is for the debugging purpose only and it wil have a performance impact.
> The code will be removed immediately once valid crash dumps are collected.
> 
> Bug: 885066,885066
> Change-Id: Ie8761ed4e6050a07e76af0a030b67dab5bb011e8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129028
> Commit-Queue: Maggie Chen <magchen@chromium.org>
> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#756461}

TBR=zmo@chromium.org,magchen@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 885066
Change-Id: If5d439c97c3bf4732297b9a756423c18f024b865
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144812Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758004}
parent 25c16305
...@@ -378,12 +378,7 @@ void GpuWatchdogThreadImplV2::UpdateInitializationFlag() { ...@@ -378,12 +378,7 @@ void GpuWatchdogThreadImplV2::UpdateInitializationFlag() {
void GpuWatchdogThreadImplV2::Arm() { void GpuWatchdogThreadImplV2::Arm() {
DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread()); DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
if (hits_termination_.IsSet()) { base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 1);
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 1);
} else {
arm_disarm_counter_main_thread_ =
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 1);
}
// Arm/Disarm are always called in sequence. Now it's an odd number. // Arm/Disarm are always called in sequence. Now it's an odd number.
DCHECK(IsArmed()); DCHECK(IsArmed());
...@@ -392,12 +387,7 @@ void GpuWatchdogThreadImplV2::Arm() { ...@@ -392,12 +387,7 @@ void GpuWatchdogThreadImplV2::Arm() {
void GpuWatchdogThreadImplV2::Disarm() { void GpuWatchdogThreadImplV2::Disarm() {
DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread()); DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
if (hits_termination_.IsSet()) { base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 1);
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 1);
} else {
arm_disarm_counter_main_thread_ =
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 1);
}
// Arm/Disarm are always called in sequence. Now it's an even number. // Arm/Disarm are always called in sequence. Now it's an even number.
DCHECK(!IsArmed()); DCHECK(!IsArmed());
...@@ -407,13 +397,7 @@ void GpuWatchdogThreadImplV2::InProgress() { ...@@ -407,13 +397,7 @@ void GpuWatchdogThreadImplV2::InProgress() {
DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread()); DCHECK(watched_gpu_task_runner_->BelongsToCurrentThread());
// Increment by 2. This is equivalent to Disarm() + Arm(). // Increment by 2. This is equivalent to Disarm() + Arm().
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 2);
if (hits_termination_.IsSet()) {
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 2);
} else {
arm_disarm_counter_main_thread_ =
base::subtle::NoBarrier_AtomicIncrement(&arm_disarm_counter_, 2);
}
// Now it's an odd number. // Now it's an odd number.
DCHECK(IsArmed()); DCHECK(IsArmed());
...@@ -602,10 +586,6 @@ void GpuWatchdogThreadImplV2::DeliberatelyTerminateToRecoverFromHang() { ...@@ -602,10 +586,6 @@ void GpuWatchdogThreadImplV2::DeliberatelyTerminateToRecoverFromHang() {
return; return;
} }
// Debug only. To be deleted
hits_termination_.Set();
base::debug::Alias(&arm_disarm_counter_main_thread_);
#if defined(OS_WIN) #if defined(OS_WIN)
if (IsDebuggerPresent()) if (IsDebuggerPresent())
return; return;
......
...@@ -227,11 +227,6 @@ class GPU_IPC_SERVICE_EXPORT GpuWatchdogThreadImplV2 ...@@ -227,11 +227,6 @@ class GPU_IPC_SERVICE_EXPORT GpuWatchdogThreadImplV2
bool foregrounded_event_ = false; bool foregrounded_event_ = false;
bool power_resumed_event_ = false; bool power_resumed_event_ = false;
// TODO (magche@): Debugging only. This has a measurable performance impact
// and should be removed once valid crash dumps are collected.
base::AtomicFlag hits_termination_;
base::subtle::Atomic32 arm_disarm_counter_main_thread_ = 0;
// For gpu testing only. // For gpu testing only.
const bool is_test_mode_; const bool is_test_mode_;
// Set by the watchdog thread and Read by the test thread. // Set by the watchdog thread and Read by the test thread.
......
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