mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-10 06:36:02 +00:00
Make UMA for exception code OS-specific
R=wfh@chromium.org, mark@chromium.org BUG=crashpad:100 Change-Id: I9368168405d1bd761ae6205955968264543541c4 Reviewed-on: https://chromium-review.googlesource.com/386989 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
b48e9bfbab
commit
72a12e2e94
@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
#include "handler/win/crash_report_exception_handler.h"
|
#include "handler/win/crash_report_exception_handler.h"
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
#include "client/crash_report_database.h"
|
#include "client/crash_report_database.h"
|
||||||
#include "client/settings.h"
|
#include "client/settings.h"
|
||||||
#include "handler/crash_report_upload_thread.h"
|
#include "handler/crash_report_upload_thread.h"
|
||||||
@ -65,6 +67,10 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
|
|||||||
// can terminate the process with the correct exit code.
|
// can terminate the process with the correct exit code.
|
||||||
const unsigned int termination_code =
|
const unsigned int termination_code =
|
||||||
process_snapshot.Exception()->Exception();
|
process_snapshot.Exception()->Exception();
|
||||||
|
static_assert(
|
||||||
|
std::is_same<std::remove_const<decltype(termination_code)>::type,
|
||||||
|
decltype(process_snapshot.Exception()->Exception())>::value,
|
||||||
|
"expected ExceptionCode() and process termination code to match");
|
||||||
|
|
||||||
Metrics::ExceptionCode(termination_code);
|
Metrics::ExceptionCode(termination_code);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "base/metrics/histogram_macros.h"
|
#include "base/metrics/histogram_macros.h"
|
||||||
#include "base/metrics/sparse_histogram.h"
|
#include "base/metrics/sparse_histogram.h"
|
||||||
|
#include "build/build_config.h"
|
||||||
|
|
||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
|
|
||||||
@ -33,9 +34,14 @@ void Metrics::ExceptionCaptureResult(CaptureResult result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void Metrics::ExceptionCode(uint32_t code) {
|
void Metrics::ExceptionCode(uint32_t exception_code) {
|
||||||
UMA_HISTOGRAM_SPARSE_SLOWLY("Crashpad.ExceptionCode",
|
#if defined(OS_WIN)
|
||||||
static_cast<int32_t>(code));
|
const char kExceptionCodeString[] = "Crashpad.ExceptionCode.Win";
|
||||||
|
#elif defined(OS_MACOSX)
|
||||||
|
const char kExceptionCodeString[] = "Crashpad.ExceptionCode.Mac";
|
||||||
|
#endif
|
||||||
|
UMA_HISTOGRAM_SPARSE_SLOWLY(kExceptionCodeString,
|
||||||
|
static_cast<int32_t>(exception_code));
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
Loading…
x
Reference in New Issue
Block a user