Commit e73f80a0 authored by Alexei Svitkine's avatar Alexei Svitkine Committed by Commit Bot

Add crash key for crbug.com/736675.

The previous CL https://chromium-review.googlesource.com/570458
added a CHECK, but the messages are not preserved in production
builds. This adds the same info to a crash key, so we can get
info from the wild.

BUG=736675,744734

Change-Id: I97106eec9a6f4a4f2ab00d2a28e23f891ebe5e50
Reviewed-on: https://chromium-review.googlesource.com/575188
Commit-Queue: Alexei Svitkine (slow) <asvitkine@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487302}
parent f53799fb
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include <inttypes.h>
#include <limits.h> #include <limits.h>
#include <math.h> #include <math.h>
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/debug/alias.h" #include "base/debug/alias.h"
#include "base/debug/crash_logging.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
...@@ -31,6 +33,7 @@ ...@@ -31,6 +33,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "base/values.h" #include "base/values.h"
#include "build/build_config.h"
namespace base { namespace base {
...@@ -554,9 +557,16 @@ void Histogram::ValidateHistogramContents() const { ...@@ -554,9 +557,16 @@ void Histogram::ValidateHistogramContents() const {
bad_fields |= 1 << kFlagsField; bad_fields |= 1 << kFlagsField;
// Abort if a problem is found (except "flags", which could legally be zero). // Abort if a problem is found (except "flags", which could legally be zero).
CHECK_EQ(0U, bad_fields & ~(1 << kFlagsField)) if ((bad_fields & ~(1 << kFlagsField)) != 0) {
<< histogram_name() << ": " << bad_fields; const std::string debug_string =
debug::Alias(&bad_fields); base::StringPrintf("%s/%" PRIu32, histogram_name().c_str(), bad_fields);
#if !defined(OS_NACL)
// Temporary for https://crbug.com/736675.
base::debug::ScopedCrashKey crash_key("bad_histogram", debug_string);
#endif
CHECK(false) << debug_string;
debug::Alias(&bad_fields);
}
} }
bool Histogram::SerializeInfoImpl(Pickle* pickle) const { bool Histogram::SerializeInfoImpl(Pickle* pickle) const {
......
...@@ -192,6 +192,9 @@ size_t RegisterCrashKeysHelper() { ...@@ -192,6 +192,9 @@ size_t RegisterCrashKeysHelper() {
// TEMPORARY: Compositor state for debugging BeginMainFrame renderer hang. // TEMPORARY: Compositor state for debugging BeginMainFrame renderer hang.
// TODO(sunnyps): Remove after fixing https://crbug.com/622080 // TODO(sunnyps): Remove after fixing https://crbug.com/622080
{kBeginMainFrameHangCompositorState, kSmallSize}, {kBeginMainFrameHangCompositorState, kSmallSize},
// TODO(asvitkine): Remove after fixing https://crbug.com/736675
{"bad_histogram", kMediumSize},
}; };
// This dynamic set of keys is used for sets of key value pairs when gathering // This dynamic set of keys is used for sets of key value pairs when gathering
......
...@@ -231,6 +231,9 @@ size_t RegisterChromeCrashKeys() { ...@@ -231,6 +231,9 @@ size_t RegisterChromeCrashKeys() {
// TEMPORARY: Compositor state for debugging BeginMainFrame renderer hang. // TEMPORARY: Compositor state for debugging BeginMainFrame renderer hang.
// TODO(sunnyps): Remove after fixing https://crbug.com/622080 // TODO(sunnyps): Remove after fixing https://crbug.com/622080
{kBeginMainFrameHangCompositorState, crash_keys::kSmallSize}, {kBeginMainFrameHangCompositorState, crash_keys::kSmallSize},
// TODO(asvitkine): Remove after fixing https://crbug.com/736675
{"bad_histogram", kMediumSize},
}; };
// This dynamic set of keys is used for sets of key value pairs when gathering // This dynamic set of keys is used for sets of key value pairs when gathering
......
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