diff options
author | Ken Raeburn <raeburn@cygnus> | 1994-11-04 00:08:34 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@cygnus> | 1994-11-04 00:08:34 +0000 |
commit | a051e7ccbe09715407d0dcfc097b6ebe61a81ca6 (patch) | |
tree | 897e96ab29ee3c01af2ceda64b9f63f6048b233b /gprof/printgprof.c | |
parent | 6f383ce55d25d080deb9d52461e08a23eb31424b (diff) | |
download | gdb-a051e7ccbe09715407d0dcfc097b6ebe61a81ca6.zip gdb-a051e7ccbe09715407d0dcfc097b6ebe61a81ca6.tar.gz gdb-a051e7ccbe09715407d0dcfc097b6ebe61a81ca6.tar.bz2 |
* printgprof.c (flatprofheader): Always set totime to 1.0 if not greater than
0.0. Suggested by Harold Assink <carlo@sg.tn.tudelft.nl>.
Diffstat (limited to 'gprof/printgprof.c')
-rw-r--r-- | gprof/printgprof.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gprof/printgprof.c b/gprof/printgprof.c index f4e5167..f664bca 100644 --- a/gprof/printgprof.c +++ b/gprof/printgprof.c @@ -91,21 +91,19 @@ flatprofheader() if (bsd_style_output) { printf( "\ngranularity: each sample hit covers %d byte(s)" , (long) scale * sizeof(UNIT) ); - if ( totime > 0.0 ) { - printf( " for %.2f%% of %.2f seconds\n\n" , - 100.0/totime , totime / hz ); - } else { - printf( " no time accumulated\n\n" ); - /* - * this doesn't hurt since all the numerators will be zero. - */ - totime = 1.0; - } + if (totime > 0.0) + printf(" for %.2f%% of %.2f seconds\n\n", 100.0/totime, totime / hz); } else { printf( "\nEach sample counts as %g seconds.\n", 1.0 / hz); } + if (totime <= 0.0) + { + printf(" no time accumulated\n\n"); + /* This doesn't hurt since all the numerators will be zero. */ + totime = 1.0; + } printf( "%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n" , "% " , "cumulative" , "self " , "" , "self " , "total " , "" ); printf( "%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n" , |