| 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. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ |
| 6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ | 6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ |
| 7 | 7 |
| 8 // This header file defines implementation details of how the trace macros in | 8 // This header file defines implementation details of how the trace macros in |
| 9 // trace_event_common.h collect and store trace events. Anything not | 9 // trace_event_common.h collect and store trace events. Anything not |
| 10 // implementation-specific should go in trace_event_common.h instead of here. | 10 // implementation-specific should go in trace_event_common.h instead of here. |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 unsigned long long id, | 783 unsigned long long id, |
| 784 int thread_id, | 784 int thread_id, |
| 785 const base::TimeTicks& timestamp, | 785 const base::TimeTicks& timestamp, |
| 786 unsigned int flags, | 786 unsigned int flags, |
| 787 unsigned long long bind_id) { | 787 unsigned long long bind_id) { |
| 788 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 788 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
| 789 phase, category_group_enabled, name, scope, id, bind_id, thread_id, | 789 phase, category_group_enabled, name, scope, id, bind_id, thread_id, |
| 790 timestamp, kZeroNumArgs, NULL, NULL, NULL, NULL, flags); | 790 timestamp, kZeroNumArgs, NULL, NULL, NULL, NULL, flags); |
| 791 } | 791 } |
| 792 | 792 |
| 793 static inline base::trace_event::TraceEventHandle AddTraceEvent( | 793 BASE_EXPORT base::trace_event::TraceEventHandle AddTraceEvent( |
| 794 char phase, | 794 char phase, |
| 795 const unsigned char* category_group_enabled, | 795 const unsigned char* category_group_enabled, |
| 796 const char* name, | 796 const char* name, |
| 797 const char* scope, | 797 const char* scope, |
| 798 unsigned long long id, | 798 unsigned long long id, |
| 799 unsigned int flags, | 799 unsigned int flags, |
| 800 unsigned long long bind_id) { | 800 unsigned long long bind_id); |
| 801 const int thread_id = static_cast<int>(base::PlatformThread::CurrentId()); | |
| 802 const base::TimeTicks now = base::TimeTicks::Now(); | |
| 803 return AddTraceEventWithThreadIdAndTimestamp( | |
| 804 phase, category_group_enabled, name, scope, id, thread_id, now, flags, | |
| 805 bind_id); | |
| 806 } | |
| 807 | 801 |
| 808 template<class ARG1_TYPE> | 802 template<class ARG1_TYPE> |
| 809 static inline base::trace_event::TraceEventHandle | 803 static inline base::trace_event::TraceEventHandle |
| 810 AddTraceEventWithThreadIdAndTimestamp( | 804 AddTraceEventWithThreadIdAndTimestamp( |
| 811 char phase, | 805 char phase, |
| 812 const unsigned char* category_group_enabled, | 806 const unsigned char* category_group_enabled, |
| 813 const char* name, | 807 const char* name, |
| 814 const char* scope, | 808 const char* scope, |
| 815 unsigned long long id, | 809 unsigned long long id, |
| 816 int thread_id, | 810 int thread_id, |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 const char* name_; | 1121 const char* name_; |
| 1128 IDType id_; | 1122 IDType id_; |
| 1129 | 1123 |
| 1130 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1124 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
| 1131 }; | 1125 }; |
| 1132 | 1126 |
| 1133 } // namespace trace_event | 1127 } // namespace trace_event |
| 1134 } // namespace base | 1128 } // namespace base |
| 1135 | 1129 |
| 1136 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ | 1130 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ |
| OLD | NEW |