From 0f8807884e316f60e7828c53a43ee6bd18f7348b Mon Sep 17 00:00:00 2001
From: Vito Caputo <vcaputo@pengaru.com>
Date: Tue, 21 Sep 2021 02:37:00 -0700
Subject: =?UTF-8?q?charts:=20Wall=3D=3F=3Fs=20if=20proc=5Fstat->start=20is?=
 =?UTF-8?q?=20>=20boottime?=

Since libvmon samples the sys_wants before proc_wants, it's
entirely possible the proc_stat->start will be later than
sys_stat->boottime by the time a given process gets sampled.

Simply treat this analogous to being unable to sample the start,
either of which will only leave the Wall as ??s in the highly
ephemeral short-lived process scenario.  In the > boottime case,
the next sample for the same process would have start <= boottime
---
 src/charts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/charts.c b/src/charts.c
index 6566f0a..fc33612 100644
--- a/src/charts.c
+++ b/src/charts.c
@@ -795,7 +795,7 @@ static void draw_columns(vwm_charts_t *charts, vwm_chart_t *chart, vwm_column_t
 		case VWM_COLUMN_PROC_WALL: /* User Sys Wall times */
 			if (!row)
 				str_len = snpf(str, sizeof(str), "Wall");
-			else if (!proc_stat->start)
+			else if (!proc_stat->start || proc_stat->start > sys_stat->boottime)
 				str_len = snpf(str, sizeof(str), "??s");
 			else
 				str_len = snpf(str, sizeof(str), "%.2fs",
-- 
cgit v1.2.3