diff options
author | wollman <wollman@FreeBSD.org> | 1994-12-22 20:52:15 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-12-22 20:52:15 +0000 |
commit | 18f4f1ed44dd9cbd6db64ddb4b62fee1f4f8448e (patch) | |
tree | 52b488628d95f562dbd35627b78bc8211b94ec10 /usr.bin | |
parent | b9b9ce83b825198b3168ce98ad49474ae7cb3dbf (diff) | |
download | FreeBSD-src-18f4f1ed44dd9cbd6db64ddb4b62fee1f4f8448e.zip FreeBSD-src-18f4f1ed44dd9cbd6db64ddb4b62fee1f4f8448e.tar.gz |
Added much-needed new options -[lL], to suppress printing of either the
call-graph or the flat profile, since often you only want one of them.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/gprof/gprof.1 | 4 | ||||
-rw-r--r-- | usr.bin/gprof/gprof.c | 20 |
2 files changed, 21 insertions, 3 deletions
diff --git a/usr.bin/gprof/gprof.1 b/usr.bin/gprof/gprof.1 index 63ea872..c212656 100644 --- a/usr.bin/gprof/gprof.1 +++ b/usr.bin/gprof/gprof.1 @@ -194,6 +194,10 @@ option may be given. Only one pair of routine names may be given with each .Fl k option. +.It Fl l +Suppresses the printing of the call-graph profile. +.It Fl L +Suppresses the printing of the flat profile. .It Fl s A profile file .Pa gmon.sum diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c index c1d45b7..6873422 100644 --- a/usr.bin/gprof/gprof.c +++ b/usr.bin/gprof/gprof.c @@ -52,6 +52,8 @@ char *defaultEs[] = { "mcount" , "__mcleanup" , 0 }; static struct gmonhdr gmonhdr; static bool uflag; +static int lflag; +static int Lflag; main(argc, argv) int argc; @@ -123,7 +125,15 @@ main(argc, argv) addlist( ktolist , *++argv ); kflag = TRUE; break; - case 's': + case 'l': + lflag = 1; + Lflag = 0; + break; + case 'L': + Lflag = 1; + lflag = 0; + break; + case 's': sflag = TRUE; break; case 'u': @@ -194,11 +204,15 @@ main(argc, argv) /* * print the dynamic profile */ - printgprof( timesortnlp ); + if(!lflag) { + printgprof( timesortnlp ); + } /* * print the flat profile */ - printprof(); + if(!Lflag) { + printprof(); + } /* * print the index */ |