| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 under third_party_mods/chromium or at: | 3 // found in the LICENSE file under third_party_mods/chromium or at: |
| 4 // http://src.chromium.org/svn/trunk/src/LICENSE | 4 // http://src.chromium.org/svn/trunk/src/LICENSE |
| 5 | 5 |
| 6 #ifndef WEBRTC_RTC_BASE_TRACE_EVENT_H_ | 6 #ifndef WEBRTC_RTC_BASE_TRACE_EVENT_H_ |
| 7 #define WEBRTC_RTC_BASE_TRACE_EVENT_H_ | 7 #define WEBRTC_RTC_BASE_TRACE_EVENT_H_ |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 // Implementation detail: trace event macros create temporary variables | 568 // Implementation detail: trace event macros create temporary variables |
| 569 // to keep instrumentation overhead low. These macros give each temporary | 569 // to keep instrumentation overhead low. These macros give each temporary |
| 570 // variable a unique name based on the line number to prevent name collissions. | 570 // variable a unique name based on the line number to prevent name collissions. |
| 571 #define INTERNAL_TRACE_EVENT_UID3(a,b) \ | 571 #define INTERNAL_TRACE_EVENT_UID3(a,b) \ |
| 572 trace_event_unique_##a##b | 572 trace_event_unique_##a##b |
| 573 #define INTERNAL_TRACE_EVENT_UID2(a,b) \ | 573 #define INTERNAL_TRACE_EVENT_UID2(a,b) \ |
| 574 INTERNAL_TRACE_EVENT_UID3(a,b) | 574 INTERNAL_TRACE_EVENT_UID3(a,b) |
| 575 #define INTERNAL_TRACE_EVENT_UID(name_prefix) \ | 575 #define INTERNAL_TRACE_EVENT_UID(name_prefix) \ |
| 576 INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) | 576 INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) |
| 577 | 577 |
| 578 #if WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS | |
| 579 #define INTERNAL_TRACE_EVENT_INFO_TYPE const unsigned char* | |
| 580 #else | |
| 581 #define INTERNAL_TRACE_EVENT_INFO_TYPE static const unsigned char* | |
| 582 #endif // WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS | |
| 583 | |
| 584 // Implementation detail: internal macro to create static category. | 578 // Implementation detail: internal macro to create static category. |
| 585 #define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category) \ | 579 #define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category) \ |
| 586 INTERNAL_TRACE_EVENT_INFO_TYPE INTERNAL_TRACE_EVENT_UID(catstatic) = \ | 580 static const unsigned char* INTERNAL_TRACE_EVENT_UID(catstatic) = \ |
| 587 TRACE_EVENT_API_GET_CATEGORY_ENABLED(category); | 581 TRACE_EVENT_API_GET_CATEGORY_ENABLED(category); |
| 588 | 582 |
| 589 // Implementation detail: internal macro to create static category and add | 583 // Implementation detail: internal macro to create static category and add |
| 590 // event if the category is enabled. | 584 // event if the category is enabled. |
| 591 #define INTERNAL_TRACE_EVENT_ADD(phase, category, name, flags, ...) \ | 585 #define INTERNAL_TRACE_EVENT_ADD(phase, category, name, flags, ...) \ |
| 592 do { \ | 586 do { \ |
| 593 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ | 587 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ |
| 594 if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ | 588 if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ |
| 595 webrtc::trace_event_internal::AddTraceEvent( \ | 589 webrtc::trace_event_internal::AddTraceEvent( \ |
| 596 phase, INTERNAL_TRACE_EVENT_UID(catstatic), name, \ | 590 phase, INTERNAL_TRACE_EVENT_UID(catstatic), name, \ |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 const char* name; | 901 const char* name; |
| 908 }; | 902 }; |
| 909 Data* p_data_; | 903 Data* p_data_; |
| 910 Data data_; | 904 Data data_; |
| 911 }; | 905 }; |
| 912 | 906 |
| 913 } // namespace trace_event_internal | 907 } // namespace trace_event_internal |
| 914 } // namespace webrtc | 908 } // namespace webrtc |
| 915 | 909 |
| 916 #endif // WEBRTC_RTC_BASE_TRACE_EVENT_H_ | 910 #endif // WEBRTC_RTC_BASE_TRACE_EVENT_H_ |
| OLD | NEW |