Chromium Code Reviews| Index: components/browser_watcher/postmortem_report_extractor.cc |
| diff --git a/components/browser_watcher/postmortem_report_extractor.cc b/components/browser_watcher/postmortem_report_extractor.cc |
| index bd12a9a03b4b87f9892195c6a3806bd1d6fce629..3a150b44e0241c11fc49eafbfef73e900b25d3db 100644 |
| --- a/components/browser_watcher/postmortem_report_extractor.cc |
| +++ b/components/browser_watcher/postmortem_report_extractor.cc |
| @@ -11,6 +11,8 @@ |
| #include "base/debug/activity_analyzer.h" |
| #include "base/logging.h" |
| +#include "base/metrics/histogram_macros.h" |
| +#include "base/metrics/persistent_memory_allocator.h" |
| #include "base/strings/string_piece.h" |
| #include "base/strings/string_util.h" |
| #include "base/strings/stringprintf.h" |
| @@ -213,6 +215,16 @@ CollectionStatus Extract(const base::FilePath& stability_file, |
| if (!global_analyzer) |
| return ANALYZER_CREATION_FAILED; |
| + uint8_t allocator_state = global_analyzer->allocator().GetMemoryState(); |
|
bcwhite
2017/03/23 11:32:44
I think it would be better to add a GetMemoryState
bcwhite
2017/03/23 11:35:40
Make that...
MEMORY_FULL = 100, // MEMORY_USER
manzagop (departed)
2017/03/23 19:18:54
Acknowledged.
manzagop (departed)
2017/03/23 19:18:54
Hm, maybe it's best to decouple the two. Tell me w
bcwhite
2017/03/23 21:10:43
The memory state was written expecting that it wou
manzagop (departed)
2017/03/23 21:25:02
I'm not sure I follow. Here are the main things:
-
bcwhite
2017/03/24 12:49:04
If you ignore the implementation details, you can
|
| + if (allocator_state == base::PersistentMemoryAllocator::MEMORY_UNINITIALIZED) |
| + return ALLOCATOR_UNINITIALIZED; |
| + if (allocator_state == base::PersistentMemoryAllocator::MEMORY_DELETED) |
| + return ALLOCATOR_DELETED; |
| + if (global_analyzer->allocator().IsCorrupt()) |
| + return ALLOCATOR_CORRUPT; |
| + UMA_HISTOGRAM_BOOLEAN("ActivityTracker.Collect.IsAllocatorFull", |
|
bcwhite
2017/03/23 11:32:44
I think it would be better to just enable the inte
manzagop (departed)
2017/03/23 19:18:54
Removed the fullness histogram. Will the histogram
bcwhite
2017/03/23 21:10:43
They're specific to the allocator's name:
UMA.Per
manzagop (departed)
2017/03/23 21:25:02
Great!
|
| + global_analyzer->allocator().IsFull()); |
| + |
| // Early exit if there is no data. |
| std::vector<std::string> log_messages = global_analyzer->GetLogMessages(); |
| ActivityUserData::Snapshot global_data_snapshot = |