SCCS-vsn: usr.bin/gprof/gprof.h 1.7
SCCS-vsn: usr.bin/gprof/gprof.c 1.8
SCCS-vsn: usr.bin/gprof/printgprof.c 1.5
- static char *sccsid = "@(#)gprof.c 1.7 (Berkeley) %G%";
+ static char *sccsid = "@(#)gprof.c 1.8 (Berkeley) %G%";
#endif lint
#include "gprof.h"
#endif lint
#include "gprof.h"
# endif DEBUG
} else if ( **argv == 'a' ) {
aflag++;
# endif DEBUG
} else if ( **argv == 'a' ) {
aflag++;
+ } else if ( **argv == 'b' ) {
+ bflag++;
} else if ( **argv == 'c' ) {
cflag++;
} else if ( **argv == 'z' ) {
} else if ( **argv == 'c' ) {
cflag++;
} else if ( **argv == 'z' ) {
- /* sccsid: @(#)gprof.h 1.6 (Berkeley) %G% */
+ /* sccsid: @(#)gprof.h 1.7 (Berkeley) %G% */
#include <stdio.h>
#include <sys/types.h>
#include <stdio.h>
#include <sys/types.h>
- static char *sccsid = "@(#)printgprof.c 1.4 (Berkeley) %G%";
+ static char *sccsid = "@(#)printgprof.c 1.5 (Berkeley) %G%";
#endif lint
#include "gprof.h"
#endif lint
#include "gprof.h"
nltype **sortednlp;
int index;
nltype **sortednlp;
int index;
+ printf( "\ngranularity: each sample hit covers %d byte(s)" , (long) scale );
+ printf( " for %.2f%% of %.2f seconds\n\n" , 100.0/totime , totime / HZ );
actime = 0.0;
flatprofheader();
/*
actime = 0.0;
flatprofheader();
/*
flatprofline( np );
}
actime = 0.0;
flatprofline( np );
}
actime = 0.0;
- printf( "\ngranularity: each sample hit covers %.1f bytes" , scale );
- printf( " for %.2f%% of %.2f seconds\n" , 100.0/totime , totime / HZ );
+ if ( bflag ) {
+ printblurb( "flat.blurb" );
+ }
printf( "%5.5s %7.7s %7.7s %7.7s %-8.8s\n" ,
"%time" , "cumsecs" , "seconds" , "calls" , "name" );
}
printf( "%5.5s %7.7s %7.7s %7.7s %-8.8s\n" ,
"%time" , "cumsecs" , "seconds" , "calls" , "name" );
}
- if ( zflg == 0 && np -> ncall == 0 && np -> time == 0 ) {
+ if ( zflag == 0 && np -> ncall == 0 && np -> time == 0 ) {
return;
}
actime += np -> time;
return;
}
actime += np -> time;
+
+ if ( bflag ) {
+ printblurb( "callg.blurb" );
+ }
printf( "%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n" ,
"" , "" , "" , "" , "called" , "total" , "parents" , "" );
printf( "%-6.6s %5.5s %7.7s %11.11s %7.7s+%-7.7s %-8.8s\t%5.5s\n" ,
printf( "%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n" ,
"" , "" , "" , "" , "called" , "total" , "parents" , "" );
printf( "%-6.6s %5.5s %7.7s %11.11s %7.7s+%-7.7s %-8.8s\t%5.5s\n" ,
gprofheader();
for ( index = 0 ; index < nname + cyclemax ; index ++ ) {
parentp = timesortnlp[ index ];
gprofheader();
for ( index = 0 ; index < nname + cyclemax ; index ++ ) {
parentp = timesortnlp[ index ];
parentp -> ncall == 0 &&
parentp -> selfcalls == 0 &&
parentp -> time == 0 &&
parentp -> ncall == 0 &&
parentp -> selfcalls == 0 &&
parentp -> time == 0 &&
+
+printblurb( blurbname )
+ char *blurbname;
+{
+ char pathname[ BUFSIZ ];
+ FILE *blurbfile;
+ int input;
+
+# ifndef BLURBLIB
+# define BLURBLIB "./"
+# endif not BLURBLIB
+ sprintf( pathname , "%s%s" , BLURBLIB , blurbname );
+ blurbfile = fopen( pathname , "r" );
+ if ( blurbfile == NULL ) {
+ perror( pathname );
+ return;
+ }
+ while ( ( input = getc( blurbfile ) ) != EOF ) {
+ putchar( input );
+ }
+ fclose( blurbfile );
+}