From 2ba5bd244dabfc425563cf7615c702c60deda584 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 13 Nov 2024 22:46:44 -0800 Subject: charts: fix skipped overlay render in stalls when deferred The deferred pass only enters draw_chart() once regardless of this_sample_duration, with the idx always 0. So when this_sample_duration > 1 (stalls/repeated samples), the conditional draw_overlay_row() would only get entered in the non-deferred passes in deferred mode, which are short-circuited within draw_overlay_row() because we don't want to do render that stuff in those passes in deferred mode. The fix is trivial; always enter draw_overlay_row() for the deferred pass. This fixes a cosmetic artifact where you'd see stale / missing overlays in the hierarchy rows of output, when sample durations were falling behind schedule enough for this_sample_duration to be greater than 1. --- src/charts.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/charts.c b/src/charts.c index 29547f7..0e000df 100644 --- a/src/charts.c +++ b/src/charts.c @@ -958,9 +958,10 @@ static void draw_chart_rest(vwm_charts_t *charts, vwm_chart_t *chart, vmon_proc_ charts->inv_total_delta); } - /* only try draw the overlay on the last draw within a duration */ - if (sample_duration_idx == (charts->this_sample_duration - 1)) + /* unless a deferred pass, only try draw the overlay on the last draw within a duration */ + if (deferred_pass || sample_duration_idx == (charts->this_sample_duration - 1)) draw_overlay_row(charts, chart, proc, *depth, *row, deferred_pass); + (*row)++; /* recur any threads first, then any children processes */ -- cgit v1.2.3