summaryrefslogtreecommitdiffstats
path: root/usr.bin/gprof/gprof.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1994-09-05 16:14:54 +0000
committerbde <bde@FreeBSD.org>1994-09-05 16:14:54 +0000
commit63eff9d9b845dca66ab4dc6bde9960b5edfc249a (patch)
treecda563e13e0df6f2d4199f44712b1a165f696055 /usr.bin/gprof/gprof.c
parent889bf31f37aef15112814b058e35c5d89e8ad6db (diff)
downloadFreeBSD-src-63eff9d9b845dca66ab4dc6bde9960b5edfc249a.zip
FreeBSD-src-63eff9d9b845dca66ab4dc6bde9960b5edfc249a.tar.gz
New flag -u to suppress functions whose name does not begin with an
underscore. Use it to avoid seeing badsw when profiling the kernel. Print times more accurately (e.g. usec in %8.0f format instead of msec in %8.2f format for averages) if hz >= 10000. This should have no effect now since profhz is only 1024.
Diffstat (limited to 'usr.bin/gprof/gprof.c')
-rw-r--r--usr.bin/gprof/gprof.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c
index 5057e32..c1d45b7 100644
--- a/usr.bin/gprof/gprof.c
+++ b/usr.bin/gprof/gprof.c
@@ -51,6 +51,7 @@ char *whoami = "gprof";
char *defaultEs[] = { "mcount" , "__mcleanup" , 0 };
static struct gmonhdr gmonhdr;
+static bool uflag;
main(argc, argv)
int argc;
@@ -125,6 +126,9 @@ main(argc, argv)
case 's':
sflag = TRUE;
break;
+ case 'u':
+ uflag = TRUE;
+ break;
case 'z':
zflag = TRUE;
break;
@@ -704,8 +708,6 @@ bool
funcsymbol( nlistp )
struct nlist *nlistp;
{
- extern char *strtab; /* string table from a.out */
- extern int aflag; /* if static functions aren't desired */
char *name, c;
/*
@@ -717,6 +719,7 @@ funcsymbol( nlistp )
return FALSE;
}
/*
+ * name must start with an underscore if uflag is set.
* can't have any `funny' characters in name,
* where `funny' includes `.', .o file names
* and `$', pascal labels.
@@ -724,6 +727,8 @@ funcsymbol( nlistp )
* perhaps we should just drop this code entirely...
*/
name = strtab + nlistp -> n_un.n_strx;
+ if ( uflag && *name != '_' )
+ return FALSE;
#ifdef sparc
if ( *name == '.' ) {
char *p = name + 1;
OpenPOWER on IntegriCloud