From 18f4f1ed44dd9cbd6db64ddb4b62fee1f4f8448e Mon Sep 17 00:00:00 2001 From: wollman Date: Thu, 22 Dec 1994 20:52:15 +0000 Subject: 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. --- usr.bin/gprof/gprof.1 | 4 ++++ usr.bin/gprof/gprof.c | 20 +++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'usr.bin/gprof') 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 */ -- cgit v1.1