From 35ed801512e3d9ff9c194259ca1ea274bf621eeb Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Mon, 1 Dec 2025 17:43:17 +0000 Subject: [PATCH] gh-138122: Small fixes to the new tachyon UI --- Lib/profiling/sampling/flamegraph.js | 4 +++- Lib/profiling/sampling/flamegraph_template.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/profiling/sampling/flamegraph.js b/Lib/profiling/sampling/flamegraph.js index 7a2b2ef2e3135e..494d156a8dddfc 100644 --- a/Lib/profiling/sampling/flamegraph.js +++ b/Lib/profiling/sampling/flamegraph.js @@ -633,7 +633,9 @@ function populateThreadStats(data, selectedThreadId = null) { if (gilHeldPctElem) gilHeldPctElem.textContent = `${(threadStats.has_gil_pct || 0).toFixed(1)}%`; const gilReleasedPctElem = document.getElementById('gil-released-pct'); - if (gilReleasedPctElem) gilReleasedPctElem.textContent = `${(threadStats.on_cpu_pct || 0).toFixed(1)}%`; + // GIL Released = not holding GIL and not waiting for it + const gilReleasedPct = Math.max(0, 100 - (threadStats.has_gil_pct || 0) - (threadStats.gil_requested_pct || 0)); + if (gilReleasedPctElem) gilReleasedPctElem.textContent = `${gilReleasedPct.toFixed(1)}%`; const gilWaitingPctElem = document.getElementById('gil-waiting-pct'); if (gilWaitingPctElem) gilWaitingPctElem.textContent = `${(threadStats.gil_requested_pct || 0).toFixed(1)}%`; diff --git a/Lib/profiling/sampling/flamegraph_template.html b/Lib/profiling/sampling/flamegraph_template.html index 09b673b76da506..82102c229e7af9 100644 --- a/Lib/profiling/sampling/flamegraph_template.html +++ b/Lib/profiling/sampling/flamegraph_template.html @@ -155,7 +155,7 @@

Runtime Stats

--
-
Waiting
+
Waiting GIL
--