From fe78faa8aec272c228c6dc14f5dc62b727330cd9 Mon Sep 17 00:00:00 2001 From: Mete Durlu Date: Wed, 3 Dec 2025 12:48:35 +0100 Subject: [PATCH] hyptop/table: Fill system name column for CSV output When machine parseable format is specified via hyptop --format csv the summary row for csv does not have any indicator or and a blank system name. Avoid this confusion by adding "SUM" as system name. Reviewed-by: Steffen Eiden Signed-off-by: Mete Durlu Signed-off-by: Steffen Eiden --- hyptop/table.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hyptop/table.c b/hyptop/table.c index b1dbd05c..554099a4 100644 --- a/hyptop/table.c +++ b/hyptop/table.c @@ -988,8 +988,11 @@ static void l_row_print_formatted(struct table *t, struct table_row *row) unsigned int flags = 0; struct table_entry *e = &row->entries[col_nr]; - if (row == t->row_last && col_nr == 0) + if (row == t->row_last && col_nr == 0) { + if (g.o.format == FMT_CSV) + util_fmt_pair(FMT_QUOTE, col->head, "SUM", e->str); continue; + } if (table_col_needs_quotes(col)) flags = FMT_QUOTE; if (strcmp(e->str, "-") == 0 || strcmp(e->str, "") == 0)