From d2ae398f2b3740ad74c9eabc4ae2b08b7446521b Mon Sep 17 00:00:00 2001
From: Vito Caputo <vcaputo@pengaru.com>
Date: Sun, 12 Sep 2021 17:04:42 -0700
Subject: charts: don't show argv for threads

comm is where the thread name will be if set, and when set it can
be awkward to then see the process' argv following the thread
name.  This reduces the amount of clutter and visual noise for
threaded processes...
---
 src/charts.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/charts.c b/src/charts.c
index c8fcadb..82516ab 100644
--- a/src/charts.c
+++ b/src/charts.c
@@ -438,11 +438,13 @@ static void argv2xtext(vmon_proc_t *proc, XTextItem *items, int max_items, int *
 	items[nr].font = None;
 	nr++;
 
-	for (i = 1; nr < max_items && i < ((vmon_proc_stat_t *)proc->stores[VMON_STORE_PROC_STAT])->argc; nr++, i++) {
-		items[nr].chars = ((vmon_proc_stat_t *)proc->stores[VMON_STORE_PROC_STAT])->argv[i];
-		items[nr].nchars = strlen(((vmon_proc_stat_t *)proc->stores[VMON_STORE_PROC_STAT])->argv[i]);	/* TODO: libvmon should inform us of the length */
-		items[nr].delta = 4;
-		items[nr].font = None;
+	if (!proc->is_thread) { /* suppress the argv for threads */
+		for (i = 1; nr < max_items && i < ((vmon_proc_stat_t *)proc->stores[VMON_STORE_PROC_STAT])->argc; nr++, i++) {
+			items[nr].chars = ((vmon_proc_stat_t *)proc->stores[VMON_STORE_PROC_STAT])->argv[i];
+			items[nr].nchars = strlen(((vmon_proc_stat_t *)proc->stores[VMON_STORE_PROC_STAT])->argv[i]);	/* TODO: libvmon should inform us of the length */
+			items[nr].delta = 4;
+			items[nr].font = None;
+		}
 	}
 
 	(*nr_items) = nr;
-- 
cgit v1.2.3