Commit 91c22dbf authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Remove hang watching of deprecated BrowserThreads.

This is a partial reland of https://chromium-review.googlesource.com/c/chromium/src/+/705775

That CL caused issue 768886 (spike in hang reports). I suspect this
was caused by a change in enum IDs rather than this change to the
hang watching code and this CL will help narrow down the cause.

R=asvitkine@chromium.org

NOPRESUBMIT=TRUE (shuffling of code using deprecated BrowserThread IDs)

Bug: 689520,768886
Change-Id: Id7bf1c7b5f5d34c4b1e7b1e71e9b015725695997
Reviewed-on: https://chromium-review.googlesource.com/743846
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512509}
parent f483b30b
......@@ -466,13 +466,11 @@ void ThreadWatcherList::ParseCommandLine(
crash_on_hang_thread_names =
command_line.GetSwitchValueASCII(switches::kCrashOnHangThreads);
} else if (channel != version_info::Channel::STABLE) {
// Default to crashing the browser if UI or IO or FILE threads are not
// responsive except in stable channel.
crash_on_hang_thread_names = base::StringPrintf(
"UI:%d:%d,IO:%d:%d,FILE:%d:%d",
kLiveThreadsThreshold, crash_seconds,
kLiveThreadsThreshold, crash_seconds,
kLiveThreadsThreshold, crash_seconds * 5);
// Default to crashing the browser if UI or IO threads are not responsive
// except in stable channel.
crash_on_hang_thread_names =
base::StringPrintf("UI:%d:%d,IO:%d:%d", kLiveThreadsThreshold,
crash_seconds, kLiveThreadsThreshold, crash_seconds);
}
ParseCommandLineCrashOnHangThreads(crash_on_hang_thread_names,
......@@ -552,12 +550,6 @@ void ThreadWatcherList::InitializeAndStartWatching(
unresponsive_threshold, crash_on_hang_threads);
StartWatching(BrowserThread::IO, "IO", kSleepTime, kUnresponsiveTime,
unresponsive_threshold, crash_on_hang_threads);
StartWatching(BrowserThread::DB, "DB", kSleepTime, kUnresponsiveTime,
unresponsive_threshold, crash_on_hang_threads);
StartWatching(BrowserThread::FILE, "FILE", kSleepTime, kUnresponsiveTime,
unresponsive_threshold, crash_on_hang_threads);
StartWatching(BrowserThread::CACHE, "CACHE", kSleepTime, kUnresponsiveTime,
unresponsive_threshold, crash_on_hang_threads);
}
// static
......
......@@ -50,36 +50,12 @@ NOINLINE void ThreadUnresponsive_UI() {
ReportThreadHang();
}
NOINLINE void ThreadUnresponsive_DB() {
volatile int inhibit_comdat = __LINE__;
ALLOW_UNUSED_LOCAL(inhibit_comdat);
ReportThreadHang();
}
NOINLINE void ThreadUnresponsive_FILE() {
volatile int inhibit_comdat = __LINE__;
ALLOW_UNUSED_LOCAL(inhibit_comdat);
ReportThreadHang();
}
NOINLINE void ThreadUnresponsive_FILE_USER_BLOCKING() {
volatile int inhibit_comdat = __LINE__;
ALLOW_UNUSED_LOCAL(inhibit_comdat);
ReportThreadHang();
}
NOINLINE void ThreadUnresponsive_PROCESS_LAUNCHER() {
volatile int inhibit_comdat = __LINE__;
ALLOW_UNUSED_LOCAL(inhibit_comdat);
ReportThreadHang();
}
NOINLINE void ThreadUnresponsive_CACHE() {
volatile int inhibit_comdat = __LINE__;
ALLOW_UNUSED_LOCAL(inhibit_comdat);
ReportThreadHang();
}
NOINLINE void ThreadUnresponsive_IO() {
volatile int inhibit_comdat = __LINE__;
ALLOW_UNUSED_LOCAL(inhibit_comdat);
......@@ -91,19 +67,16 @@ NOINLINE void CrashBecauseThreadWasUnresponsive(
switch (thread_id) {
case content::BrowserThread::UI:
return ThreadUnresponsive_UI();
case content::BrowserThread::DB:
return ThreadUnresponsive_DB();
case content::BrowserThread::FILE:
return ThreadUnresponsive_FILE();
case content::BrowserThread::FILE_USER_BLOCKING:
return ThreadUnresponsive_FILE_USER_BLOCKING();
case content::BrowserThread::PROCESS_LAUNCHER:
return ThreadUnresponsive_PROCESS_LAUNCHER();
case content::BrowserThread::CACHE:
return ThreadUnresponsive_CACHE();
case content::BrowserThread::IO:
return ThreadUnresponsive_IO();
case content::BrowserThread::ID_COUNT:
// TODO(gab): Get rid of deprecated BrowserThread IDs.
case content::BrowserThread::DB:
case content::BrowserThread::FILE:
case content::BrowserThread::FILE_USER_BLOCKING:
case content::BrowserThread::CACHE:
NOTREACHED();
break;
}
......
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