/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
void _STUB_vmprofile(){}
#else
#include "vmhdr.h"
/* Method to profile space usage.
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 03/23/94.
*/
struct _pfdata_s
union
} fm;
};
struct _pfobj_s
union
{
char f[1]; /* actual file name */
} data;
};
#if __STD_C
#else
char* file; /* the file issuing the allocation request */
int line; /* line number */
#endif
{
reg int n;
/* make hash table; PFTABLE'th slot hold regions' records */
if(!Pftable)
for(n = PFTABLE; n >= 0; --n)
}
/* see if it's there with a combined hash value of vm,file,line */
n = (int)(h%PFTABLE);
break;
/* insert if not there yet */
if(!pf)
hn = 0;
break;
if(!fn)
}
/* get region record; note that these are ordered by vm */
break;
if(last)
}
else
}
}
n = (int)(h%PFTABLE);
}
else if(last) /* do a move-to-front */
}
return pf;
}
#if __STD_C
#else
#endif
{
reg int n;
/* free all records related to region vm */
for(n = PFTABLE; n >= 0; --n)
{ if(last)
}
}
}
}
#if __STD_C
#else
char* file;
int line;
#endif
{
/* let vmclose knows that there are records for region vm */
{ file = "";
line = 0;
}
}
if(pf)
{ /* update region statistics */
}
}
/* sort by file names and line numbers */
#if __STD_C
#else
#endif
{
return pf;
/* partition to two equal size lists */
while(pf)
}
}
/* sort and merge the lists */
{ /* make sure that the "<>" file comes first */
cmp = -1;
cmp = 1;
if(cmp == 0)
}
if(cmp < 0)
{ if(!pf)
{ if(two)
return pf;
}
}
else
{ if(!pf)
{ if(one)
return pf;
}
}
}
}
#if __STD_C
#else
char* buf;
#endif
{
if(max > 0)
}
*buf++ = '\n';
return buf;
}
/* print profile data */
#if __STD_C
#else
int fd;
#endif
{
reg int n;
if(fd < 0)
return -1;
/* initialize functions from vmtrace.c that we use below */
if((n = vmtrace(-1)) >= 0)
vmtrace(n);
for(n = PFTABLE-1; n >= 0; --n)
goto next_pf;
}
/* remove from hash table */
if(last)
/* put on output list */
}
}
INITBUF();
/* print regions' summary data */
continue;
alloc = 0;
}
/* sort then output detailed profile */
{ /* compute summary for file */
break;
}
CHKBUF();
{ CHKBUF();
/* reinsert into hash table */
}
}
FLSBUF();
return 0;
}
#if __STD_C
#else
int local;
#endif
{
}
}
return data;
}
#if __STD_C
#else
int local;
#endif
{
if(!data)
return 0;
if(pf)
}
}
return rv;
}
#if __STD_C
#else
int type;
int local;
#endif
{
if(!data)
return addr;
}
if(size == 0)
}
{ if(pf)
}
}
}
else if(pf) /* reset old info */
}
do { *d++ = 0; } while(d < ed);
}
return addr;
}
#if __STD_C
#else
int local;
#endif
{
}
#if __STD_C
#else
int local;
#endif
{
}
#if __STD_C
#else
int local;
#endif
{
}
#if __STD_C
#else
int local;
#endif
{
}
}
return data;
}
{
};
#ifdef NoF
#endif
#endif