Skip to content

Commit

Permalink
Update flow events tracing in SequencedWorkerPool::Inner::PostTask an…
Browse files Browse the repository at this point in the history
…d SequencedWorkerPool::Inner::ThreadLoop to use Flow v2.

BUG=catapult-project/catapult#1079

Review URL: https://codereview.chromium.org/1296463004

Cr-Commit-Position: refs/heads/master@{#344055}
  • Loading branch information
yuhaoz authored and Commit bot committed Aug 18, 2015
1 parent 8264527 commit 993f71b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions base/threading/sequenced_worker_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,10 @@ bool SequencedWorkerPool::Inner::PostTask(
// The trace_id is used for identifying the task in about:tracing.
sequenced.trace_id = trace_id_++;

TRACE_EVENT_FLOW_BEGIN0(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
"SequencedWorkerPool::PostTask",
TRACE_ID_MANGLE(GetTaskTraceID(sequenced, static_cast<void*>(this))));
TRACE_EVENT_WITH_FLOW0(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
"SequencedWorkerPool::Inner::PostTask",
TRACE_ID_MANGLE(GetTaskTraceID(sequenced, static_cast<void*>(this))),
TRACE_EVENT_FLAG_FLOW_OUT);

sequenced.sequence_task_number = LockedGetNextSequenceTaskNumber();

Expand Down Expand Up @@ -754,12 +755,12 @@ void SequencedWorkerPool::Inner::ThreadLoop(Worker* this_worker) {
GetWorkStatus status =
GetWork(&task, &wait_time, &delete_these_outside_lock);
if (status == GET_WORK_FOUND) {
TRACE_EVENT_FLOW_END0(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
"SequencedWorkerPool::PostTask",
TRACE_ID_MANGLE(GetTaskTraceID(task, static_cast<void*>(this))));
TRACE_EVENT2("toplevel", "SequencedWorkerPool::ThreadLoop",
"src_file", task.posted_from.file_name(),
"src_func", task.posted_from.function_name());
TRACE_EVENT_WITH_FLOW2(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
"SequencedWorkerPool::Inner::ThreadLoop",
TRACE_ID_MANGLE(GetTaskTraceID(task, static_cast<void*>(this))),
TRACE_EVENT_FLAG_FLOW_IN,
"src_file", task.posted_from.file_name(),
"src_func", task.posted_from.function_name());
int new_thread_id = WillRunWorkerTask(task);
{
AutoUnlock unlock(lock_);
Expand Down

0 comments on commit 993f71b

Please sign in to comment.