| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DEBUG_TASK_ANNOTATOR_H_ | 5 #ifndef BASE_DEBUG_TASK_ANNOTATOR_H_ |
| 6 #define BASE_DEBUG_TASK_ANNOTATOR_H_ | 6 #define BASE_DEBUG_TASK_ANNOTATOR_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 // Creates a process-wide unique ID to represent this task in trace events. | 32 // Creates a process-wide unique ID to represent this task in trace events. |
| 33 // This will be mangled with a Process ID hash to reduce the likelyhood of | 33 // This will be mangled with a Process ID hash to reduce the likelyhood of |
| 34 // colliding with TaskAnnotator pointers on other processes. | 34 // colliding with TaskAnnotator pointers on other processes. |
| 35 uint64 GetTaskTraceID(const PendingTask& task) const; | 35 uint64 GetTaskTraceID(const PendingTask& task) const; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(TaskAnnotator); | 37 DISALLOW_COPY_AND_ASSIGN(TaskAnnotator); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 #define TRACE_TASK_EXECUTION(run_function, task) \ | 40 #define TRACE_TASK_EXECUTION(run_function, task) \ |
| 41 TRACE_EVENT_WITH_MEMORY_TAG2( \ | 41 TRACE_EVENT2("toplevel", (run_function), "src_file", \ |
| 42 "toplevel", (run_function), \ | 42 (task).posted_from.file_name(), "src_func", \ |
| 43 (task).posted_from.function_name(), /* Name for memory tracking. */ \ | 43 (task).posted_from.function_name()); |
| 44 "src_file", (task).posted_from.file_name(), "src_func", \ | |
| 45 (task).posted_from.function_name()); | |
| 46 | 44 |
| 47 } // namespace debug | 45 } // namespace debug |
| 48 } // namespace base | 46 } // namespace base |
| 49 | 47 |
| 50 #endif // BASE_DEBUG_TASK_ANNOTATOR_H_ | 48 #endif // BASE_DEBUG_TASK_ANNOTATOR_H_ |
| OLD | NEW |