mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-22 16:50:49 +00:00
Add a flame graph achievement.
This commit is contained in:
@@ -225,6 +225,7 @@ Embed(PROFILER_FILES TextLoadTrace src/achievements/LoadTrace.md TEXT)
|
||||
Embed(PROFILER_FILES TextLocks src/achievements/Locks.md TEXT)
|
||||
Embed(PROFILER_FILES TextManual src/achievements/Manual.md TEXT)
|
||||
Embed(PROFILER_FILES TextMemory src/achievements/Memory.md TEXT)
|
||||
Embed(PROFILER_FILES TextLightFlame src/achievements/LightFlame.md TEXT)
|
||||
Embed(PROFILER_FILES TextPlots src/achievements/Plots.md TEXT)
|
||||
Embed(PROFILER_FILES TextReadSource src/achievements/ReadSource.md TEXT)
|
||||
Embed(PROFILER_FILES TextSamplingIntro src/achievements/SamplingIntro.md TEXT)
|
||||
|
||||
7
profiler/src/achievements/LightFlame.md
Normal file
7
profiler/src/achievements/LightFlame.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Light the flame
|
||||
|
||||
The timeline shows what happened when: every zone drawn at its exact duration, on its own thread. The [flame graph](#flamegraph) answers the other question, where the total time went. It merges all threads and sums every run of each zone per call stack, so a box's width is total time, not a single execution.
|
||||
|
||||
Open it with the * Flame* button on the top bar. In *Instrumentation* mode the tree is built from your zones; hovering a box shows its execution and self time, clicking jumps to the zone statistics. In *Sampling* mode the tree is built from call stack samples, and clicking a box opens the source code.
|
||||
|
||||
Open the flame graph and see where the time goes. Try it out!
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "data/TextInstrumentationStatistics.hpp"
|
||||
#include "data/TextIntro.hpp"
|
||||
#include "data/TextLeaks.hpp"
|
||||
#include "data/TextLightFlame.hpp"
|
||||
#include "data/TextLoadTrace.hpp"
|
||||
#include "data/TextLocks.hpp"
|
||||
#include "data/TextManual.hpp"
|
||||
@@ -129,7 +130,13 @@ AchievementItem ai_readSource = {
|
||||
.text = Unpack( TextReadSource )
|
||||
};
|
||||
|
||||
AchievementItem* ac_inspectZoneItems[] = { &ai_findZone, &ai_readSource, nullptr };
|
||||
AchievementItem ai_lightFlame = {
|
||||
.id = "lightFlame",
|
||||
.name = "Light the flame",
|
||||
.text = Unpack( TextLightFlame )
|
||||
};
|
||||
|
||||
AchievementItem* ac_inspectZoneItems[] = { &ai_findZone, &ai_readSource, &ai_lightFlame, nullptr };
|
||||
|
||||
AchievementItem ai_inspectZone = {
|
||||
.id = "inspectZone",
|
||||
|
||||
@@ -981,6 +981,7 @@ static void ClampFlameGraphViewport( int64_t& start, int64_t& end, int64_t total
|
||||
|
||||
void View::DrawFlameGraph()
|
||||
{
|
||||
if( s_config.achievements ) Achieve( "lightFlame" );
|
||||
const auto scale = GetScale();
|
||||
ImGui::SetNextWindowSize( ImVec2( 1400 * scale, 800 * scale ), ImGuiCond_FirstUseEver );
|
||||
m_flameGraphConstraint.Constrain();
|
||||
|
||||
Reference in New Issue
Block a user