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

Unified Diff: base/debug/activity_analyzer.h

Issue 2511043003: Support for extracting user-data from activity tracking. (Closed)
Patch Set: address review comments my PA 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
« no previous file with comments | « no previous file | base/debug/activity_analyzer.cc » ('j') | base/debug/activity_tracker.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/activity_analyzer.h
diff --git a/base/debug/activity_analyzer.h b/base/debug/activity_analyzer.h
index 0a527332a62d0253b67a203290778349d3fec6ac..fb4df6fcd24ba630354cf13f0d38c2fd15067a3a 100644
--- a/base/debug/activity_analyzer.h
+++ b/base/debug/activity_analyzer.h
@@ -16,6 +16,8 @@
namespace base {
namespace debug {
+class GlobalActivityAnalyzer;
+
// This class provides analysis of data captured from a ThreadActivityTracker.
// When created, it takes a snapshot of the data held by the tracker and
// makes that information available to other code.
@@ -59,6 +61,9 @@ class BASE_EXPORT ThreadActivityAnalyzer {
~ThreadActivityAnalyzer();
+ // Adds information from the global analyzer.
+ void AddGlobalInformation(GlobalActivityAnalyzer* global);
+
// Returns true iff the contained data is valid. Results from all other
// methods are undefined if this returns false.
bool IsValid() { return activity_snapshot_valid_; }
@@ -74,6 +79,11 @@ class BASE_EXPORT ThreadActivityAnalyzer {
activity_snapshot_.thread_id);
}
+ // Gets the user-data snapshot for an activity based on its index in the
+ // |activity_stack| field of the ActivitySnapshot. Ownership stays with
+ // this instance.
+ const ActivityUserData::Snapshot& GetUserDataSnapshot(size_t stack_index);
+
const ActivitySnapshot& activity_snapshot() { return activity_snapshot_; }
private:
@@ -85,6 +95,10 @@ class BASE_EXPORT ThreadActivityAnalyzer {
// Flag indicating if the snapshot data is valid.
bool activity_snapshot_valid_;
+ // Copy of user-data associated with the stack. This is captured and held
+ // because the data may change if used on a live system.
+ std::vector<ActivityUserData::Snapshot> user_data_snapshots_;
+
// A reference into a persistent memory allocator, used by the global
// analyzer to know where this tracker came from.
PersistentMemoryAllocator::Reference allocator_reference_ = 0;
@@ -132,6 +146,12 @@ class BASE_EXPORT GlobalActivityAnalyzer {
// Ownership stays with the global analyzer object.
ThreadActivityAnalyzer* GetAnalyzerForThread(const ThreadKey& key);
+ // Extract user data based on a reference and its identifier.
+ ActivityUserData::Snapshot GetUserDataSnapshot(uint32_t ref, uint32_t id);
+
+ // Extract the global user data.
+ ActivityUserData::Snapshot GetGlobalUserDataSnapshot();
+
// Gets the corresponding "program location" for a given "program counter".
// This will return {0,0} if no mapping could be found.
ProgramLocation GetProgramLocationFromAddress(uint64_t address);
« no previous file with comments | « no previous file | base/debug/activity_analyzer.cc » ('j') | base/debug/activity_tracker.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698