From: Sebastien GODARD Date: Fri, 10 Feb 2017 17:27:14 +0000 (+0100) Subject: SVG: Don't extend X axis beyond time end X-Git-Tag: v11.5.5~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5af388bf3692578571906c1a74c7e9f1e31d3f8a;p=sysstat SVG: Don't extend X axis beyond time end When a time end has been entered (with option "-e hh:mm:ss"), don't draw X axis beyond this limit even if some Linux Restart messages exist after this time limit. Signed-off-by: Sebastien GODARD --- diff --git a/sadf.c b/sadf.c index 7a9a223..1d996f9 100644 --- a/sadf.c +++ b/sadf.c @@ -902,6 +902,7 @@ void display_curr_act_graphs(int ifd, off_t fpos, int *curr, long *cnt, int *eos * displayed a line of stats. */ parm.restart = FALSE; + parm.ust_time_end = record_hdr[*curr].ust_time; *curr ^= 1; if (*cnt > 0) { (*cnt)--; @@ -919,9 +920,9 @@ void display_curr_act_graphs(int ifd, off_t fpos, int *curr, long *cnt, int *eos file_actlst, rectime, loctime); } while (!*eosaf && ((rtype == R_RESTART) || (rtype == R_COMMENT))); + *curr ^= 1; } - } while (!*eosaf); @@ -929,12 +930,9 @@ void display_curr_act_graphs(int ifd, off_t fpos, int *curr, long *cnt, int *eos /* Determine X axis end value */ if (DISPLAY_ONE_DAY(flags) && - (parm.ust_time_ref + (3600 * 24) > record_hdr[!*curr].ust_time)) { + (parm.ust_time_ref + (3600 * 24) > parm.ust_time_end)) { parm.ust_time_end = parm.ust_time_ref + (3600 * 24); } - else { - parm.ust_time_end = record_hdr[!*curr].ust_time; - } /* Actually display graphs for current activity */ (*act[p]->f_svg_print)(act[p], *curr, F_END, &parm, 0, &record_hdr[!*curr]);