This source file includes following definitions.
- initialize
- getTraceCategoryEnabledFlag
- addTraceEvent
- updateTraceEventDuration
#include "config.h"
#include "platform/EventTracer.h"
#include "public/platform/Platform.h"
#include "wtf/Assertions.h"
#include <stdio.h>
namespace WebCore {
COMPILE_ASSERT(sizeof(blink::Platform::TraceEventHandle) == sizeof(TraceEvent::TraceEventHandle), TraceEventHandle_types_must_be_compatible);
long dummyTraceSamplingState = 0;
long* traceSamplingState[3] = {&dummyTraceSamplingState, &dummyTraceSamplingState, &dummyTraceSamplingState };
void EventTracer::initialize()
{
traceSamplingState[0] = blink::Platform::current()->getTraceSamplingState(0);
if (!traceSamplingState[0])
traceSamplingState[0] = &dummyTraceSamplingState;
traceSamplingState[1] = blink::Platform::current()->getTraceSamplingState(1);
if (!traceSamplingState[1])
traceSamplingState[1] = &dummyTraceSamplingState;
traceSamplingState[2] = blink::Platform::current()->getTraceSamplingState(2);
if (!traceSamplingState[2])
traceSamplingState[2] = &dummyTraceSamplingState;
}
const unsigned char* EventTracer::getTraceCategoryEnabledFlag(const char* categoryName)
{
return blink::Platform::current()->getTraceCategoryEnabledFlag(categoryName);
}
TraceEvent::TraceEventHandle EventTracer::addTraceEvent(char phase, const unsigned char* categoryEnabledFlag,
const char* name, unsigned long long id, int numArgs, const char** argNames,
const unsigned char* argTypes, const unsigned long long* argValues, unsigned char flags)
{
return blink::Platform::current()->addTraceEvent(phase, categoryEnabledFlag, name, id, numArgs, argNames, argTypes, argValues, flags);
}
void EventTracer::updateTraceEventDuration(const unsigned char* categoryEnabledFlag, const char* name, TraceEvent::TraceEventHandle handle)
{
blink::Platform::current()->updateTraceEventDuration(categoryEnabledFlag, name, handle);
}
}