gh-141645: Add a TUI mode to the new tachyon profiler (#141646)

This commit is contained in:
Pablo Galindo Salgado 2025-11-20 18:27:17 +00:00 committed by GitHub
parent e90061f5f1
commit b3383085f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 5519 additions and 60 deletions

View file

@ -2761,7 +2761,13 @@ unwind_stack_for_thread(
// Check CPU status
long pthread_id = GET_MEMBER(long, ts, unwinder->debug_offsets.thread_state.thread_id);
int cpu_status = get_thread_status(unwinder, tid, pthread_id);
// Optimization: only check CPU status if needed by mode because it's expensive
int cpu_status = -1;
if (unwinder->mode == PROFILING_MODE_CPU || unwinder->mode == PROFILING_MODE_ALL) {
cpu_status = get_thread_status(unwinder, tid, pthread_id);
}
if (cpu_status == -1) {
status_flags |= THREAD_STATUS_UNKNOWN;
} else if (cpu_status == THREAD_STATE_RUNNING) {