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 <seiden@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Mete Durlu
2025-12-03 12:48:35 +01:00
committed by Steffen Eiden
parent 617a8248e8
commit fe78faa8ae

View File

@@ -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)