summaryrefslogtreecommitdiffstats
path: root/usr.bin/gprof/gprof.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2002-02-21 12:07:21 +0000
committerbde <bde@FreeBSD.org>2002-02-21 12:07:21 +0000
commit410e57d607b880921d54f9943b712bc5cca607cd (patch)
tree68ae29f63b9ab11211c7414b3e89eb46039d0f09 /usr.bin/gprof/gprof.c
parent2587888af49c047c8ce3a68fcafb15d8cdf5c126 (diff)
downloadFreeBSD-src-410e57d607b880921d54f9943b712bc5cca607cd.zip
FreeBSD-src-410e57d607b880921d54f9943b712bc5cca607cd.tar.gz
Fixed printf format errors. In printgprof.c, also convert the scale
without possibly losing lots of precision, and print the scale using %g instead of %d in case it is non-integral. %g might not be the best format for this.
Diffstat (limited to 'usr.bin/gprof/gprof.c')
-rw-r--r--usr.bin/gprof/gprof.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c
index 4ba5e1e..1d43fe6 100644
--- a/usr.bin/gprof/gprof.c
+++ b/usr.bin/gprof/gprof.c
@@ -255,7 +255,7 @@ getpfile(filename)
while ( fread( &arc , sizeof arc , 1 , pfile ) == 1 ) {
# ifdef DEBUG
if ( debug & SAMPLEDEBUG ) {
- printf( "[getpfile] frompc 0x%x selfpc 0x%x count %d\n" ,
+ printf( "[getpfile] frompc 0x%lx selfpc 0x%lx count %ld\n" ,
arc.raw_frompc , arc.raw_selfpc , arc.raw_count );
}
# endif DEBUG
@@ -300,7 +300,7 @@ openpfile(filename)
hz = rate;
} else if (hz != rate) {
fprintf(stderr,
- "%s: profile clock rate (%d) %s (%d) in first gmon file\n",
+ "%s: profile clock rate (%d) %s (%ld) in first gmon file\n",
filename, rate, "incompatible with clock rate", hz);
done();
}
@@ -312,15 +312,15 @@ openpfile(filename)
nsamples = sampbytes / sizeof (UNIT);
# ifdef DEBUG
if ( debug & SAMPLEDEBUG ) {
- printf( "[openpfile] hdr.lpc 0x%x hdr.hpc 0x%x hdr.ncnt %d\n",
+ printf( "[openpfile] hdr.lpc 0x%lx hdr.hpc 0x%lx hdr.ncnt %d\n",
gmonhdr.lpc , gmonhdr.hpc , gmonhdr.ncnt );
- printf( "[openpfile] s_lowpc 0x%x s_highpc 0x%x\n" ,
+ printf( "[openpfile] s_lowpc 0x%lx s_highpc 0x%lx\n" ,
s_lowpc , s_highpc );
- printf( "[openpfile] lowpc 0x%x highpc 0x%x\n" ,
+ printf( "[openpfile] lowpc 0x%lx highpc 0x%lx\n" ,
lowpc , highpc );
printf( "[openpfile] sampbytes %d nsamples %d\n" ,
sampbytes , nsamples );
- printf( "[openpfile] sample rate %d\n" , hz );
+ printf( "[openpfile] sample rate %ld\n" , hz );
}
# endif DEBUG
return(pfile);
@@ -344,7 +344,7 @@ tally( rawp )
childp -> ncall += rawp -> raw_count;
# ifdef DEBUG
if ( debug & TALLYDEBUG ) {
- printf( "[tally] arc from %s to %s traversed %d times\n" ,
+ printf( "[tally] arc from %s to %s traversed %ld times\n" ,
parentp -> name , childp -> name , rawp -> raw_count );
}
# endif DEBUG
@@ -394,7 +394,7 @@ dumpsum( sumfile )
}
# ifdef DEBUG
if ( debug & SAMPLEDEBUG ) {
- printf( "[dumpsum] frompc 0x%x selfpc 0x%x count %d\n" ,
+ printf( "[dumpsum] frompc 0x%lx selfpc 0x%lx count %ld\n" ,
arc.raw_frompc , arc.raw_selfpc , arc.raw_count );
}
# endif DEBUG
@@ -500,7 +500,7 @@ asgnsamples()
time = ccnt;
# ifdef DEBUG
if ( debug & SAMPLEDEBUG ) {
- printf( "[asgnsamples] pcl 0x%x pch 0x%x ccnt %d\n" ,
+ printf( "[asgnsamples] pcl 0x%lx pch 0x%lx ccnt %d\n" ,
pcl , pch , ccnt );
}
# endif DEBUG
@@ -524,7 +524,7 @@ asgnsamples()
if (overlap > 0) {
# ifdef DEBUG
if (debug & SAMPLEDEBUG) {
- printf("[asgnsamples] (0x%x->0x%x-0x%x) %s gets %f ticks %d overlap\n",
+ printf("[asgnsamples] (0x%lx->0x%lx-0x%lx) %s gets %f ticks %lu overlap\n",
nl[j].value/sizeof(UNIT), svalue0, svalue1,
nl[j].name,
overlap * time / scale, overlap);
@@ -579,7 +579,7 @@ alignentries()
if (bucket_of_entry < bucket_of_code) {
# ifdef DEBUG
if (debug & SAMPLEDEBUG) {
- printf("[alignentries] pushing svalue 0x%x to 0x%x\n",
+ printf("[alignentries] pushing svalue 0x%lx to 0x%lx\n",
nlp->svalue, nlp->svalue + UNITS_TO_CODE);
}
# endif DEBUG
OpenPOWER on IntegriCloud