Index: base/debug/task_annotator.cc |
diff --git a/base/debug/task_annotator.cc b/base/debug/task_annotator.cc |
index 19df8cb39e5129b9c02987f919b8bdb7cc1d7760..e456089d95dce17916c1ffe8a015e08f9d9fcd95 100644 |
--- a/base/debug/task_annotator.cc |
+++ b/base/debug/task_annotator.cc |
@@ -20,6 +20,9 @@ TaskAnnotator::~TaskAnnotator() { |
void TaskAnnotator::DidQueueTask(const char* queue_function, |
const PendingTask& pending_task) { |
+ TRACE_EVENT_WITH_FLOW0("toplevel", "TaskAnnotator::DidQueueTask", |
+ TRACE_ID_MANGLE(GetTaskTraceID(pending_task)), |
+ TRACE_EVENT_FLAG_FLOW_OUT); |
TRACE_EVENT_FLOW_BEGIN0(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"), |
queue_function, |
TRACE_ID_MANGLE(GetTaskTraceID(pending_task))); |
@@ -33,24 +36,21 @@ void TaskAnnotator::RunTask(const char* queue_function, |
tracked_objects::Duration queue_duration = |
stopwatch.StartTime() - pending_task.EffectiveTimePosted(); |
- TRACE_EVENT_FLOW_END1(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"), |
- queue_function, |
- TRACE_ID_MANGLE(GetTaskTraceID(pending_task)), |
- "queue_duration", |
- queue_duration.InMilliseconds()); |
- |
// When tracing memory for posted tasks it's more valuable to attribute the |
// memory allocations to the source function than generically to the task |
// runner. |
- TRACE_EVENT_WITH_MEMORY_TAG2( |
- "toplevel", |
- run_function, |
+ TRACE_EVENT_WITH_MEMORY_TAG_WITH_FLOW2( |
+ "toplevel", run_function, |
pending_task.posted_from.function_name(), // Name for memory tracking. |
- "src_file", |
- pending_task.posted_from.file_name(), |
- "src_func", |
+ TRACE_ID_MANGLE(GetTaskTraceID(pending_task)), TRACE_EVENT_FLAG_FLOW_IN, |
+ "src_file", pending_task.posted_from.file_name(), "src_func", |
pending_task.posted_from.function_name()); |
+ TRACE_EVENT_FLOW_END1(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"), |
+ queue_function, |
+ TRACE_ID_MANGLE(GetTaskTraceID(pending_task)), |
+ "queue_duration", queue_duration.InMilliseconds()); |
+ |
// Before running the task, store the program counter where it was posted |
// and deliberately alias it to ensure it is on the stack if the task |
// crashes. Be careful not to assume that the variable itself will have the |