1994-11-05 09:56:06 +00:00
|
|
|
*** ../m/mprof_mon.c Tue Apr 20 13:36:09 1993
|
|
|
|
--- mprof_mon.c Fri Sep 17 17:09:01 1993
|
1998-02-15 00:45:09 +00:00
|
|
|
***************
|
|
|
|
*** 5,10 ****
|
|
|
|
--- 5,11 ----
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
+ #include <unistd.h>
|
|
|
|
#include <sys/file.h>
|
|
|
|
#include "mprof.h"
|
|
|
|
|
1994-11-05 09:56:06 +00:00
|
|
|
***************
|
|
|
|
*** 411,417 ****
|
|
|
|
#ifdef sun
|
|
|
|
on_exit(mprof_exit, NULL);
|
|
|
|
#endif
|
|
|
|
! #ifdef mips
|
|
|
|
atexit(mprof_exit);
|
|
|
|
#endif
|
|
|
|
|
1998-02-15 00:45:09 +00:00
|
|
|
--- 412,418 ----
|
1994-11-05 09:56:06 +00:00
|
|
|
#ifdef sun
|
|
|
|
on_exit(mprof_exit, NULL);
|
|
|
|
#endif
|
|
|
|
! #if defined(mips) || defined(__FreeBSD__)
|
|
|
|
atexit(mprof_exit);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
*** ../m/mprof.h Tue Apr 20 13:36:07 1993
|
|
|
|
--- mprof.h Fri Sep 17 16:53:52 1993
|
|
|
|
***************
|
|
|
|
*** 109,115 ****
|
|
|
|
|
|
|
|
extern char *strdup();
|
|
|
|
|
|
|
|
! #if (defined(vax) || (defined(sun) && !defined(sun4)))
|
|
|
|
#define get_current_fp(first_local) ((unsigned)&(first_local) + 4)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
--- 109,115 ----
|
|
|
|
|
|
|
|
extern char *strdup();
|
|
|
|
|
|
|
|
! #if (defined(vax) || (defined(sun) && !defined(sun4))) || defined(__FreeBSD__)
|
|
|
|
#define get_current_fp(first_local) ((unsigned)&(first_local) + 4)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
***************
|
|
|
|
*** 120,126 ****
|
|
|
|
#define ret_addr_from_fp(fp) (unsigned)(((struct frame *)(fp))->fr_savpc)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
!
|
|
|
|
/* for ultrix 0x38, 4.3 bsd 0x3d, other?
|
|
|
|
*/
|
|
|
|
|
|
|
|
--- 120,130 ----
|
|
|
|
#define ret_addr_from_fp(fp) (unsigned)(((struct frame *)(fp))->fr_savpc)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
! #if defined(__FreeBSD__)
|
|
|
|
! #define prev_fp_from_fp(fp) *((unsigned *) fp)
|
|
|
|
! #define ret_addr_from_fp(fp) *((unsigned *) (fp+4))
|
|
|
|
! #endif
|
|
|
|
!
|
|
|
|
/* for ultrix 0x38, 4.3 bsd 0x3d, other?
|
|
|
|
*/
|
|
|
|
|
|
|
|
***************
|
|
|
|
*** 134,137 ****
|
|
|
|
--- 138,145 ----
|
|
|
|
|
|
|
|
#ifdef mips
|
|
|
|
#define CRT0_ADDRESS 0x0 /* to be filled in later */
|
|
|
|
+ #endif
|
|
|
|
+
|
|
|
|
+ #ifdef __FreeBSD__
|
|
|
|
+ #define CRT0_ADDRESS 0x10d3
|
|
|
|
#endif
|
|
|
|
*** ../m/mpgraph.c Tue Apr 20 13:36:04 1993
|
|
|
|
--- mpgraph.c Wed Sep 15 23:27:07 1993
|
|
|
|
***************
|
|
|
|
*** 114,120 ****
|
|
|
|
vertex from, to;
|
|
|
|
mpdata data;
|
|
|
|
int mark;
|
|
|
|
! struct edge_struct *save
|
|
|
|
} *edge, edge_item;
|
|
|
|
|
|
|
|
edge
|
|
|
|
--- 114,120 ----
|
|
|
|
vertex from, to;
|
|
|
|
mpdata data;
|
|
|
|
int mark;
|
|
|
|
! struct edge_struct *save;
|
|
|
|
} *edge, edge_item;
|
|
|
|
|
|
|
|
edge
|
1994-11-22 09:18:27 +00:00
|
|
|
*** /dev/null Tue Nov 22 00:34:22 1994
|
|
|
|
--- Makefile.i386 Tue Nov 22 01:03:41 1994
|
1994-11-05 09:56:06 +00:00
|
|
|
***************
|
|
|
|
*** 0 ****
|
1994-11-22 09:18:27 +00:00
|
|
|
--- 1,148 ----
|
1994-11-05 09:56:06 +00:00
|
|
|
+ # %M% %I% %G% %U%
|
|
|
|
+ # Copyright (c) 1987, Benjamin G. Zorn
|
|
|
|
+ #
|
|
|
|
+ # Makefile for MPROF data generation
|
|
|
|
+ #
|
|
|
|
+
|
|
|
|
+ CC = cc
|
|
|
|
+
|
|
|
|
+ # mips CFLAGS = -I. -g -DDEBUG
|
|
|
|
+ # sun4 CFLAGS = -I. -g -Dsun4
|
|
|
|
+ # sun3,vax, i386 CFLAGS = -I. -g
|
|
|
|
+
|
|
|
|
+ # sun4 ASFLAGS = -P -Dsun4
|
|
|
|
+ # sun3,vax,mips, i386 ASFLAGS =
|
|
|
|
+
|
1994-11-22 09:18:27 +00:00
|
|
|
+ CFLAGS = -I. -g -static
|
1994-11-05 09:56:06 +00:00
|
|
|
+ ASFLAGS =
|
|
|
|
+ BIN = .
|
|
|
|
+ MPLIB = $(BIN)/libc_mp.a
|
|
|
|
+ LINTFLAGS = -bhx
|
|
|
|
+
|
|
|
|
+ # sun4,mips ASM_SRC = md.s
|
|
|
|
+ # sun4,mips ASM_OBJ = md.o
|
|
|
|
+ # vax,sun3 ASM_SRC =
|
|
|
|
+ # vax,sun3 ASM_OBJ =
|
|
|
|
+
|
|
|
|
+ ASM_SRC =
|
|
|
|
+ ASM_OBJ =
|
|
|
|
+
|
|
|
|
+ MPROF_MON_SRCS = leak.c malloc.c mpattach.c mprof_mon.c mpstruct.c $(ASM_SRC)
|
|
|
|
+ MPROF_MON_OBJS = leak.o malloc.o mpattach.o mprof_mon.o mpstruct.o $(ASM_OBJ)
|
|
|
|
+
|
|
|
|
+ MPROF_SRCS = mprof.c mpstruct.c mpgraph.c
|
|
|
|
+ MPROF_OBJS = mprof.o mpstruct.o mpgraph.o
|
|
|
|
+
|
|
|
|
+ DOC_SRC = mprof.1
|
|
|
|
+ DOC_OBJS = mprof.man
|
|
|
|
+
|
|
|
|
+ DISTNAME = mprof-3.0
|
|
|
|
+
|
|
|
|
+ TEST_SRCS = test1.c test2.c
|
|
|
|
+ TEST_OBJS = test1.o test2.o
|
|
|
|
+
|
|
|
|
+ all: mprof $(MPROF_MON_OBJS) $(DOC_OBJS) $(MPLIB)
|
|
|
|
+
|
|
|
|
+ mips $(MPLIB): $(MPROF_MON_OBJS)
|
|
|
|
+ ar cr libc_mp.a $(MPROF_MON_OBJS)
|
|
|
|
+ ranlib libc_mp.a
|
|
|
|
+
|
|
|
|
+ # sun3, sun4 LIB_REPLACE = memalign.o
|
|
|
|
+ # vax LIB_REPLACE = exit.o
|
|
|
|
+ # mips LIB_REPLACE =
|
|
|
|
+
|
|
|
|
+ LIB_REPLACE = exit.o
|
|
|
|
+
|
|
|
|
+ #$(MPLIB): $(MPROF_MON_OBJS)
|
|
|
|
+ # cp /lib/libc.a libc_mp.a
|
|
|
|
+ # ar d libc_mp.a malloc.o valloc.o $(LIB_REPLACE)
|
|
|
|
+ # ar r libc_mp.a $(MPROF_MON_OBJS)
|
|
|
|
+ # ranlib libc_mp.a
|
|
|
|
+
|
|
|
|
+ test: $(TEST_OBJS) test1-demo test2-demo
|
1995-01-29 21:35:35 +00:00
|
|
|
+
|
1994-11-05 09:56:06 +00:00
|
|
|
+ mprof-mon-lint:
|
|
|
|
+ lint $(LINTFLAGS) $(MPROF_MON_SRCS) > mprof.lint
|
|
|
|
+
|
|
|
|
+ mprof-lint:
|
|
|
|
+ lint $(LINTFLAGS) $(MPROF_SRCS) > mprof.lint
|
|
|
|
+
|
|
|
|
+ clean:
|
|
|
|
+ rm -f *.o mprof.lint mprof-mon.lint \
|
|
|
|
+ $(DOC_OBJS) \
|
|
|
|
+ $(TEST_OBJS) \
|
|
|
|
+ test1 test1.data test1.mprof \
|
|
|
|
+ test2 test2.data test2.mprof \
|
|
|
|
+ libc_mp.a mprof mprof.data
|
|
|
|
+
|
|
|
|
+ leak.o: leak.c
|
|
|
|
+ mprof_mon.o: mprof_mon.c
|
|
|
|
+ mpstruct.o: mpstruct.c
|
|
|
|
+ mpgraph.o: mpgraph.c
|
|
|
|
+ mprof.o: mprof.c
|
|
|
|
+ md.o: md.s
|
|
|
|
+ $(AS) $(ASFLAGS) -o md.o md.s
|
|
|
|
+
|
|
|
|
+ malloc.o: malloc.c
|
|
|
|
+ $(CC) $(CFLAGS) -Dmalloc=__malloc__ -Dfree=__free__ -Drealloc=__realloc__ malloc.c -c
|
|
|
|
+
|
|
|
|
+ mprof: $(MPROF_OBJS)
|
|
|
|
+ $(CC) $(CFLAGS) -o mprof $(MPROF_OBJS)
|
|
|
|
+
|
|
|
|
+ mprof.man: mprof.1
|
|
|
|
+ nroff -man mprof.1 > mprof.man
|
|
|
|
+
|
|
|
|
+ dist: MANIFEST
|
|
|
|
+ tar cvf $(DISTNAME).tar `cat MANIFEST`
|
|
|
|
+ compress $(DISTNAME).tar
|
|
|
|
+
|
|
|
|
+ #
|
|
|
|
+ # Examples to test if MPROF is installed correctly
|
|
|
|
+ #
|
|
|
|
+
|
|
|
|
+ # A very simple test (tests calloc and valloc)
|
|
|
|
+
|
|
|
|
+ test1-demo: test1.data
|
|
|
|
+ $(BIN)/mprof -normal test1 test1.data > test1.mprof
|
|
|
|
+
|
|
|
|
+ test1.mprof: test1.data
|
|
|
|
+ $(BIN)/mprof -normal test1 test1.data > test1.mprof
|
|
|
|
+
|
|
|
|
+ test1.data: test1
|
|
|
|
+ test1
|
|
|
|
+ cp mprof.data test1.data
|
|
|
|
+
|
|
|
|
+ test1: test1.o $(MPLIB)
|
|
|
|
+ $(CC) $(CFLAGS) -o test1 test1.o $(MPLIB)
|
|
|
|
+
|
|
|
|
+ test1.o: test1.c
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # test2 program (example from paper)
|
|
|
|
+
|
|
|
|
+ test2-demo: test2.data
|
|
|
|
+ $(BIN)/mprof -normal test2 test2.data > test2.mprof
|
|
|
|
+
|
|
|
|
+ test2.mprof: test2.data
|
|
|
|
+ $(BIN)/mprof -normal test2 test2.data > test2.mprof
|
|
|
|
+
|
|
|
|
+ test2.data: test2
|
|
|
|
+ test2
|
|
|
|
+ cp mprof.data test2.data
|
|
|
|
+
|
|
|
|
+ test2: test2.o $(MPLIB)
|
|
|
|
+ $(CC) $(CFLAGS) -o test2 test2.o $(MPLIB)
|
|
|
|
+
|
|
|
|
+ test2.o: test2.c
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ ###
|
1994-11-22 09:18:27 +00:00
|
|
|
+ leak.o: /usr/include/stdio.h mprof.h /usr/include/sys/types.h
|
1994-11-05 09:56:06 +00:00
|
|
|
+ malloc.o: /usr/include/sys/types.h /usr/include/stdio.h
|
|
|
|
+ mprof.o: /usr/include/stdio.h /usr/include/sys/file.h /usr/include/ctype.h \
|
|
|
|
+ /usr/include/a.out.h /usr/include/sys/exec.h /usr/include/stab.h \
|
1994-11-22 09:18:27 +00:00
|
|
|
+ mprof.h /usr/include/sys/types.h
|
1994-11-05 09:56:06 +00:00
|
|
|
+ mprof_mon.o: /usr/include/stdio.h /usr/include/sys/file.h mprof.h \
|
1994-11-22 09:18:27 +00:00
|
|
|
+ /usr/include/sys/types.h
|
|
|
|
+ mpstruct.o: /usr/include/stdio.h mprof.h /usr/include/sys/types.h
|
|
|
|
+ mpgraph.o: /usr/include/stdio.h mprof.h /usr/include/sys/types.h
|