From ba2ed566903fa229ce3f25d56a130398db8ebb47 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Mon, 9 Jul 2018 15:35:47 +0200 Subject: [PATCH] sadf: SVG: Don't display "No data" over the table of contents Sometimes, when all the selected activities have only zero values and the skipempty option has been used with "sadf -g", the "No data" message is displayed instead of the graphs. In these conditions make sure that it doesn't get printed over the table of contents entries. Here is how to reproduce the problem on my system (I don't have any network filesystems): $ sadf -g -O showtoc,skipempty -- -n NFS,NFSD > output.svg Signed-off-by: Sebastien GODARD --- sadf_misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sadf_misc.c b/sadf_misc.c index e8ab8df..cea1cf8 100644 --- a/sadf_misc.c +++ b/sadf_misc.c @@ -985,7 +985,9 @@ __printf_funct_t print_svg_header(void *parm, int action, char *dfile, if (!(action & F_BEGIN)) { if (!hdr_parm->graph_nr) { /* No views displayed */ - printf(""); + printf("", + SVG_H_YSIZE + + SVG_C_YSIZE * (DISPLAY_TOC(flags) ? hdr_parm->nr_act_dispd : 0)); printf("No data!\n"); } /* Give actual SVG height */ -- 2.40.0