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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 private: | 33 private: |
34 // Creates a process-wide unique ID to represent this task in trace events. | 34 // Creates a process-wide unique ID to represent this task in trace events. |
35 // This will be mangled with a Process ID hash to reduce the likelyhood of | 35 // This will be mangled with a Process ID hash to reduce the likelyhood of |
36 // colliding with TaskAnnotator pointers on other processes. | 36 // colliding with TaskAnnotator pointers on other processes. |
37 uint64_t GetTaskTraceID(const PendingTask& task) const; | 37 uint64_t GetTaskTraceID(const PendingTask& task) const; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(TaskAnnotator); | 39 DISALLOW_COPY_AND_ASSIGN(TaskAnnotator); |
40 }; | 40 }; |
41 | 41 |
42 #define TRACE_TASK_EXECUTION(run_function, task) \ | |
43 TRACE_EVENT2("toplevel", (run_function), "src_file", \ | |
44 (task).posted_from.file_name(), "src_func", \ | |
45 (task).posted_from.function_name()); | |
46 | |
47 } // namespace debug | 42 } // namespace debug |
48 } // namespace base | 43 } // namespace base |
49 | 44 |
50 #endif // BASE_DEBUG_TASK_ANNOTATOR_H_ | 45 #endif // BASE_DEBUG_TASK_ANNOTATOR_H_ |
OLD | NEW |