| 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);
|
|
|