MCPcopy Create free account
hub / github.com/defold/defold / ProcessSample

Function ProcessSample

engine/profiler/src/profiler.cpp:868–886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

866}
867
868static void ProcessSample(dmProfileRender::ProfilerThread* thread, int indent, dmProfiler::HSample sample)
869{
870 dmProfileRender::ProfilerSample out;
871
872 out.m_StartTime = dmProfiler::SampleGetStart(sample);
873 out.m_Time = dmProfiler::SampleGetTime(sample);
874 out.m_SelfTime = dmProfiler::SampleGetSelfTime(sample);
875 out.m_Count = dmProfiler::SampleGetCallCount(sample);
876 out.m_Color = dmProfiler::SampleGetColor(sample);
877 out.m_Indent = (uint8_t)indent;
878 const char* name = dmProfiler::SampleGetName(sample);
879 out.m_NameHash = dmHashString32(name?name:"<empty_sample_name>");
880 if (!out.m_Color)
881 out.m_Color = MakeColorFromHash(out.m_NameHash);
882
883 if (thread->m_Samples.Full())
884 thread->m_Samples.OffsetCapacity(32);
885 thread->m_Samples.Push(out);
886}
887
888static void TraverseSampleTree(dmProfileRender::ProfilerThread* thread, int indent, dmProfiler::HSample sample)
889{

Callers 1

TraverseSampleTreeFunction · 0.85

Calls 10

SampleGetStartFunction · 0.85
SampleGetTimeFunction · 0.85
SampleGetSelfTimeFunction · 0.85
SampleGetCallCountFunction · 0.85
SampleGetColorFunction · 0.85
SampleGetNameFunction · 0.85
MakeColorFromHashFunction · 0.85
FullMethod · 0.45
OffsetCapacityMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected