Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Unified Diff: base/debug/activity_analyzer.cc

Issue 2544853003: Store log messages in global activity tracker. (Closed)
Patch Set: added comment about NUL terminator Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/debug/activity_analyzer.cc
diff --git a/base/debug/activity_analyzer.cc b/base/debug/activity_analyzer.cc
index 0c30d8d0c213c2e973dec707cc439d97e58e3fe7..469ec5106a8d4500effcdb26cbfb1ec115c5306b 100644
--- a/base/debug/activity_analyzer.cc
+++ b/base/debug/activity_analyzer.cc
@@ -83,6 +83,23 @@ ThreadActivityAnalyzer* GlobalActivityAnalyzer::GetAnalyzerForThread(
return found->second.get();
}
+std::vector<std::string> GlobalActivityAnalyzer::GetLogMessages() {
+ std::vector<std::string> messages;
+ PersistentMemoryAllocator::Reference ref;
+
+ PersistentMemoryAllocator::Iterator iter(allocator_.get());
+ while ((ref = iter.GetNextOfType(
+ GlobalActivityTracker::kTypeIdGlobalLogMessage)) != 0) {
+ const char* message = allocator_->GetAsArray<char>(
+ ref, GlobalActivityTracker::kTypeIdGlobalLogMessage,
+ PersistentMemoryAllocator::kSizeAny);
+ if (message)
+ messages.push_back(message);
+ }
+
+ return messages;
+}
+
GlobalActivityAnalyzer::ProgramLocation
GlobalActivityAnalyzer::GetProgramLocationFromAddress(uint64_t address) {
// TODO(bcwhite): Implement this.

Powered by Google App Engine
This is Rietveld 408576698