mirror of
https://github.com/wolfpld/tracy.git
synced 2026-11-16 20:55:57 +00:00
Add a CPU data achievement.
This commit is contained in:
@@ -213,6 +213,7 @@ Embed(PROFILER_FILES TextAppInfo src/achievements/AppInfo.md TEXT)
|
||||
Embed(PROFILER_FILES TextConnectToClient src/achievements/ConnectToClient.md TEXT)
|
||||
Embed(PROFILER_FILES TextContention src/achievements/Contention.md TEXT)
|
||||
Embed(PROFILER_FILES TextContextSwitches src/achievements/ContextSwitches.md TEXT)
|
||||
Embed(PROFILER_FILES TextCpuData src/achievements/CpuData.md TEXT)
|
||||
Embed(PROFILER_FILES TextEntryStacks src/achievements/EntryStacks.md TEXT)
|
||||
Embed(PROFILER_FILES TextFindZone src/achievements/FindZone.md TEXT)
|
||||
Embed(PROFILER_FILES TextFrameImages src/achievements/FrameImages.md TEXT)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# See every process that ran
|
||||
|
||||
Context switch data also remembers every other process that ran during the session. The [CPU data window](#cpudata) lists them. You find it under the * Tools* menu as * CPU data*. Green entries are your program. Yellow marks threads the profiler knows. Sort by *Running time*: browsers, indexers, and daemons often use more CPU than the program you are profiling. The figure is real CPU time scaled to trace length, so above 100% means several cores were busy at once. *Slices* counts how often the scheduler put an entry on a core, *Core jumps* how often it put it on a different one. Hover your program in the list and the timeline draws its threads' paths across the cores.
|
||||
|
||||
> [!TIP]
|
||||
> **Tip**
|
||||
>
|
||||
> If the menu entry is disabled, the client captured no system data. The collection runs inside the profiled application, so the elevated rights the kernel demands must be granted to it. Details in [privilege elevation](#privilegeelevation).
|
||||
|
||||
Try it on a busy capture and see who has been eating your CPU.
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "data/TextConnectToClient.hpp"
|
||||
#include "data/TextContention.hpp"
|
||||
#include "data/TextContextSwitches.hpp"
|
||||
#include "data/TextCpuData.hpp"
|
||||
#include "data/TextEntryStacks.hpp"
|
||||
#include "data/TextFindZone.hpp"
|
||||
#include "data/TextFrameImages.hpp"
|
||||
@@ -78,7 +79,13 @@ AchievementItem ai_contextSwitches = {
|
||||
.text = Unpack( TextContextSwitches )
|
||||
};
|
||||
|
||||
AchievementItem* ac_samplingIntroItems[] = { &ai_ghostZones, &ai_samplingStats, &ai_entryStacks, &ai_contextSwitches, nullptr };
|
||||
AchievementItem ai_cpuData = {
|
||||
.id = "cpuData",
|
||||
.name = "See every process that ran",
|
||||
.text = Unpack( TextCpuData )
|
||||
};
|
||||
|
||||
AchievementItem* ac_samplingIntroItems[] = { &ai_ghostZones, &ai_samplingStats, &ai_entryStacks, &ai_contextSwitches, &ai_cpuData, nullptr };
|
||||
|
||||
AchievementItem ai_samplingIntro = {
|
||||
.id = "samplingIntro",
|
||||
|
||||
@@ -999,6 +999,7 @@ bool View::DrawImpl()
|
||||
const auto& ctd = m_worker.GetCpuThreadData();
|
||||
if( ButtonDisablable( ICON_FA_SLIDERS " CPU data", ctd.empty() ) )
|
||||
{
|
||||
if( s_config.achievements ) Achieve( "cpuData" );
|
||||
m_showCpuDataWindow = true;
|
||||
}
|
||||
ToggleButton( ICON_FA_NOTE_STICKY " Annotations", m_showAnnotationList );
|
||||
|
||||
Reference in New Issue
Block a user