summaryrefslogtreecommitdiffstats
path: root/usr.bin/gprof/gprof.c
diff options
context:
space:
mode:
authorjmz <jmz@FreeBSD.org>1999-05-23 00:37:56 +0000
committerjmz <jmz@FreeBSD.org>1999-05-23 00:37:56 +0000
commit664ece1203712c55ddab8529abd6803ab19e9803 (patch)
tree3ea28e5d6788b0822975dc8e1750d52827e90754 /usr.bin/gprof/gprof.c
parente7d8972c4b2d32d37412c38bf5ae67f4ea5a2a52 (diff)
downloadFreeBSD-src-664ece1203712c55ddab8529abd6803ab19e9803.zip
FreeBSD-src-664ece1203712c55ddab8529abd6803ab19e9803.tar.gz
Construct the profile file name from the name of the executable. A program
compiled with -pg and run will generate a file <executable-filename>.gmon, not gmon.out. PR: bin/8426
Diffstat (limited to 'usr.bin/gprof/gprof.c')
-rw-r--r--usr.bin/gprof/gprof.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c
index 0d4d63f..a5c6140 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.
OpenPOWER on IntegriCloud