[ptest-runner,2/2] utils.c: Print DURATION after ERROR

Submitted by Aníbal Limón on Jan. 30, 2019, 5:07 p.m. | Patch ID: 158393

Details

Message ID 20190130170737.5347-2-anibal.limon@linaro.org
State New
Headers show

Commit Message

Aníbal Limón Jan. 30, 2019, 5:07 p.m.
If a process gets killed by timeout or OOM the output could end
without '\n' so add 'DURATION: N\n' after '\nERROR: ptest-dir\n'.

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
---
 utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/utils.c b/utils.c
index 0813e3c..504df0b 100644
--- a/utils.c
+++ b/utils.c
@@ -382,12 +382,12 @@  run_ptests(struct ptest_list *head, const struct ptest_options opts,
 						opts.timeout, fds, fps, &timeouted);
 				entime = time(NULL);
 				duration = entime - sttime;
-				fprintf(fps[0], "DURATION: %d\n", duration);
 
 				if (status) {
 					fprintf(fps[0], "\nERROR: Exit status is %d\n", status);
 					rc += 1;
 				}
+				fprintf(fps[0], "DURATION: %d\n", duration);
 				if (timeouted)
 					fprintf(fps[0], "TIMEOUT: %s\n", ptest_dir);