OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_DEBUG_ACTIVITY_ANALYZER_H_ | 5 #ifndef BASE_DEBUG_ACTIVITY_ANALYZER_H_ |
6 #define BASE_DEBUG_ACTIVITY_ANALYZER_H_ | 6 #define BASE_DEBUG_ACTIVITY_ANALYZER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Iterates over all known valid analyzers or returns null if there are no | 125 // Iterates over all known valid analyzers or returns null if there are no |
126 // more. Ownership stays with the global analyzer object and all existing | 126 // more. Ownership stays with the global analyzer object and all existing |
127 // analyzer pointers are invalidated when GetFirstAnalyzer() is called. | 127 // analyzer pointers are invalidated when GetFirstAnalyzer() is called. |
128 ThreadActivityAnalyzer* GetFirstAnalyzer(); | 128 ThreadActivityAnalyzer* GetFirstAnalyzer(); |
129 ThreadActivityAnalyzer* GetNextAnalyzer(); | 129 ThreadActivityAnalyzer* GetNextAnalyzer(); |
130 | 130 |
131 // Gets the analyzer for a specific thread or null if there is none. | 131 // Gets the analyzer for a specific thread or null if there is none. |
132 // Ownership stays with the global analyzer object. | 132 // Ownership stays with the global analyzer object. |
133 ThreadActivityAnalyzer* GetAnalyzerForThread(const ThreadKey& key); | 133 ThreadActivityAnalyzer* GetAnalyzerForThread(const ThreadKey& key); |
134 | 134 |
| 135 // Gets all log messages stored within. |
| 136 std::vector<std::string> GetLogMessages(); |
| 137 |
135 // Gets the corresponding "program location" for a given "program counter". | 138 // Gets the corresponding "program location" for a given "program counter". |
136 // This will return {0,0} if no mapping could be found. | 139 // This will return {0,0} if no mapping could be found. |
137 ProgramLocation GetProgramLocationFromAddress(uint64_t address); | 140 ProgramLocation GetProgramLocationFromAddress(uint64_t address); |
138 | 141 |
139 private: | 142 private: |
140 using AnalyzerMap = | 143 using AnalyzerMap = |
141 std::map<ThreadKey, std::unique_ptr<ThreadActivityAnalyzer>>; | 144 std::map<ThreadKey, std::unique_ptr<ThreadActivityAnalyzer>>; |
142 | 145 |
143 // Finds, creates, and indexes analyzers for all known processes and threads. | 146 // Finds, creates, and indexes analyzers for all known processes and threads. |
144 void PrepareAllAnalyzers(); | 147 void PrepareAllAnalyzers(); |
(...skipping 14 matching lines...) Expand all Loading... |
159 // first/next iteration. | 162 // first/next iteration. |
160 AnalyzerMap::iterator analyzers_iterator_; | 163 AnalyzerMap::iterator analyzers_iterator_; |
161 | 164 |
162 DISALLOW_COPY_AND_ASSIGN(GlobalActivityAnalyzer); | 165 DISALLOW_COPY_AND_ASSIGN(GlobalActivityAnalyzer); |
163 }; | 166 }; |
164 | 167 |
165 } // namespace debug | 168 } // namespace debug |
166 } // namespace base | 169 } // namespace base |
167 | 170 |
168 #endif // BASE_DEBUG_ACTIVITY_ANALYZER_H_ | 171 #endif // BASE_DEBUG_ACTIVITY_ANALYZER_H_ |
OLD | NEW |