void GPUMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter, UniqueStacks& aUniqueStacks) { streamCommonProps("gpu_timer_query", aWriter, aUniqueStacks); aWriter.DoubleProperty("cpustart", profiler_time(mCpuTimeStart)); aWriter.DoubleProperty("cpuend", profiler_time(mCpuTimeEnd)); aWriter.IntProperty("gpustart", (int)mGpuTimeStart); aWriter.IntProperty("gpuend", (int)mGpuTimeEnd); }
void GPUMarkerPayload::streamPayloadImp(JSStreamWriter& b) { b.BeginObject(); streamCommonProps("gpu_timer_query", b); b.NameValue("cpustart", profiler_time(mCpuTimeStart)); b.NameValue("cpuend", profiler_time(mCpuTimeEnd)); b.NameValue("gpustart", (int)mGpuTimeStart); b.NameValue("gpuend", (int)mGpuTimeEnd); b.EndObject(); }
void ProfilerMarkerPayload::streamCommonProps(const char* aMarkerType, JSStreamWriter& b) { MOZ_ASSERT(aMarkerType); b.NameValue("type", aMarkerType); if (!mStartTime.IsNull()) { b.NameValue("startTime", profiler_time(mStartTime)); } if (!mEndTime.IsNull()) { b.NameValue("endTime", profiler_time(mEndTime)); } if (mStack) { b.Name("stack"); mStack->StreamJSObject(b); } }
void VsyncPayload::streamPayloadImpl(JSStreamWriter& b) { b.BeginObject(); b.NameValue("vsync", profiler_time(mVsyncTimestamp)); b.NameValue("category", "VsyncTimestamp"); b.EndObject(); }
template<typename Builder> void ProfilerMarkerPayload::prepareCommonProps(const char* aMarkerType, Builder& aBuilder, typename Builder::ObjectHandle aObject) { MOZ_ASSERT(aMarkerType); aBuilder.DefineProperty(aObject, "type", aMarkerType); if (!mStartTime.IsNull()) { aBuilder.DefineProperty(aObject, "startTime", profiler_time(mStartTime)); } if (!mEndTime.IsNull()) { aBuilder.DefineProperty(aObject, "endTime", profiler_time(mEndTime)); } if (mStack) { typename Builder::RootedObject stack(aBuilder.context(), aBuilder.CreateObject()); aBuilder.DefineProperty(aObject, "stack", stack); mStack->BuildJSObject(aBuilder, stack); } }
void ProfilerMarkerPayload::streamCommonProps(const char* aMarkerType, SpliceableJSONWriter& aWriter, UniqueStacks& aUniqueStacks) { MOZ_ASSERT(aMarkerType); aWriter.StringProperty("type", aMarkerType); if (!mStartTime.IsNull()) { aWriter.DoubleProperty("startTime", profiler_time(mStartTime)); } if (!mEndTime.IsNull()) { aWriter.DoubleProperty("endTime", profiler_time(mEndTime)); } if (mStack) { aWriter.StartObjectProperty("stack"); { mStack->StreamJSON(aWriter, aUniqueStacks); } aWriter.EndObject(); } }
static double GetProfilerTime() { if (!profiler_is_active()) { return 0.0; } return profiler_time(); };
void VsyncPayload::StreamPayload(SpliceableJSONWriter& aWriter, UniqueStacks& aUniqueStacks) { aWriter.DoubleProperty("vsync", profiler_time(mVsyncTimestamp)); aWriter.StringProperty("category", "VsyncTimestamp"); }