| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 uint64_t cid_; \ | 430 uint64_t cid_; \ |
| 431 /* Local class friendly DISALLOW_COPY_AND_ASSIGN */ \ | 431 /* Local class friendly DISALLOW_COPY_AND_ASSIGN */ \ |
| 432 INTERNAL_TRACE_EVENT_UID(ScopedContext) \ | 432 INTERNAL_TRACE_EVENT_UID(ScopedContext) \ |
| 433 (const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {}; \ | 433 (const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {}; \ |
| 434 void operator=(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {}; \ | 434 void operator=(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {}; \ |
| 435 }; \ | 435 }; \ |
| 436 INTERNAL_TRACE_EVENT_UID(ScopedContext) \ | 436 INTERNAL_TRACE_EVENT_UID(ScopedContext) \ |
| 437 INTERNAL_TRACE_EVENT_UID(scoped_context)(context); | 437 INTERNAL_TRACE_EVENT_UID(scoped_context)(context); |
| 438 | 438 |
| 439 // Implementation detail: internal macro to trace a task execution with the | 439 // Implementation detail: internal macro to trace a task execution with the |
| 440 // location where it was posted from. | 440 // location where it was posted from. Additional metadata may optionally be |
| 441 #define INTERNAL_TRACE_TASK_EXECUTION(run_function, task) \ | 441 // tacked on as well. |
| 442 TRACE_EVENT1("toplevel", run_function, "src_info", (task).GetTracingInfo()); \ | 442 #define INTERNAL_TRACE_TASK_EXECUTION(run_function, task, ...) \ |
| 443 TRACE_HEAP_PROFILER_API_SCOPED_TASK_EXECUTION INTERNAL_TRACE_EVENT_UID( \ | 443 INTERNAL_TRACE_EVENT_ADD_SCOPED("toplevel", run_function, "src_info", \ |
| 444 (task).GetTracingInfo(), ##__VA_ARGS__); \ |
| 445 TRACE_HEAP_PROFILER_API_SCOPED_TASK_EXECUTION INTERNAL_TRACE_EVENT_UID( \ |
| 444 task_event)((task).posted_from.file_name()); | 446 task_event)((task).posted_from.file_name()); |
| 445 | 447 |
| 446 namespace trace_event_internal { | 448 namespace trace_event_internal { |
| 447 | 449 |
| 448 // Specify these values when the corresponding argument of AddTraceEvent is not | 450 // Specify these values when the corresponding argument of AddTraceEvent is not |
| 449 // used. | 451 // used. |
| 450 const int kZeroNumArgs = 0; | 452 const int kZeroNumArgs = 0; |
| 451 const std::nullptr_t kGlobalScope = nullptr; | 453 const std::nullptr_t kGlobalScope = nullptr; |
| 452 const unsigned long long kNoId = 0; | 454 const unsigned long long kNoId = 0; |
| 453 | 455 |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 const char* name_; | 1159 const char* name_; |
| 1158 IDType id_; | 1160 IDType id_; |
| 1159 | 1161 |
| 1160 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1162 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
| 1161 }; | 1163 }; |
| 1162 | 1164 |
| 1163 } // namespace trace_event | 1165 } // namespace trace_event |
| 1164 } // namespace base | 1166 } // namespace base |
| 1165 | 1167 |
| 1166 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ | 1168 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ |
| OLD | NEW |