]> granicus.if.org Git - strace/commitdiff
2007-07-11 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Wed, 11 Jul 2007 09:04:23 +0000 (09:04 +0000)
committerRoland McGrath <roland@redhat.com>
Wed, 11 Jul 2007 09:04:23 +0000 (09:04 +0000)
* 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 <laijs@cn.fujitsu.com>.

count.c

diff --git a/count.c b/count.c
index 5c285fb14431b25aad65895987198fcc1d6cb5ec..493fea150c747ec66a20b3515b4f33413dc3da66 100644 (file)
--- 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");
 }