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

Unified Diff: base/debug/activity_analyzer.h

Issue 2483473002: Include calling address in tracked activities. (Closed)
Patch Set: force inlining of methods that call GetProgramCounter() Created 4 years, 1 month 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') | no next file with comments »
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 14244b7b1fe80384f477f7fbfacdfced7c7b374b..74d8ad802eb0c25d81caf70a02e24d4f278315b6 100644
--- a/base/debug/activity_analyzer.h
+++ b/base/debug/activity_analyzer.h
@@ -99,6 +99,11 @@ class BASE_EXPORT ThreadActivityAnalyzer {
// show small inconsistencies between threads if attempted on a live system.
class BASE_EXPORT GlobalActivityAnalyzer {
public:
+ struct ProgramLocation {
+ int module;
+ uintptr_t offset;
+ };
+
using ThreadKey = ThreadActivityAnalyzer::ThreadKey;
// Creates a global analyzer from a persistent memory allocator.
@@ -124,6 +129,10 @@ class BASE_EXPORT GlobalActivityAnalyzer {
// Ownership stays with the global analyzer object.
ThreadActivityAnalyzer* GetAnalyzerForThread(const ThreadKey& key);
+ // 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);
+
private:
using AnalyzerMap =
std::map<ThreadKey, std::unique_ptr<ThreadActivityAnalyzer>>;
« no previous file with comments | « no previous file | base/debug/activity_analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698