[PATCH 06/23] sim/erc32: Fix incorrect simulator performance report

Mike Frysinger vapier@gentoo.org
Tue Feb 17 09:07:00 GMT 2015


On 17 Feb 2015 08:44, Jiri Gaisler wrote:
> --- a/sim/erc32/func.c
> +++ b/sim/erc32/func.c
>  
> -    if (sregs->tottime == 0) tottime = 1; else tottime = sregs->tottime;
> +    if (sregs->tottime == 0.0) sregs->tottime +=1E-6;

should uncuddle the statement

needs a space after the "+=" operator

> +    printf(" Simulated ERC32 time        : %.2f s\n", (float) (ebase.simtime - sregs->simstart) / 1000000.0 / sregs->freq);
> +    printf(" Processor utilisation       : %.2f %%\n", 100.0 * (1.0 - ((float) sregs->pwdtime / (float) stime)));
> +    printf(" Real-time performance       : %.2f %%\n", 100.0/
> +      ((sregs->tottime) / ((double) (stime) / (sregs->freq * 1.0E6))));
> +    printf(" Simulator performance       : %.2f MIPS\n",(double)(sregs->ninst)/sregs->tottime/1E6);
> +    printf(" Used time (sys + user)      : %.2f s\n\n", sregs->tottime);

please line wrap these longer ones, and put spaces in the right places: after 
commas, around math operators, etc...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20150217/a9dfac97/attachment.sig>


More information about the Gdb-patches mailing list