mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
Do a bit of patch work to improve handling of modern (large/complex,
possibly C++) software. PR: ports/106491 Submitted by: Julian Elischer <julian@pan.ironport.com>
This commit is contained in:
parent
27c514d668
commit
7b5e47e331
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=179447
3 changed files with 102 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
PORTNAME= mprof
|
||||
PORTVERSION= 3.0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= ftp://ftp.cs.colorado.edu/pub/misc/
|
||||
EXTRACT_SUFX= .tar.Z
|
||||
|
|
|
@ -20,3 +20,35 @@
|
|||
} *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;
|
||||
|
|
69
devel/mprof/files/patch-mprof.c
Normal file
69
devel/mprof/files/patch-mprof.c
Normal file
|
@ -0,0 +1,69 @@
|
|||
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);
|
Loading…
Add table
Reference in a new issue