summaryrefslogtreecommitdiffstats
path: root/usr.bin/gprof/printgprof.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2002-03-06 09:47:36 +0000
committerbde <bde@FreeBSD.org>2002-03-06 09:47:36 +0000
commit8de8391e81f5d358ab05e1b726e30fb59a1706fb (patch)
tree3a23420ba9009cdae28cee5a62bd11968db28fde /usr.bin/gprof/printgprof.c
parent77922c96033bd5bc20628ac399b83499bf13ca95 (diff)
downloadFreeBSD-src-8de8391e81f5d358ab05e1b726e30fb59a1706fb.zip
FreeBSD-src-8de8391e81f5d358ab05e1b726e30fb59a1706fb.tar.gz
Fixed some misspellings of 2 as sizeof(UNIT) so that they won't break
things when sizeof(UNIT) becomes a runtime parameter. The relevant 2 is the one in profil(2)'s scaling of pc's to bucket numbers: bucket = (pc - offset) / 2 * profil_scale / 65536 gprof(1) must duplicate this scaling, bug for bug compatibly, so it must first do an integer division by 2 although this mainly makes scales larger than 65536 useless. sizeof(UNIT) was already wrong in gprof4, but there were no problems because the fake profil scale is a multiple of 2. There are also some rounding bugs in the scaling, but these are only problems if profil(2) is used directly to create unusual (and not useful) scales.
Diffstat (limited to 'usr.bin/gprof/printgprof.c')
-rw-r--r--usr.bin/gprof/printgprof.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/gprof/printgprof.c b/usr.bin/gprof/printgprof.c
index 945ff8d..80698cf 100644
--- a/usr.bin/gprof/printgprof.c
+++ b/usr.bin/gprof/printgprof.c
@@ -100,7 +100,7 @@ flatprofheader()
printblurb( _PATH_FLAT_BLURB );
}
printf( "\ngranularity: each sample hit covers %g byte(s)" ,
- scale * sizeof(UNIT) );
+ scale * HISTORICAL_SCALE_2 );
if ( totime > 0.0 ) {
printf( " for %.2f%% of %.2f seconds\n\n" ,
100.0/totime , totime / hz );
@@ -161,7 +161,7 @@ gprofheader()
printblurb( _PATH_CALLG_BLURB );
}
printf( "\ngranularity: each sample hit covers %g byte(s)" ,
- scale * sizeof(UNIT) );
+ scale * HISTORICAL_SCALE_2 );
if ( printtime > 0.0 ) {
printf( " for %.2f%% of %.2f seconds\n\n" ,
100.0/printtime , printtime / hz );
OpenPOWER on IntegriCloud