]> granicus.if.org Git - sysstat/commitdiff
SVG: Don't extend X axis beyond time end
authorSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 10 Feb 2017 17:27:14 +0000 (18:27 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 10 Feb 2017 17:27:14 +0000 (18:27 +0100)
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 <sysstat@users.noreply.github.com>
sadf.c

diff --git a/sadf.c b/sadf.c
index 7a9a223bd9f653c9b7483f465e1e95e5e5a559da..1d996f94cfdba9d765332cde75e5162ad174b892 100644 (file)
--- 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]);