From 26c544998ea2f4fdc9ffce8c9cdb8b15f1e56e3c Mon Sep 17 00:00:00 2001 From: Fedor Loshakov Date: Tue, 1 Sep 2020 13:02:02 +0200 Subject: [PATCH] ziomon/ziorep_printers: fix virtual adapter CSV output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During using of ziorep_utilization utility for generating of CSV format output, there is one extra comma added after Bus-ID column in virtual adapter report for each line. This creates one extra column with empty content for each line. As a result in CSV viewer programs 'qdio utilization max %' column has no content, all subsequent columns have shifted content from previous column and the last column has no header. Avoid this situation by deleting of extra comma. Before patch application typical line of virtual adapter report looks like: 2020-05-14 13:55:43,0,60,0.0.1906,,0.000000,0.782567,0,0,0.0,321.8,1,1251 After patch application typical line of virtual adapter report looks like: 2020-05-14 13:55:43,0,60,0.0.1906,0.000000,0.782567,0,0,0.0,321.8,1,1251 Signed-off-by: Fedor Loshakov Reviewed-by: Julian Wiedmann Reviewed-by: Steffen Maier Signed-off-by: Jan Höppner --- ziomon/ziorep_printers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ziomon/ziorep_printers.cpp b/ziomon/ziorep_printers.cpp index 87ba09ee..c3eaa1ba 100644 --- a/ziomon/ziorep_printers.cpp +++ b/ziomon/ziorep_printers.cpp @@ -420,7 +420,7 @@ void VirtAdapterPrinter::print_virt_adpt(FILE *fp, __u32 devno, int *rc) { if (m_csv) - fprintf(fp, "%x,%x.%x.%04x,", + fprintf(fp, "%x,%x.%x.%04x", m_cfg->get_chpid_by_devno(devno, rc), ZIOREP_BUSID_UNPACKED(devno)); else