pan/ltp-pan.c: Add execution time field in results/logs
PATCH 1/1 pan/ltp-pan.c: Add execution time field in results/logs
The current log only shows the success or failure of testcases, but execution time is also one of the important indicators to observe LTP testcases.
In this patch, we modified the format of the logs in results/ and added a column to record the execution time.
--- pan/ltp-pan.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-)
pan/ltp-pan.c +15 -9
@@ -132,7 +132,11 @@ zoo_t zoofile;static char *reporttype =NULL ;/* Common format string for ltp-pan results */ -#define ResultFmt "%-50s %-10.10s" +#define ResultFmt "%-50s %-10.10s" +#define ExitValTitleFmt "%-12.12s" +#define ExitValFmt "%-12d" +#define ExecTimeTitleFmt "%-20.20s" +#define ExecTimeFmt "%-20d"/* zoolib */ int rec_signal;/* received signal */
@@ -354,10 +358,10 @@ int main(int argc, char **argv)fprintf (logfile,"Test Start Time: %s\n" , s);fprintf (logfile,"-----------------------------------------\n" ); -fprintf (logfile, ResultFmt" %-10.10s\n" , -"Testcase" ,"Result" ,"Exit Value" ); -fprintf (logfile, ResultFmt" %-10.10s\n" , -"--------" ,"------" ,"------------" ); +fprintf (logfile, ResultFmt" " ExitValTitleFmt" " ExecTimeTitleFmt"\n" , +"Testcase" ,"Result" ,"Exit Value" ,"Execution Time(sec)" ); +fprintf (logfile, ResultFmt" " ExitValTitleFmt" " ExecTimeTitleFmt"\n" , +"--------" ,"------" ,"----------" ,"-------------------" ); }fflush (logfile); }
@@ -829,10 +833,11 @@ check_pids(struct tag_pgrp *running, int *num_active, int keep_active, }fprintf (logfile, - ResultFmt" %-5d\n" , + ResultFmt" " ExitValFmt" " ExecTimeFmt"\n" , running[i].cmd->name, result_str, - w); + w, + (int )(t - running[i].mystime)); }fflush (logfile);
@@ -1108,10 +1113,11 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode,if (termid !=0 ) ++ * failcnt; -fprintf (logfile, ResultFmt" %-5d\n" , +fprintf (logfile, ResultFmt" " ExitValFmt" " ExecTimeFmt"\n" , colle->name, ((termid !=0 ) ?"FAIL" :"PASS" ), - termid); + termid, + (int )(end_time - active->mystime)); }fflush (logfile); }
Signature · 5 lines
2.34.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 6 lines
The current log only shows the success or failure of testcases, but execution time is also one of the important indicators to observe LTP testcases.
In this patch, we modified the format of the logs in results/ and added a column to record the execution time.
I think that there are at least two reasons not to apply this patch:
1. The ltp-pan is in maintenance mode only and is going to be replaced by a different solution that is way more powerful [1]
2. There are likely automated tools parsing the ltp-pan logfiles that may get broken by this
[1] https://lists.linux.it/pipermail/ltp/2022-August/029933.html
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp