From: Sebastien GODARD Date: Fri, 15 Jun 2018 14:25:10 +0000 (+0200) Subject: sadf: SVG: Don't take into account activites with no graphs X-Git-Tag: v12.0.0~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3c1518a5c22dc84f5ab8f2660764f52b73fc3d97;p=sysstat sadf: SVG: Don't take into account activites with no graphs In "packed" mode, activities which don't have a graph (e.g. USB devices) should not be taken into account when calculating SVG canvas height. Without this patch, a command like: $ sadf -g -O packed -- -A > output.svg created a SVG file with some unused white space at its end. Signed-off-by: Sebastien GODARD --- diff --git a/sadf.c b/sadf.c index bbe6c1c..2bd4133 100644 --- a/sadf.c +++ b/sadf.c @@ -513,7 +513,7 @@ int get_svg_graph_nr(int ifd, char *file, struct file_magic *file_magic, continue; p = get_activity_position(act, id_seq[i], EXIT_IF_NOT_FOUND); - if (!IS_SELECTED(act[p]->options)) + if (!IS_SELECTED(act[p]->options) || !act[p]->g_nr) continue; if (((act[p]->id == A_NET_DEV) || (act[p]->id == A_NET_EDEV)) &&