*curr, file, &rtype, 0, file_magic,
file_actlst, rectime, UEOF_STOP);
- if (!*eosaf && (rtype != R_RESTART) && (rtype != R_COMMENT)) {
+ if (*eosaf || (rtype == R_RESTART))
+ break;
+
+ if (rtype != R_COMMENT) {
next = generic_write_stats(*curr, tm_start.use, tm_end.use, *reset, cnt,
NULL, rectime, reset_cd, act_id);
reset_cd = 0;
*reset = FALSE;
}
}
- while (*cnt && !*eosaf && (rtype != R_RESTART));
+ while (*cnt);
*reset = TRUE;
}
/*
* Restore the first stats collected.
- * Used to compute the rate displayed on the first line.
+ * Originally used to compute the rate displayed on the first line.
+ * Here, this is to plot the first point and start the graph.
*/
copy_structures(act, id_seq, record_hdr, !*curr, 2);
*eosaf = read_next_sample(ifd, IGNORE_RESTART | IGNORE_COMMENT | SET_TIMESTAMPS,
*curr, file, &rtype, 0, file_magic,
file_actlst, rectime, UEOF_CONT);
+ if (*eosaf)
+ break;
- if (!*eosaf && (rtype != R_COMMENT) && (rtype != R_RESTART)) {
+ if (rtype == R_RESTART) {
+ parm.restart = TRUE;
+ *reset = TRUE;
+ /* Go to next statistics record, if possible */
+ do {
+ *eosaf = read_next_sample(ifd, IGNORE_RESTART | IGNORE_COMMENT | SET_TIMESTAMPS,
+ *curr, file, &rtype, 0, file_magic,
+ file_actlst, rectime, UEOF_CONT);
+ }
+ while (!*eosaf && ((rtype == R_RESTART) || (rtype == R_COMMENT)));
+
+ *curr ^= 1;
+ }
+ else if (rtype != R_COMMENT) {
next = generic_write_stats(*curr, tm_start.use, tm_end.use, *reset, cnt,
&parm, rectime, reset_cd, act[p]->id);
}
*reset = FALSE;
}
- if (!*eosaf && (rtype == R_RESTART)) {
- parm.restart = TRUE;
- *reset = TRUE;
- /* Go to next statistics record, if possible */
- do {
- *eosaf = read_next_sample(ifd, IGNORE_RESTART | IGNORE_COMMENT | SET_TIMESTAMPS,
- *curr, file, &rtype, 0, file_magic,
- file_actlst, rectime, UEOF_CONT);
- }
- while (!*eosaf && ((rtype == R_RESTART) || (rtype == R_COMMENT)));
-
- *curr ^= 1;
- }
}
while (!*eosaf);
cnt = count;
reset = TRUE;
- if (!eosaf) {
+ if (eosaf)
+ break;
- /* Save the first stats collected. Used for example in next_slice() function */
- copy_structures(act, id_seq, record_hdr, 2, 0);
+ /* Save the first stats collected. Used for example in next_slice() function */
+ copy_structures(act, id_seq, record_hdr, 2, 0);
- do {
- eosaf = read_next_sample(ifd, ign_flag, curr, file,
- &rtype, tab, file_magic, file_actlst,
- rectime, UEOF_CONT);
+ do {
+ eosaf = read_next_sample(ifd, ign_flag, curr, file,
+ &rtype, tab, file_magic, file_actlst,
+ rectime, UEOF_CONT);
- if (!eosaf && (rtype != R_COMMENT) && (rtype != R_RESTART)) {
- if (*fmt[f_position]->f_statistics) {
- (*fmt[f_position]->f_statistics)(&tab, F_MAIN, act, id_seq);
- }
+ if (!eosaf && (rtype != R_COMMENT) && (rtype != R_RESTART)) {
+ if (*fmt[f_position]->f_statistics) {
+ (*fmt[f_position]->f_statistics)(&tab, F_MAIN, act, id_seq);
+ }
- /* next is set to 1 when we were close enough to desired interval */
- next = generic_write_stats(curr, tm_start.use, tm_end.use, reset,
- &cnt, &tab, rectime, FALSE, ALL_ACTIVITIES);
+ /* next is set to 1 when we were close enough to desired interval */
+ next = generic_write_stats(curr, tm_start.use, tm_end.use, reset,
+ &cnt, &tab, rectime, FALSE, ALL_ACTIVITIES);
- if (next) {
- curr ^= 1;
- if (cnt > 0) {
- cnt--;
- }
+ if (next) {
+ curr ^= 1;
+ if (cnt > 0) {
+ cnt--;
}
- reset = FALSE;
}
+ reset = FALSE;
}
- while (cnt && !eosaf && (rtype != R_RESTART));
-
- if (!cnt) {
- /* Go to next Linux restart, if possible */
- do {
- eosaf = read_next_sample(ifd, ign_flag, curr, file,
- &rtype, tab, file_magic, file_actlst,
- rectime, UEOF_CONT);
- }
- while (!eosaf && (rtype != R_RESTART));
+ }
+ while (cnt && !eosaf && (rtype != R_RESTART));
+
+ if (!cnt) {
+ /* Go to next Linux restart, if possible */
+ do {
+ eosaf = read_next_sample(ifd, ign_flag, curr, file,
+ &rtype, tab, file_magic, file_actlst,
+ rectime, UEOF_CONT);
}
- reset = TRUE;
+ while (!eosaf && (rtype != R_RESTART));
}
+ reset = TRUE;
}
while (!eosaf);