Commit 14ce0d3e authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Revert "Update the GPU process termination code in the GPU watchdog."

This reverts commit d2e5eb35.

Reason for revert: <This CL changes the magic signatures in the crash report. Now [GPU hang] becomes [Dump without crash]. Also all signatures that used to show in the hanging functions are now combined into one watchdog function DeliberatelyTerminateToRecoverFromHang(). This is not what it is supposed to be in the crash reports.>

Original change's description:
> Update the GPU process termination code in the GPU watchdog.
> 
> Remove the old code "*((volatile int*)0) = 0x1337" so the crash is
> separated from other EXCEPTION_ACCESS_VIOLATION buckets for UMA analysis.
> Use DumpWithoutCrashing() then TerminateProcess instead.
> 
> Bug: 949839
> Change-Id: I29c735aea2d2063043e6a5da80842d62dddf2e34
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1940552
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Reviewed-by: Will Harris <wfh@chromium.org>
> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
> Commit-Queue: Maggie Chen <magchen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#723219}

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

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

Bug: 949839
Change-Id: Ief563313ec634a45f5710ab6ebfa5dacfcf11c72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962981Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724102}
parent d7fab5c5
......@@ -61,7 +61,6 @@
#include "gpu/config/gpu_finch_features.h"
#include "gpu/config/gpu_preferences.h"
#include "gpu/ipc/common/gpu_client_ids.h"
#include "gpu/ipc/common/result_codes.h"
#include "gpu/ipc/host/shader_disk_cache.h"
#include "gpu/ipc/in_process_command_buffer.h"
#include "media/base/media_switches.h"
......@@ -112,11 +111,6 @@ int GpuProcessHost::hardware_accelerated_recent_crash_count_ = 0;
int GpuProcessHost::swiftshader_recent_crash_count_ = 0;
int GpuProcessHost::display_compositor_recent_crash_count_ = 0;
// RESULT_CODE_HUNG is expected to be the same in both
// gpu/ipc/common/result_codes.h and gpu/ipc/common/result_codes.h
static_assert(RESULT_CODE_HUNG == static_cast<int>(gpu::RESULT_CODE_HUNG),
"Please use the same enum value in both header files.");
namespace {
// UMA histogram names.
......
......@@ -85,7 +85,6 @@ source_set("ipc_common_sources") {
"gpu_watchdog_timeout.h",
"memory_stats.cc",
"memory_stats.h",
"result_codes.h",
]
if (is_mac) {
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef GPU_IPC_COMMON_RESULT_CODES_H_
#define GPU_IPC_COMMON_RESULT_CODES_H_
namespace gpu {
// This is the same as content::RESULT_CODE_HUNG in
// content/public/common/result_codes.h
enum ResultCode {
// Process hung.
RESULT_CODE_HUNG = 2,
};
} // namespace gpu
#endif // GPU_IPC_COMMON_RESULT_CODES_H_
......@@ -7,13 +7,11 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/debug/alias.h"
#include "base/debug/dump_without_crashing.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/message_loop/message_loop_current.h"
#include "base/metrics/histogram_functions.h"
#include "base/power_monitor/power_monitor.h"
#include "base/process/process.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
......@@ -21,7 +19,6 @@
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "gpu/config/gpu_crash_keys.h"
#include "gpu/ipc/common/result_codes.h"
#include "ui/gl/shader_tracking.h"
#if defined(OS_WIN)
......@@ -452,12 +449,8 @@ void GpuWatchdogThreadImplV1::DeliberatelyTerminateToRecoverFromHang() {
GpuWatchdogHistogram(GpuWatchdogThreadEvent::kGpuWatchdogKill);
// Use RESULT_CODE_HUNG so this crash is separated from other
// EXCEPTION_ACCESS_VIOLATION buckets for UMA analysis.
// Create a crash dump first. TerminateCurrentProcessImmediately will not
// create a dump.
base::debug::DumpWithoutCrashing();
base::Process::TerminateCurrentProcessImmediately(RESULT_CODE_HUNG);
// Deliberately crash the process to create a crash dump.
*((volatile int*)0) = 0x1337;
terminated = true;
}
......
......@@ -9,21 +9,18 @@
#include "base/bind_helpers.h"
#include "base/bit_cast.h"
#include "base/debug/alias.h"
#include "base/debug/dump_without_crashing.h"
#include "base/files/file_path.h"
#include "base/message_loop/message_loop_current.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/persistent_histogram_allocator.h"
#include "base/native_library.h"
#include "base/power_monitor/power_monitor.h"
#include "base/process/process.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "gpu/config/gpu_crash_keys.h"
#include "gpu/ipc/common/result_codes.h"
namespace gpu {
......@@ -582,12 +579,8 @@ void GpuWatchdogThreadImplV2::DeliberatelyTerminateToRecoverFromHang() {
crash_keys::gpu_watchdog_kill_after_power_resume.Set(
WithinOneMinFromPowerResumed() ? "1" : "0");
// Use RESULT_CODE_HUNG so this crash is separated from other
// EXCEPTION_ACCESS_VIOLATION buckets for UMA analysis.
// Create a crash dump first. TerminateCurrentProcessImmediately will not
// create a dump.
base::debug::DumpWithoutCrashing();
base::Process::TerminateCurrentProcessImmediately(RESULT_CODE_HUNG);
// Deliberately crash the process to create a crash dump.
*((volatile int*)0) = 0xdeadface;
}
void GpuWatchdogThreadImplV2::GpuWatchdogHistogram(
......
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