OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TRACE_EVENT_TRACE_LOG_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_LOG_H_ |
6 #define BASE_TRACE_EVENT_TRACE_LOG_H_ | 6 #define BASE_TRACE_EVENT_TRACE_LOG_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 int process_id() const { return process_id_; } | 275 int process_id() const { return process_id_; } |
276 | 276 |
277 uint64_t MangleEventId(uint64_t id); | 277 uint64_t MangleEventId(uint64_t id); |
278 | 278 |
279 // Exposed for unittesting: | 279 // Exposed for unittesting: |
280 | 280 |
281 // Allows deleting our singleton instance. | 281 // Allows deleting our singleton instance. |
282 static void DeleteForTesting(); | 282 static void DeleteForTesting(); |
283 | 283 |
284 class BASE_EXPORT TraceEventFilter { | |
285 public: | |
286 static const char* const kEventWhitelistPredicate; | |
287 static const char* const kHeapProfilerPredicate; | |
288 | |
289 TraceEventFilter() {} | |
290 virtual ~TraceEventFilter() {} | |
291 virtual bool FilterTraceEvent(const TraceEvent& trace_event) const = 0; | |
292 virtual void EndEvent(const char* category_group, const char* name) {} | |
293 | |
294 private: | |
295 DISALLOW_COPY_AND_ASSIGN(TraceEventFilter); | |
296 }; | |
297 typedef std::unique_ptr<TraceEventFilter> ( | |
298 *TraceEventFilterConstructorForTesting)(void); | |
299 static void SetTraceEventFilterConstructorForTesting( | |
300 TraceEventFilterConstructorForTesting predicate); | |
301 | |
302 // Allow tests to inspect TraceEvents. | 284 // Allow tests to inspect TraceEvents. |
303 TraceEvent* GetEventByHandle(TraceEventHandle handle); | 285 TraceEvent* GetEventByHandle(TraceEventHandle handle); |
304 | 286 |
305 void SetProcessID(int process_id); | 287 void SetProcessID(int process_id); |
306 | 288 |
307 // Process sort indices, if set, override the order of a process will appear | 289 // Process sort indices, if set, override the order of a process will appear |
308 // relative to other processes in the trace viewer. Processes are sorted first | 290 // relative to other processes in the trace viewer. Processes are sorted first |
309 // on their sort index, ascending, then by their name, and then tid. | 291 // on their sort index, ascending, then by their name, and then tid. |
310 void SetProcessSortIndex(int sort_index); | 292 void SetProcessSortIndex(int sort_index); |
311 | 293 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 subtle::AtomicWord generation_; | 488 subtle::AtomicWord generation_; |
507 bool use_worker_thread_; | 489 bool use_worker_thread_; |
508 | 490 |
509 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 491 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
510 }; | 492 }; |
511 | 493 |
512 } // namespace trace_event | 494 } // namespace trace_event |
513 } // namespace base | 495 } // namespace base |
514 | 496 |
515 #endif // BASE_TRACE_EVENT_TRACE_LOG_H_ | 497 #endif // BASE_TRACE_EVENT_TRACE_LOG_H_ |
OLD | NEW |