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
3 // found in the LICENSE file.
6 #include "platform/scheduler/TracedTask.h"
10 volatile int TracedTask::s_nextFlowTraceID = 0;
12 void TracedTask::run() const
14 TRACE_EVENT_FLOW_END0("blink", m_traceName, MANGLE(m_flowTraceID));
16 TRACE_EVENT2("blink", m_traceName,
17 "src_file", m_location.fileName(),
18 "src_func", m_location.functionName());
23 TracedTask::TracedTask(const Task& task, const TraceLocation& location, const char* traceName)
25 , m_location(location)
26 , m_traceName(traceName)
29 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink", &tracingEnabled);
32 // atomicIncrement is slow so we only do it if tracing is enabled
33 m_flowTraceID = static_cast<uint64_t>(atomicIncrement(&s_nextFlowTraceID));
35 TRACE_EVENT_FLOW_BEGIN2("blink", m_traceName, MANGLE(m_flowTraceID),
36 "src_file", m_location.fileName(),
37 "src_func", m_location.functionName());