Commit 03847e79 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Add 'hang-report' product data key to crash dumps generated for UI freeze.

This key will allow to split crash signature for UIFreeze crashes.

Bug: 1000861
Change-Id: Ia9e0fcd14096c5d15630a777137f4b3dd07f1bb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764903
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693899}
parent 250c173e
......@@ -66,6 +66,10 @@ void SetMemoryWarningCount(int count);
// is 'true'), otherwise remove the key.
void SetMemoryWarningInProgress(bool value);
// Sets a key indicating that UI thread is frozen (if value is 'true'),
// otherwise remove the key.
void SetHangReport(bool value);
// Sets a key indicating the current free memory amount in KB. 0 does not remove
// the key as getting no memory is important information.
void SetCurrentFreeMemoryInKB(int value);
......
......@@ -46,6 +46,7 @@ NSString* const kCrashedInBackground = @"crashed_in_background";
NSString* const kFreeDiskInKB = @"free_disk_in_kb";
NSString* const kFreeMemoryInKB = @"free_memory_in_kb";
NSString* const kMemoryWarningInProgress = @"memory_warning_in_progress";
NSString* const kHangReport = @"hang-report";
NSString* const kMemoryWarningCount = @"memory_warning_count";
NSString* const kUptimeAtRestoreInMs = @"uptime_at_restore_in_ms";
NSString* const kUploadedInRecoveryMode = @"uploaded_in_recovery_mode";
......@@ -277,6 +278,13 @@ void SetMemoryWarningInProgress(bool value) {
RemoveReportParameter(kMemoryWarningInProgress);
}
void SetHangReport(bool value) {
if (value)
AddReportParameter(kHangReport, @"yes", true);
else
RemoveReportParameter(kHangReport);
}
void SetCurrentFreeMemoryInKB(int value) {
AddReportParameter(kFreeMemoryInKB, [NSString stringWithFormat:@"%d", value],
true);
......
......@@ -6,6 +6,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "ios/chrome/browser/crash_report/breakpad_helper.h"
#include "ios/chrome/browser/crash_report/crash_report_flags.h"
#import "third_party/breakpad/breakpad/src/client/ios/Breakpad.h"
#import "third_party/breakpad/breakpad/src/client/ios/BreakpadController.h"
......@@ -179,6 +180,7 @@ void LogRecoveryTime(base::TimeDelta time) {
if (!breakpadRef) {
return;
}
breakpad_helper::SetHangReport(true);
NSDictionary* breakpadReportInfo =
BreakpadGenerateReport(breakpadRef, nil);
if (!breakpadReportInfo) {
......
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