summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/gprof/printgprof.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/gprof/printgprof.c b/usr.bin/gprof/printgprof.c
index 4ca5395..41c1c1f 100644
--- a/usr.bin/gprof/printgprof.c
+++ b/usr.bin/gprof/printgprof.c
@@ -130,7 +130,8 @@ flatprofline( np )
register nltype *np;
{
- if ( zflag == 0 && np -> ncall == 0 && np -> time == 0 ) {
+ if ( zflag == 0 && np -> ncall == 0 && np -> time == 0 &&
+ np -> childtime == 0 ) {
return;
}
actime += np -> time;
@@ -153,6 +154,9 @@ flatprofline( np )
printf( " %8ld %8.2f %8.2f " , np -> ncall ,
1000 * np -> time / hz / np -> ncall ,
1000 * ( np -> time + np -> childtime ) / hz / np -> ncall );
+ } else if ( np -> time != 0 || np -> childtime != 0 ) {
+ printf( " %8ld %7.2f%% %8.8s " , np -> ncall ,
+ 100 * np -> time / ( np -> time + np -> childtime ) , "" );
} else {
printf( " %8.8s %8.8s %8.8s " , "" , "" , "" );
}
OpenPOWER on IntegriCloud