Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1805)

Unified Diff: base/debug/task_annotator.cc

Issue 1275693002: Change PostTask to use Flow v2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use queue_function as the slice name. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/task_annotator.cc
diff --git a/base/debug/task_annotator.cc b/base/debug/task_annotator.cc
index b74d390938d75867af4f52d379774ae6fe265667..febaaaeb399bf457bbec9de23cadefb4a3f2c44c 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"),
+ TRACE_EVENT_WITH_FLOW0(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
queue_function,
- TRACE_ID_MANGLE(GetTaskTraceID(pending_task)));
+ 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());
+ {
dsinclair 2015/08/06 15:07:21 This doesn't need braces around it.
+ TRACE_EVENT_WITH_FLOW1(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
+ queue_function,
+ 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698