summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-06-08 12:29:57 +0000
committerbde <bde@FreeBSD.org>1996-06-08 12:29:57 +0000
commitf8b51172cd21c6d75310caf992b51de95352f7d4 (patch)
treeb850f8d2dd3ddc7de0b2c2ee1832978b2ed86294 /usr.bin
parent10d2a112490d404e8620a72c44a18f039a88c723 (diff)
downloadFreeBSD-src-f8b51172cd21c6d75310caf992b51de95352f7d4.zip
FreeBSD-src-f8b51172cd21c6d75310caf992b51de95352f7d4.tar.gz
Print times/call in ns if hz >= 10e7. hz will be this large for high
resolution profiling on Pentiums. On a 100MHz Pentium, the resolution is at best 10 ns and actually a few hundred ns, but units of 10's or 100's of ns would be inconvenient and the current units of 1 us are a bit too coarse.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/gprof/printgprof.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/gprof/printgprof.c b/usr.bin/gprof/printgprof.c
index 716fd8b..0b039df 100644
--- a/usr.bin/gprof/printgprof.c
+++ b/usr.bin/gprof/printgprof.c
@@ -110,8 +110,9 @@ flatprofheader()
"% " , "cumulative" , "self " , "" , "self " , "total " , "" );
printf( "%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n" ,
"time" , "seconds " , "seconds" , "calls" ,
- hz >= 10000 ? "us/call" : "ms/call" ,
- hz >= 10000 ? "us/call" : "ms/call" , "name" );
+ hz >= 10000000 ? "ns/call" : hz >= 10000 ? "us/call" : "ms/call" ,
+ hz >= 10000000 ? "ns/call" : hz >= 10000 ? "us/call" : "ms/call" ,
+ "name" );
}
flatprofline( np )
@@ -129,7 +130,11 @@ flatprofline( np )
printf( "%5.1f %10.2f %8.2f" ,
100 * np -> time / totime , actime / hz , np -> time / hz );
if ( np -> ncall != 0 ) {
- if (hz >= 10000)
+ if (hz >= 10000000)
+ printf( " %8d %8.0f %8.0f " , np -> ncall ,
+ 1e9 * np -> time / hz / np -> ncall ,
+ 1e9 * ( np -> time + np -> childtime ) / hz / np -> ncall );
+ else if (hz >= 10000)
printf( " %8d %8.0f %8.0f " , np -> ncall ,
1e6 * np -> time / hz / np -> ncall ,
1e6 * ( np -> time + np -> childtime ) / hz / np -> ncall );
OpenPOWER on IntegriCloud