| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Trace events are for tracking application performance. | 5 // Trace events are for tracking application performance. |
| 6 // | 6 // |
| 7 // Events are issued against categories. Whereas LOG's | 7 // Events are issued against categories. Whereas LOG's |
| 8 // categories are statically defined, TRACE categories are created | 8 // categories are statically defined, TRACE categories are created |
| 9 // implicitly with a string. For example: | 9 // implicitly with a string. For example: |
| 10 // TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") | 10 // TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 const char* name, | 556 const char* name, |
| 557 const void* id, | 557 const void* id, |
| 558 const char* extra); | 558 const char* extra); |
| 559 static void AddTraceEventEtw(TraceEventPhase phase, | 559 static void AddTraceEventEtw(TraceEventPhase phase, |
| 560 const char* name, | 560 const char* name, |
| 561 const void* id, | 561 const void* id, |
| 562 const std::string& extra); | 562 const std::string& extra); |
| 563 | 563 |
| 564 // Exposed for unittesting: | 564 // Exposed for unittesting: |
| 565 | 565 |
| 566 // Allows deleting our singleton instance. |
| 567 static void DeleteForTesting(); |
| 568 |
| 566 // Allows resurrecting our singleton instance post-AtExit processing. | 569 // Allows resurrecting our singleton instance post-AtExit processing. |
| 567 static void Resurrect(); | 570 static void Resurrect(); |
| 568 | 571 |
| 569 // Allow tests to inspect TraceEvents. | 572 // Allow tests to inspect TraceEvents. |
| 570 size_t GetEventsSize() const { return logged_events_.size(); } | 573 size_t GetEventsSize() const { return logged_events_.size(); } |
| 571 const TraceEvent& GetEventAt(size_t index) const { | 574 const TraceEvent& GetEventAt(size_t index) const { |
| 572 DCHECK(index < logged_events_.size()); | 575 DCHECK(index < logged_events_.size()); |
| 573 return logged_events_[index]; | 576 return logged_events_[index]; |
| 574 } | 577 } |
| 575 | 578 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 Data* p_data_; | 666 Data* p_data_; |
| 664 Data data_; | 667 Data data_; |
| 665 }; | 668 }; |
| 666 | 669 |
| 667 } // namespace internal | 670 } // namespace internal |
| 668 | 671 |
| 669 } // namespace debug | 672 } // namespace debug |
| 670 } // namespace base | 673 } // namespace base |
| 671 | 674 |
| 672 #endif // BASE_DEBUG_TRACE_EVENT_H_ | 675 #endif // BASE_DEBUG_TRACE_EVENT_H_ |
| OLD | NEW |