summaryrefslogtreecommitdiff
path: root/devel/mprof
diff options
context:
space:
mode:
Diffstat (limited to 'devel/mprof')
-rw-r--r--devel/mprof/Makefile32
-rw-r--r--devel/mprof/distinfo3
-rw-r--r--devel/mprof/files/patch-02129
-rw-r--r--devel/mprof/files/patch-Makefile.i386152
-rw-r--r--devel/mprof/files/patch-malloc.c11
-rw-r--r--devel/mprof/files/patch-mpgraph.c54
-rw-r--r--devel/mprof/files/patch-mprof.c69
-rw-r--r--devel/mprof/files/patch-mprof.h51
-rw-r--r--devel/mprof/files/patch-mprof_mon.c29
-rw-r--r--devel/mprof/pkg-descr18
10 files changed, 0 insertions, 548 deletions
diff --git a/devel/mprof/Makefile b/devel/mprof/Makefile
deleted file mode 100644
index 07d4e7cabf9b..000000000000
--- a/devel/mprof/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# ex:ts=8
-# Ports collection makefile for: mprof
-# Date created: Sat Nov 5 01:16:33 PST 1994
-# Whom: hsu
-#
-# $FreeBSD$
-#
-
-PORTNAME= mprof
-PORTVERSION= 3.0
-PORTREVISION= 1
-CATEGORIES= devel
-MASTER_SITES= ftp://ftp.cs.colorado.edu/pub/misc/
-EXTRACT_SUFX= .tar.Z
-
-MAINTAINER= ports@FreeBSD.org
-COMMENT= Memory Profiler and Leak Detector
-
-DEPRECATED= Upstream disapear and distfile is no more available
-EXPIRATION_DATE= 2011-05-01
-
-NO_WRKSUBDIR= yes
-MAKEFILE= Makefile.i386
-MAN1= mprof.1
-PLIST_FILES= bin/mprof lib/libc_mp.a
-
-do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/mprof ${PREFIX}/bin
- ${INSTALL} ${COPY} -m 555 ${WRKSRC}/libc_mp.a ${PREFIX}/lib
- ${INSTALL_MAN} ${WRKSRC}/mprof.1 ${PREFIX}/man/man1
-
-.include <bsd.port.mk>
diff --git a/devel/mprof/distinfo b/devel/mprof/distinfo
deleted file mode 100644
index d03add3266b0..000000000000
--- a/devel/mprof/distinfo
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 (mprof-3.0.tar.Z) = 0fe6c29a0313d09ed4dc326ab2583194
-SHA256 (mprof-3.0.tar.Z) = 43fc957384e8452a87666565239d350ff42a0946b55d9b8a261d37a1253fbc1e
-SIZE (mprof-3.0.tar.Z) = 186869
diff --git a/devel/mprof/files/patch-02 b/devel/mprof/files/patch-02
deleted file mode 100644
index 03ce45500122..000000000000
--- a/devel/mprof/files/patch-02
+++ /dev/null
@@ -1,129 +0,0 @@
---- mprof.c.orig Tue Apr 20 21:36:20 1993
-+++ mprof.c Wed Nov 25 14:20:44 1998
-@@ -8,6 +8,9 @@
- #include <stdio.h>
- #include <sys/file.h>
- #include <ctype.h>
-+#ifdef __ELF__
-+#include <elf.h>
-+#endif
- #include <a.out.h>
- #include <stab.h>
- #include "mprof.h"
-@@ -699,6 +702,108 @@
- st_read(exec_name)
- char *exec_name;
- {
-+#ifdef __ELF__
-+ int elf_file = open(exec_name, (O_RDONLY));
-+ Elf_Ehdr ehdr;
-+ Elf_Shdr shdr, shstrhdr, symhdr, strhdr, stabhdr, stabstrhdr;
-+ int gotsym, gotstr, gotstab, gotstabstr;
-+ char *sh_strings;
-+ char *stab_strings;
-+ Elf_Sym asym;
-+ extern char *index();
-+ extern char *malloc();
-+ char *stmp;
-+ int string_size;
-+ unsigned char type;
-+ char *fname;
-+ int i;
-+
-+ read(elf_file, &ehdr, sizeof(ehdr));
-+ if (!ehdr.e_shnum) {
-+ fprintf(stdout, "st_read -- no symbols in executable\n");
-+ exit(1);
-+ }
-+
-+ /* read the section names */
-+ lseek(elf_file, ehdr.e_shoff + ehdr.e_shstrndx * ehdr.e_shentsize, L_SET);
-+ read(elf_file, &shstrhdr, ehdr.e_shentsize);
-+ sh_strings = malloc(shstrhdr.sh_size);
-+ lseek(elf_file, shstrhdr.sh_offset, L_SET);
-+ read(elf_file, sh_strings, shstrhdr.sh_size);
-+
-+ /* find the stab sections */
-+ gotsym = gotstr = 0;
-+ for (i = 0; i < ehdr.e_shnum; i++) {
-+ lseek(elf_file, ehdr.e_shoff + i * ehdr.e_shentsize, L_SET);
-+ read(elf_file, &shdr, ehdr.e_shentsize);
-+ if (!strcmp(sh_strings + shdr.sh_name, ".stab")) {
-+ stabhdr = shdr;
-+ gotstab = 1;
-+ } else if (!strcmp(sh_strings + shdr.sh_name, ".stabstr")) {
-+ stabstrhdr = shdr;
-+ gotstabstr = 1;
-+ } else if (shdr.sh_type == SHT_SYMTAB) {
-+ symhdr = shdr;
-+ gotsym = 1;
-+ } else if (shdr.sh_type == SHT_STRTAB) {
-+ strhdr = shdr;
-+ gotstr = 1;
-+ }
-+ }
-+ if (!gotsym || !gotstr) {
-+ fprintf(stdout, "st_read -- no symbols in executable\n");
-+ exit(1);
-+ }
-+
-+ /* read in the string table
-+ */
-+ st_strings = malloc(strhdr.sh_size);
-+ lseek(elf_file, strhdr.sh_offset, L_SET);
-+ read(elf_file, st_strings, strhdr.sh_size);
-+
-+ if (gotstabstr) {
-+ stab_strings = malloc(stabstrhdr.sh_size);
-+ lseek(elf_file, stabstrhdr.sh_offset, L_SET);
-+ read(elf_file, stab_strings, stabstrhdr.sh_size);
-+ }
-+
-+ /* read in the symbols one at a time
-+ */
-+ lseek(elf_file, symhdr.sh_offset, L_SET);
-+ for (i = 0; i < symhdr.sh_size / sizeof(Elf_Sym); i++) {
-+ read(elf_file, &asym, sizeof(asym));
-+ type = ELF_ST_TYPE(asym.st_info);
-+ if (type == STT_FUNC) {
-+ /* here's a candidate for a function name
-+ */
-+ fname = (char *) (st_strings + asym.st_name);
-+ stab_name(stab_i) = fname;
-+ stab_addr(stab_i) = asym.st_value;
-+ stab_incr(stab_i);
-+ }
-+ }
-+
-+ /* read the stab sections to look for structures */
-+ if (gotstab) {
-+ struct nlist stab;
-+ lseek(elf_file, stabhdr.sh_offset, L_SET);
-+ for (i = 0; i < stabhdr.sh_size / sizeof(struct nlist); i++) {
-+ read(elf_file, &stab, sizeof(stab));
-+ if (stab.n_type == N_LSYM || stab.n_type == N_GSYM) {
-+ st_read_structure((char *) (stab_strings + stab.n_un.n_strx));
-+ }
-+ }
-+ }
-+
-+ stab_name(stab_i) = "unknown";
-+ stab_addr(stab_i) = stab_addr(stab_i - 1) + 0x10000;
-+ stab_incr(stab_i);
-+ stab_name(stab_i) = "end_marker";
-+ stab_addr(stab_i) = 0xffffffff;
-+ stab_incr(stab_i);
-+ qsort(stab, stab_i, sizeof(struct finfo), stab_compare);
-+ close(elf_file);
-+#else
- int aout_file = open(exec_name, (O_RDONLY));
- struct exec hdr;
- struct nlist asym;
-@@ -772,6 +877,7 @@
- stab_addr(stab_i) = 0xffffffff;
- stab_incr(stab_i);
- qsort(stab, stab_i, sizeof(struct finfo), stab_compare);
-+#endif
- }
-
- void
diff --git a/devel/mprof/files/patch-Makefile.i386 b/devel/mprof/files/patch-Makefile.i386
deleted file mode 100644
index 12edbdd57fc9..000000000000
--- a/devel/mprof/files/patch-Makefile.i386
+++ /dev/null
@@ -1,152 +0,0 @@
---- Makefile.i386.orig Sun Oct 19 02:01:03 2003
-+++ Makefile.i386 Sun Oct 19 02:01:28 2003
-@@ -0,0 +1,149 @@
-+# %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 =
-+
-+CFLAGS ?= -O -pipe
-+CFLAGS += -I. -g -static
-+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
-+
-+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
-+
-+
-+###
-+leak.o: /usr/include/stdio.h mprof.h /usr/include/sys/types.h
-+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 \
-+ mprof.h /usr/include/sys/types.h
-+mprof_mon.o: /usr/include/stdio.h /usr/include/sys/file.h mprof.h \
-+ /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
diff --git a/devel/mprof/files/patch-malloc.c b/devel/mprof/files/patch-malloc.c
deleted file mode 100644
index 5dc8171ff646..000000000000
--- a/devel/mprof/files/patch-malloc.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- malloc.c.orig Wed Apr 21 04:36:17 1993
-+++ malloc.c Tue Jun 19 02:43:44 2007
-@@ -261,6 +261,8 @@
- */
- int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */
-
-+static findbucket(union overhead *, int srchlen);
-+
- char *
- realloc(cp, nbytes)
- char *cp;
diff --git a/devel/mprof/files/patch-mpgraph.c b/devel/mprof/files/patch-mpgraph.c
deleted file mode 100644
index 1eb95634f85c..000000000000
--- a/devel/mprof/files/patch-mpgraph.c
+++ /dev/null
@@ -1,54 +0,0 @@
---- mpgraph.c.orig Tue Apr 20 16:36:18 1993
-+++ mpgraph.c Mon Jun 3 18:26:17 2002
-@@ -23,8 +23,8 @@
- #define UNUSED -1
- #define USED 0
-
--FILE *stout = stdout;
--FILE *sterr = stderr;
-+/* FILE *stout = stdout; */
-+/* FILE *sterr = stderr; */
-
- extern mpcell hmem[];
- extern char *strdup();
-@@ -114,7 +114,7 @@
- vertex from, to;
- mpdata data;
- int mark;
-- struct edge_struct *save
-+ struct edge_struct *save;
- } *edge, edge_item;
-
- edge
---- mpgraph.c.orig Fri Apr 7 13:39:45 2006
-+++ mpgraph.c Fri Apr 7 01:45:35 2006
-@@ -836,7 +836,15 @@
- while (!mp_null(chain)) {
- vertex v;
- s = (mpsym) mp_car(chain);
-- v = make_vertex(fn_name(s), count, fn_lcount(s), fn_parents(s));
-+ if ( s == NULL) {
-+ chain = (mpcell) mp_cdr(chain);
-+ continue;
-+ }
-+ if (fn_name(s))
-+ v = make_vertex(fn_name(s), count, fn_lcount(s), fn_parents(s));
-+ else
-+ v = make_vertex("unknown", count, fn_lcount(s), fn_parents(s));
-+
- vpush(v, vset);
- count += 1;
- chain = (mpcell) mp_cdr(chain);
-@@ -864,7 +872,11 @@
-
- parent_name = fn_name((mpsym) mp_car(parent));
- parent_data = (mpdata) mp_cdr(parent);
-- vfrom = hlookup(parent_name);
-+ if (parent_name == NULL) {
-+ vfrom = hlookup("unknown");
-+ } else {
-+ vfrom = hlookup(parent_name);
-+ }
-
- if (vfrom == vto) {
- vto->srefs += 1;
diff --git a/devel/mprof/files/patch-mprof.c b/devel/mprof/files/patch-mprof.c
deleted file mode 100644
index 6bc512d5bd22..000000000000
--- a/devel/mprof/files/patch-mprof.c
+++ /dev/null
@@ -1,69 +0,0 @@
-diff -u mprof.c.orig mprof.c
---- mprof.c.orig Fri Apr 7 13:39:45 2006
-+++ mprof.c Fri Apr 7 01:28:45 2006
-@@ -186,7 +186,7 @@
- };
-
-
--#define STHASH_SIZE 2047
-+#define STHASH_SIZE (2<<20 -1)
- struct sthash *sthmem[STHASH_SIZE];
-
- #define STNIL NULL
-@@ -491,7 +491,7 @@
- #define stab_name(x) (stab[(x)].name)
- #define stab_addr(x) (stab[(x)].addr)
-
--#define ST_SIZE 5000
-+#define ST_SIZE 500000
- #define ST_NOT_FOUND -1
- typedef int stindex;
-
-@@ -899,7 +899,8 @@
- if (*(colp+2) == '(') {
- char *commap;
- commap = index(symp, ',');
-- *commap = '0';
-+ if (commap)
-+ *commap = '0';
- tnum = atoi((char *) index(symp, '(')+1);
- } else {
- tnum = atoi((char *) (colp+2));
-@@ -926,7 +927,8 @@
- if (*(colp+2) == '(') {
- char *commap;
- commap = index(symp, ',');
-- *commap = '0';
-+ if (commap)
-+ *commap = '0';
- tnum = atoi((char *) index(symp, '(')+1);
- } else {
- tnum = atoi((char *) colp+2);
-@@ -1275,9 +1277,15 @@
- if (d5 != 0) {
- fx = st_locate(d5);
- fsym = pc_lookup(stab_addr(fx));
-- fn_name(fsym) = stab_name(fx);
-- lte->path[SHORT_CALLSTACK_SIZE - (i + 1)].func = fn_name(fsym);
-- lte->path[SHORT_CALLSTACK_SIZE - (i + 1)].offset = d5 - stab_addr(fx);
-+ if (stab_name(fx) == NULL) {
-+ fn_name(fsym) = "";
-+ lte->path[SHORT_CALLSTACK_SIZE - (i + 1)].func = "";
-+ lte->path[SHORT_CALLSTACK_SIZE - (i + 1)].offset = 0;
-+ } else {
-+ fn_name(fsym) = stab_name(fx);
-+ lte->path[SHORT_CALLSTACK_SIZE - (i + 1)].func = fn_name(fsym);
-+ lte->path[SHORT_CALLSTACK_SIZE - (i + 1)].offset = d5 - stab_addr(fx);
-+ }
- } else {
- lte->path[SHORT_CALLSTACK_SIZE - (i + 1)].func = "";
- lte->path[SHORT_CALLSTACK_SIZE - (i + 1)].offset = 0;
-@@ -1403,6 +1411,8 @@
- fprintf(outfile, "...");
- }
- for (j = 0; j < SHORT_CALLSTACK_SIZE; j++) {
-+ if (lte.path[j].func == NULL)
-+ lte.path[j].func = "";
- if (strcmp(lte.path[j].func, "") != 0) {
- if (leak_level == LEAK_SHOW) {
- fprintf(outfile, "> %s ", lte.path[j].func);
diff --git a/devel/mprof/files/patch-mprof.h b/devel/mprof/files/patch-mprof.h
deleted file mode 100644
index 4760a941c879..000000000000
--- a/devel/mprof/files/patch-mprof.h
+++ /dev/null
@@ -1,51 +0,0 @@
-*** ../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
diff --git a/devel/mprof/files/patch-mprof_mon.c b/devel/mprof/files/patch-mprof_mon.c
deleted file mode 100644
index d526ecfa79ca..000000000000
--- a/devel/mprof/files/patch-mprof_mon.c
+++ /dev/null
@@ -1,29 +0,0 @@
-*** ../m/mprof_mon.c Tue Apr 20 13:36:09 1993
---- mprof_mon.c Fri Sep 17 17:09:01 1993
-***************
-*** 5,10 ****
---- 5,11 ----
- */
-
- #include <stdio.h>
-+ #include <unistd.h>
- #include <sys/file.h>
- #include "mprof.h"
-
-***************
-*** 411,417 ****
- #ifdef sun
- on_exit(mprof_exit, NULL);
- #endif
-! #ifdef mips
- atexit(mprof_exit);
- #endif
-
---- 412,418 ----
- #ifdef sun
- on_exit(mprof_exit, NULL);
- #endif
-! #if defined(mips) || defined(__FreeBSD__)
- atexit(mprof_exit);
- #endif
-
diff --git a/devel/mprof/pkg-descr b/devel/mprof/pkg-descr
deleted file mode 100644
index 93df37d7a786..000000000000
--- a/devel/mprof/pkg-descr
+++ /dev/null
@@ -1,18 +0,0 @@
-from the README:
-
-MPROF -- memory profiler (version 3.0)
-
-To use mprof, you must link the library libc_mp.a (found in the mprof
-directory) into your application (this library is the C library with
-the definitions of malloc and free replaced). Profiling starts
-automatically when malloc is first called. Profile data is written to
-the file "mprof.data". There are several functions that users can
-call to change the name of the output file, etc. See the man page in
-mprof.man.
-
-Simply by linking in the new malloc and executing your application, a
-file called ``mprof.data'' will be created in the current directory.
-This is the data file that mprof uses to build its dynamic call graph.
-[...]
-Mprof does not use Kyoto Common Lisp anymore. To use mprof, all you
-need is a C compiler.