aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/gprof/gprof.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1994-09-05 16:14:54 +0000
committerBruce Evans <bde@FreeBSD.org>1994-09-05 16:14:54 +0000
commitff18d3781dbb6349a8a51bf6ca35424df3363e9f (patch)
treecda563e13e0df6f2d4199f44712b1a165f696055 /usr.bin/gprof/gprof.c
parent350ce310553ad711ad86cd2e5fb4f04833f5897d (diff)
downloadsrc-ff18d3781dbb6349a8a51bf6ca35424df3363e9f.tar.gz
src-ff18d3781dbb6349a8a51bf6ca35424df3363e9f.zip
Notes
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 5057e3265d37..c1d45b79066e 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;