From: Sebastien GODARD Date: Fri, 22 Jan 2021 17:19:33 +0000 (+0100) Subject: SVG: Make graphe discontinuous for disconnected devices X-Git-Tag: v12.5.3~15^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54e906fb594c0faedb6eb288887a4493501d75e0;p=sysstat SVG: Make graphe discontinuous for disconnected devices Make SVG graph discontinuous for devices which have been unregistered (disconnected) then registered (connected) again during the same time interval. Signed-off-by: Sebastien GODARD --- diff --git a/svg_stats.c b/svg_stats.c index 864f8a3..d41edb6 100644 --- a/svg_stats.c +++ b/svg_stats.c @@ -2185,6 +2185,7 @@ __print_funct_t svg_print_disk_stats(struct activity *a, int curr, int action, s if (j < 0) { /* This is a newly registered interface. Previous stats are zero */ sdp = &sdpzero; + restart = TRUE; } else { sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize); @@ -2415,6 +2416,7 @@ __print_funct_t svg_print_net_dev_stats(struct activity *a, int curr, int action if (j < 0) { /* This is a newly registered interface. Previous stats are zero */ sndp = &sndzero; + restart = TRUE; } else { sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize); @@ -2593,6 +2595,7 @@ __print_funct_t svg_print_net_edev_stats(struct activity *a, int curr, int actio /* For each network interfaces structure */ for (i = 0; i < a->nr[curr]; i++) { snedc = (struct stats_net_edev *) ((char *) a->buf[curr] + i * a->msize); + if (!strcmp(snedc->interface, "")) /* Empty structure: This is the end of the list */ break; @@ -2635,6 +2638,7 @@ __print_funct_t svg_print_net_edev_stats(struct activity *a, int curr, int actio if (j < 0) { /* This is a newly registered interface. Previous stats are zero */ snedp = &snedzero; + restart = TRUE; } else { snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize); @@ -5038,6 +5042,7 @@ __print_funct_t svg_print_fchost_stats(struct activity *a, int curr, int action, if (!found) { /* This is a newly registered host */ sfcp = &sfczero; + restart = TRUE; } /*