summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Zucconi <jmz@FreeBSD.org>1999-05-23 00:37:56 +0000
committerJean-Marc Zucconi <jmz@FreeBSD.org>1999-05-23 00:37:56 +0000
commit7e74cac42ed3750633f384a5fb4529a6c986dab8 (patch)
tree363b3bad3e5fec97261262680d944ae947c3fea0
parentfce8f73e4d8c1ae15d658a47f1d7094fe7191c56 (diff)
Notes
-rw-r--r--usr.bin/gprof/gprof.120
-rw-r--r--usr.bin/gprof/gprof.c6
-rw-r--r--usr.bin/gprof/gprof.h1
3 files changed, 13 insertions, 14 deletions
diff --git a/usr.bin/gprof/gprof.1 b/usr.bin/gprof/gprof.1
index dc6f369e0813..02eea626ef43 100644
--- a/usr.bin/gprof/gprof.1
+++ b/usr.bin/gprof/gprof.1
@@ -40,15 +40,13 @@
.Sh SYNOPSIS
.Nm gprof
.Op options
-.Op Ar a.out Op Ar gmon.out ...
+.Op Ar a.out Op Ar a.out.gmon ...
.Sh DESCRIPTION
.Nm Gprof
produces an execution profile of C, Pascal, or Fortran77 programs.
The effect of called routines is incorporated in the profile of each caller.
The profile data is taken from the call graph profile file
-.Pf ( Pa gmon.out
-default) which is created by programs
-that are compiled with the
+which is created by programs that are compiled with the
.Fl pg
option of
.Xr cc 1 ,
@@ -63,8 +61,10 @@ that are compiled for profiling.
reads the given object file (the default is
.Pa a.out)
and establishes the relation between it's symbol table
-and the call graph profile from
-.Pa gmon.out .
+and the call graph profile. The default graph profile file name is the name
+of the executable with the suffix
+.Pa .gmon
+appended.
If more than one profile file is specified,
the
.Nm gprof
@@ -231,10 +231,10 @@ This is useful with the
option for discovering which routines were never called.
.El
.Sh FILES
-.Bl -tag -width gmon.sum -compact
+.Bl -tag -width a.out.gmon -compact
.It Pa a.out
The namelist and text space.
-.It Pa gmon.out
+.It Pa a.out.gmon
Dynamic call graph and profile.
.It Pa gmon.sum
Summarized dynamic call graph and profile.
@@ -295,6 +295,4 @@ the execution of the profiling routine, in which case all is lost.
The profiled program must call
.Xr exit 3
or return normally for the profiling information to be saved
-in the
-.Pa gmon.out
-file.
+in the graph profile file.
diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c
index 0d4d63f7af26..a5c614038892 100644
--- a/usr.bin/gprof/gprof.c
+++ b/usr.bin/gprof/gprof.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)gprof.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: gprof.c,v 1.7 1998/08/08 17:48:26 jdp Exp $";
+ "$Id: gprof.c,v 1.8 1998/09/07 23:31:59 jdp Exp $";
#endif /* not lint */
#include <err.h>
@@ -155,7 +155,9 @@ main(argc, argv)
gmonname = *argv;
argv++;
} else {
- gmonname = GMONNAME;
+ gmonname = (char *) malloc(strlen(a_outname)+6);
+ strcpy(gmonname, a_outname);
+ strcat(gmonname, ".gmon");
}
/*
* get information from the executable file.
diff --git a/usr.bin/gprof/gprof.h b/usr.bin/gprof/gprof.h
index ce164d55a57d..e42647300a9d 100644
--- a/usr.bin/gprof/gprof.h
+++ b/usr.bin/gprof/gprof.h
@@ -84,7 +84,6 @@ char *a_outname;
#define A_OUTNAME "a.out"
char *gmonname;
-#define GMONNAME "gmon.out"
#define GMONSUM "gmon.sum"
/*