From: Roland McGrath Date: Wed, 11 Jul 2007 09:04:23 +0000 (+0000) Subject: 2007-07-11 Roland McGrath X-Git-Tag: v4.5.18~186 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14e3174d1c0d583aaa1b5938530541cf6a103874;p=strace 2007-07-11 Roland McGrath * count.c (call_summary_pers): Use tv_float conversion for output of cumulative time, in case it is negative from bogus -O value. From Lai JiangShan . --- diff --git a/count.c b/count.c index 5c285fb1..493fea15 100644 --- a/count.c +++ b/count.c @@ -205,9 +205,8 @@ call_summary_pers(FILE *outf) error_str[0] = '\0'; percent = (100.0 * tv_float(&counts[j].time) / tv_float(&tv_cum)); - fprintf(outf, "%6.2f %4ld.%06ld %11ld %9d %9.9s %s\n", - percent, (long) counts[j].time.tv_sec, - (long) counts[j].time.tv_usec, + fprintf(outf, "%6.2f %11.6f %11ld %9d %9.9s %s\n", + percent, tv_float(&counts[j].time), (long) 1000000 * dtv.tv_sec + dtv.tv_usec, counts[j].calls, error_str, sysent[j].sys_name); @@ -221,8 +220,8 @@ call_summary_pers(FILE *outf) sprintf(error_str, "%d", error_cum); else error_str[0] = '\0'; - fprintf(outf, "%6.6s %4ld.%06ld %11.11s %9d %9.9s %s\n", - "100.00", (long) tv_cum.tv_sec, (long) tv_cum.tv_usec, "", + fprintf(outf, "%6.6s %11.6f %11.11s %9d %9.9s %s\n", + "100.00", tv_float(&tv_cum), "", call_cum, error_str, "total"); }