Commit 24c2c8cd authored by dgn's avatar dgn Committed by Commit bot

[bgmode] Log the unpin stack trace to Crash Keys

BUG=625646

Review-Url: https://codereview.chromium.org/2569953003
Cr-Commit-Position: refs/heads/master@{#439176}
parent 866e43b5
...@@ -25,6 +25,7 @@ size_t RegisterEngineCrashKeys() { ...@@ -25,6 +25,7 @@ size_t RegisterEngineCrashKeys() {
{ crash_keys::kVariations, crash_keys::kLargeSize }, { crash_keys::kVariations, crash_keys::kLargeSize },
// browser/: // browser/:
{ "browser-unpin-trace", crash_keys::kMediumSize},
{ "third-party-modules-loaded", crash_keys::kSmallSize }, { "third-party-modules-loaded", crash_keys::kSmallSize },
{ "third-party-modules-not-loaded", crash_keys::kSmallSize }, { "third-party-modules-not-loaded", crash_keys::kSmallSize },
{ "enrolled-to-domain", crash_keys::kSmallSize }, { "enrolled-to-domain", crash_keys::kSmallSize },
......
...@@ -40,6 +40,7 @@ constexpr size_t kExtensionIDMaxCount = 10; ...@@ -40,6 +40,7 @@ constexpr size_t kExtensionIDMaxCount = 10;
constexpr char kExtensionID[] = "extension-%" PRIuS; constexpr char kExtensionID[] = "extension-%" PRIuS;
constexpr char kShutdownType[] = "shutdown-type"; constexpr char kShutdownType[] = "shutdown-type";
constexpr char kBrowserUnpinTrace[] = "browser-unpin-trace";
constexpr char kGPUVendorID[] = "gpu-venid"; constexpr char kGPUVendorID[] = "gpu-venid";
constexpr char kGPUDeviceID[] = "gpu-devid"; constexpr char kGPUDeviceID[] = "gpu-devid";
...@@ -97,6 +98,7 @@ size_t RegisterCrashKeysHelper() { ...@@ -97,6 +98,7 @@ size_t RegisterCrashKeysHelper() {
{kVariations, kLargeSize}, {kVariations, kLargeSize},
{kNumExtensionsCount, kSmallSize}, {kNumExtensionsCount, kSmallSize},
{kShutdownType, kSmallSize}, {kShutdownType, kSmallSize},
{kBrowserUnpinTrace, kMediumSize},
{kGPUVendorID, kSmallSize}, {kGPUVendorID, kSmallSize},
{kGPUDeviceID, kSmallSize}, {kGPUDeviceID, kSmallSize},
{kGPUDriverVersion, kSmallSize}, {kGPUDriverVersion, kSmallSize},
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/alias.h" #include "base/debug/crash_logging.h"
#include "base/debug/leak_annotations.h" #include "base/debug/leak_annotations.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/location.h" #include "base/location.h"
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/crash_keys.h"
#include "chrome/common/extensions/chrome_extensions_client.h" #include "chrome/common/extensions/chrome_extensions_client.h"
#include "chrome/common/extensions/extension_process_policy.h" #include "chrome/common/extensions/extension_process_policy.h"
#include "chrome/common/features.h" #include "chrome/common/features.h"
...@@ -1314,10 +1315,9 @@ void BrowserProcessImpl::Pin() { ...@@ -1314,10 +1315,9 @@ void BrowserProcessImpl::Pin() {
// CHECK(!IsShuttingDown()); // CHECK(!IsShuttingDown());
if (IsShuttingDown()) { if (IsShuttingDown()) {
// Copy the stacktrace which released the final reference onto our stack so // TODO(crbug.com/113031, crbug.com/625646): Temporary instrumentation.
// it will be available in the crash report for inspection. base::debug::SetCrashKeyToStackTrace(crash_keys::kBrowserUnpinTrace,
base::debug::StackTrace callstack = release_last_reference_callstack_; release_last_reference_callstack_);
base::debug::Alias(&callstack);
CHECK(false); CHECK(false);
} }
} }
......
...@@ -33,6 +33,7 @@ const char kExtensionID[] = "extension-%" PRIuS; ...@@ -33,6 +33,7 @@ const char kExtensionID[] = "extension-%" PRIuS;
const char kNumExtensionsCount[] = "num-extensions"; const char kNumExtensionsCount[] = "num-extensions";
const char kShutdownType[] = "shutdown-type"; const char kShutdownType[] = "shutdown-type";
const char kBrowserUnpinTrace[] = "browser-unpin-trace";
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
const char kGPUVendorID[] = "gpu-venid"; const char kGPUVendorID[] = "gpu-venid";
...@@ -118,6 +119,7 @@ size_t RegisterChromeCrashKeys() { ...@@ -118,6 +119,7 @@ size_t RegisterChromeCrashKeys() {
{ kVariations, kLargeSize }, { kVariations, kLargeSize },
{ kNumExtensionsCount, kSmallSize }, { kNumExtensionsCount, kSmallSize },
{ kShutdownType, kSmallSize }, { kShutdownType, kSmallSize },
{ kBrowserUnpinTrace, kMediumSize },
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
{ kGPUVendorID, kSmallSize }, { kGPUVendorID, kSmallSize },
{ kGPUDeviceID, kSmallSize }, { kGPUDeviceID, kSmallSize },
......
...@@ -68,6 +68,11 @@ extern const char kNumExtensionsCount[]; ...@@ -68,6 +68,11 @@ extern const char kNumExtensionsCount[];
// "exit" for BROWSER_EXIT, or "end" for END_SESSION. // "exit" for BROWSER_EXIT, or "end" for END_SESSION.
extern const char kShutdownType[]; extern const char kShutdownType[];
// Stack trace associated to the browser being unpinned and starting the
// shutdown sequence. The value is set when we trigger a browser crash due to an
// invalid attempt to Pin the browser process after that.
extern const char kBrowserUnpinTrace[];
// GPU information. // GPU information.
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
extern const char kGPUVendorID[]; extern const char kGPUVendorID[];
......
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