Chromium Code Reviews| Index: base/debug/task_annotator.cc |
| diff --git a/base/debug/task_annotator.cc b/base/debug/task_annotator.cc |
| index b74d390938d75867af4f52d379774ae6fe265667..cfe5662301e1982df8606ac061b4a8751ea62ff8 100644 |
| --- a/base/debug/task_annotator.cc |
| +++ b/base/debug/task_annotator.cc |
| @@ -20,9 +20,10 @@ TaskAnnotator::~TaskAnnotator() { |
| void TaskAnnotator::DidQueueTask(const char* queue_function, |
| const PendingTask& pending_task) { |
| - TRACE_EVENT_FLOW_BEGIN0(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"), |
| - queue_function, |
| - TRACE_ID_MANGLE(GetTaskTraceID(pending_task))); |
| + TRACE_EVENT_WITH_FLOW0("toplevel", |
|
dsinclair
2015/08/05 19:38:04
The category should still be TRACE_DISABLED_BY_DEF
|
| + "QueueTask", |
|
dsinclair
2015/08/05 19:38:04
Why did you change the name from queue_function?
yuhaoz
2015/08/05 21:22:07
Because queue_function is the name of the original
|
| + TRACE_ID_MANGLE(GetTaskTraceID(pending_task)), |
| + TRACE_EVENT_FLAG_FLOW_OUT); |
| } |
| void TaskAnnotator::RunTask(const char* queue_function, |
| @@ -32,11 +33,14 @@ 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()); |
| + { |
| + TRACE_EVENT_WITH_FLOW1("toplevel", |
|
dsinclair
2015/08/05 19:38:04
TRACE_DISABLED_BY_DEFAULT("toplevel.flow")
|
| + "RunTask", |
|
dsinclair
2015/08/05 19:38:04
Why did this change from queue_function to RunTask
|
| + TRACE_ID_MANGLE(GetTaskTraceID(pending_task)), |
| + TRACE_EVENT_FLAG_FLOW_IN, |
| + "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 |