mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
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.
This commit is contained in:
parent
39a3579443
commit
d4aa237228
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16227
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user