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

Unified Diff: base/debug/activity_analyzer.h

Issue 2511043003: Support for extracting user-data from activity tracking. (Closed)
Patch Set: refactored so global information sits in an extended snapshot 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_analyzer.cc » ('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..6215b8644cf36df4a80a4c5ca335aa8c7e1f8ff7 100644
--- a/base/debug/activity_analyzer.h
+++ b/base/debug/activity_analyzer.h
@@ -16,11 +16,22 @@
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.
class BASE_EXPORT ThreadActivityAnalyzer {
public:
+ struct BASE_EXPORT Snapshot : ThreadActivityTracker::Snapshot {
+ Snapshot();
+ ~Snapshot();
+
+ // The user-data snapshot for an activity, matching the |activity_stack|
+ // of ThreadActivityTracker::Snapshot, if any.
+ std::vector<ActivityUserData::Snapshot> user_data_stack;
+ };
+
// This class provides keys that uniquely identify a thread, even across
// multiple processes.
class ThreadKey {
@@ -59,6 +70,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,13 +88,13 @@ class BASE_EXPORT ThreadActivityAnalyzer {
activity_snapshot_.thread_id);
}
- const ActivitySnapshot& activity_snapshot() { return activity_snapshot_; }
+ const Snapshot& activity_snapshot() { return activity_snapshot_; }
private:
friend class GlobalActivityAnalyzer;
// The snapshot of the activity tracker taken at the moment of construction.
- ActivitySnapshot activity_snapshot_;
+ Snapshot activity_snapshot_;
// Flag indicating if the snapshot data is valid.
bool activity_snapshot_valid_;
@@ -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_analyzer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698