profiler: Report CPU times and use them to compute "missed" ticks.

This shows that the profiler is still pretty broken, because we
are missing quite a lot of ticks on average. One run of
"profile pkgman search" here produced an output with 66 total ticks
and 423 (!) missed ticks. A brief run of WebPositive was not quite
as bad (main thread: 1078 total ticks, 157 missed ticks.)

Change-Id: Idfc34534e66eff0fe7e948fcc3576be09db879a3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7820
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Augustin Cavalier
2024-07-08 17:13:30 +00:00
committed by waddlesplash
parent 60b260aca1
commit 2813fd13ca
14 changed files with 100 additions and 11 deletions
+1
View File
@@ -622,6 +622,7 @@ typedef struct {
// <sample 1> ... <sample stack_depth>
bool stopped; // if true, the thread is no longer
// being profiled
bigtime_t last_cpu_time; // only set if "stopped" is
} debug_profiler_update;
// B_DEBUGGER_MESSAGE_HANDED_OVER
@@ -112,12 +112,14 @@ struct system_profiler_thread_added {
team_id team;
thread_id thread;
char name[B_OS_NAME_LENGTH];
bigtime_t cpu_time;
};
// B_SYSTEM_PROFILER_THREAD_REMOVED
struct system_profiler_thread_removed {
team_id team;
thread_id thread;
bigtime_t cpu_time;
};
// B_SYSTEM_PROFILER_IMAGE_ADDED