]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-138122: Small fixes to the new tachyon UI (#142157)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 1 Dec 2025 18:37:46 +0000 (18:37 +0000)
committerGitHub <noreply@github.com>
Mon, 1 Dec 2025 18:37:46 +0000 (18:37 +0000)
Lib/profiling/sampling/flamegraph.js
Lib/profiling/sampling/flamegraph_template.html

index 7a2b2ef2e3135e8d64318a8adbad8a88d6d15996..494d156a8dddfcc54339f0219870fe9ac714e6ff 100644 (file)
@@ -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)}%`;
index 09b673b76da506765aa038b694b45121e4b1b842..82102c229e7af92a284fbc4c1d86713647df0255 100644 (file)
                   </div>
                   <div class="stat-tile stat-tile--yellow" id="gil-waiting-stat">
                     <div class="stat-tile-value" id="gil-waiting-pct">--</div>
-                    <div class="stat-tile-label">Waiting</div>
+                    <div class="stat-tile-label">Waiting GIL</div>
                   </div>
                   <div class="stat-tile stat-tile--purple" id="gc-stat">
                     <div class="stat-tile-value" id="gc-pct">--</div>