-/* ==> Do not modify this file!! It is created automatically
- by make-c-prog.awk; modify make-c-prog.awk instead. <== */
-
#include <stdio.h>
+#include "gprof.h"
void
flat_blurb (file)
FILE *file;
{
- fputs ("\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs ("flat profile:\n", file);
- fputs ("\n", file);
- fputs (" % the percentage of the total running time of the\n", file);
- fputs ("time program used by this function.\n", file);
- fputs ("\n", file);
- fputs ("cumulative a running sum of the number of seconds accounted\n", file);
- fputs (" seconds for by this function and those listed above it.\n", file);
- fputs ("\n", file);
- fputs (" self the number of seconds accounted for by this\n", file);
- fputs ("seconds function alone. This is the major sort for this\n", file);
- fputs (" listing.\n", file);
- fputs ("\n", file);
- fputs ("calls the number of times this function was invoked, if\n", file);
- fputs (" this function is profiled, else blank.\n", file);
- fputs (" \n", file);
- fputs (" self the average number of milliseconds spent in this\n", file);
- fputs ("ms/call function per call, if this function is profiled,\n", file);
- fputs (" else blank.\n", file);
- fputs ("\n", file);
- fputs (" total the average number of milliseconds spent in this\n", file);
- fputs ("ms/call function and its descendents per call, if this \n", file);
- fputs (" function is profiled, else blank.\n", file);
- fputs ("\n", file);
- fputs ("name the name of the function. This is the minor sort\n", file);
- fputs (" for this listing. The index shows the location of\n", file);
- fputs (" the function in the gprof listing. If the index is\n", file);
- fputs (" in parenthesis it shows where it would appear in\n", file);
- fputs (" the gprof listing if it were to be printed.\n", file);
- fputs ("\f\n", file);
+ fputs("\n\
+ % the percentage of the total running time of the\n\
+time program used by this function.\n\
+\n\
+cumulative a running sum of the number of seconds accounted\n\
+ seconds for by this function and those listed above it.\n\
+\n\
+ self the number of seconds accounted for by this\n\
+seconds function alone. This is the major sort for this\n\
+ listing.\n\
+\n\
+calls the number of times this function was invoked, if\n\
+ this function is profiled, else blank.\n\
+ \n\
+ self the average number of milliseconds spent in this\n\
+ms/call function per call, if this function is profiled,\n\
+ else blank.\n\
+\n\
+ total the average number of milliseconds spent in this\n\
+ms/call function and its descendents per call, if this \n\
+ function is profiled, else blank.\n\
+\n\
+name the name of the function. This is the minor sort\n\
+ for this listing. The index shows the location of\n\
+ the function in the gprof listing. If the index is\n\
+ in parenthesis it shows where it would appear in\n\
+ the gprof listing if it were to be printed.\n\
+\f\n", file);
}
+static char *callg_blurb_bsd = "\n\
+\n\
+\n\
+call graph profile:\n\
+ The sum of self and descendents is the major sort\n\
+ for this listing.\n\
+\n\
+ function entries:\n\
+\n\
+index the index of the function in the call graph\n\
+ listing, as an aid to locating it (see below).\n\
+\n\
+%time the percentage of the total time of the program\n\
+ accounted for by this function and its\n\
+ descendents.\n\
+\n\
+self the number of seconds spent in this function\n\
+ itself.\n\
+\n\
+descendents\n\
+ the number of seconds spent in the descendents of\n\
+ this function on behalf of this function.\n\
+\n\
+called the number of times this function is called (other\n\
+ than recursive calls).\n\
+\n\
+self the number of times this function calls itself\n\
+ recursively.\n\
+\n\
+name the name of the function, with an indication of\n\
+ its membership in a cycle, if any.\n\
+\n\
+index the index of the function in the call graph\n\
+ listing, as an aid to locating it.\n\
+\n\
+\n\
+\n\
+ parent listings:\n\
+\n\
+self* the number of seconds of this function's self time\n\
+ which is due to calls from this parent.\n\
+\n\
+descendents*\n\
+ the number of seconds of this function's\n\
+ descendent time which is due to calls from this\n\
+ parent.\n\
+\n\
+called** the number of times this function is called by\n\
+ this parent. This is the numerator of the\n\
+ fraction which divides up the function's time to\n\
+ its parents.\n\
+\n\
+total* the number of times this function was called by\n\
+ all of its parents. This is the denominator of\n\
+ the propagation fraction.\n\
+\n\
+parents the name of this parent, with an indication of the\n\
+ parent's membership in a cycle, if any.\n\
+\n\
+index the index of this parent in the call graph\n\
+ listing, as an aid in locating it.\n\
+\n\
+\n\
+\n\
+ children listings:\n\
+\n\
+self* the number of seconds of this child's self time\n\
+ which is due to being called by this function.\n\
+\n\
+descendent*\n\
+ the number of seconds of this child's descendent's\n\
+ time which is due to being called by this\n\
+ function.\n\
+\n\
+called** the number of times this child is called by this\n\
+ function. This is the numerator of the\n\
+ propagation fraction for this child.\n\
+\n\
+total* the number of times this child is called by all\n\
+ functions. This is the denominator of the\n\
+ propagation fraction.\n\
+\n\
+children the name of this child, and an indication of its\n\
+ membership in a cycle, if any.\n\
+\n\
+index the index of this child in the call graph listing,\n\
+ as an aid to locating it.\n\
+\n\
+\n\
+\n\
+ * these fields are omitted for parents (or\n\
+ children) in the same cycle as the function. If\n\
+ the function (or child) is a member of a cycle,\n\
+ the propagated times and propagation denominator\n\
+ represent the self time and descendent time of the\n\
+ cycle as a whole.\n\
+\n\
+ ** static-only parents and children are indicated\n\
+ by a call count of 0.\n\
+\n\
+\n\
+\n\
+ cycle listings:\n\
+ the cycle as a whole is listed with the same\n\
+ fields as a function entry. Below it are listed\n\
+ the members of the cycle, and their contributions\n\
+ to the time and call counts of the cycle.\n\
+\f\n";
+
+static char *callg_blurb_fsf = "\n\
+ This table describes the call tree of the program, and was sorted by\n\
+ the total amount of time spent in each function and its children.\n\n\
+ Each entry in this table consists of several lines. The line with the\n\
+ index number at the left hand margin lists the current function.\n\
+ The lines above it list the functions that called this function,\n\
+ and the lines below it list the functions this one called.\n\
+ This line lists:\n\
+ index A unique number given to each element of the table.\n\
+ Index numbers are sorted numerically.\n\
+ The index number is printed next to every function name so\n\
+ it is easier to look up where the function in the table.\n\n\
+ % time This is the percentage of the `total' time that was spent\n\
+ in this function and its children. Note that due to\n\
+ different viewpoints, functions excluded by options, etc,\n\
+ these numbers will NOT add up to 100%.\n\n\
+ self This is the total amount of time spent in this function.\n\n\
+ children This is the total amount of time propagated into this\n\
+ function by its children.\n\n\
+ called This is the number of times the function was called.\n\
+ If the function called itself recursively, the number\n\
+ only includes non-recursive calls, and is followed by\n\
+ a `+' and the number of recursive calls.\n\n\
+ name The name of the current function. The index number is\n\
+ printed after it. If the function is a member of a\n\
+ cycle, the cycle number is printed between the\n\
+ function's name and the index number.\n\n\n\
+ For the function's parents, the fields have the following meanings:\n\n\
+ self This is the amount of time that was propagated directly\n\
+ from the function into this parent.\n\n\
+ children This is the amount of time that was propagated from\n\
+ the function's children into this parent.\n\n\
+ called This is the number of times this parent called the\n\
+ function `/' the total number of times the function\n\
+ was called. Recursive calls to the function are not\n\
+ included in the number after the `/'.\n\n\
+ name This is the name of the parent. The parent's index\n\
+ number is printed after it. If the parent is a\n\
+ member of a cycle, the cycle number is printed between\n\
+ the name and the index number.\n\n\
+ If the parents of the function cannot be determined, the word\n\
+ `<spontaneous>' is printed in the `name' field, and all the other\n\
+ fields are blank.\n\n\
+ For the function's children, the fields have the following meanings:\n\n\
+ self This is the amount of time that was propagated directly\n\
+ from the child into the function.\n\n\
+ children This is the amount of time that was propagated from the\n\
+ child's children to the function.\n\n\
+ called This is the number of times the function called\n\
+ this child `/' the total number of times the child\n\
+ was called. Recursive calls by the child are not\n\
+ listed in the number after the `/'.\n\n\
+ name This is the name of the child. The child's index\n\
+ number is printed after it. If the child is a\n\
+ member of a cycle, the cycle number is printed\n\
+ between the name and the index number.\n\n\
+ If there are any cycles (circles) in the call graph, there is an\n\
+ entry for the cycle-as-a-whole. This entry shows who called the\n\
+ cycle (as parents) and the members of the cycle (as children.)\n\
+ The `+' recursive calls entry shows the number of function calls that\n\
+ were internal to the cycle, and the calls entry for each member shows,\n\
+ for that member, how many times it was called from other members of\n\
+ the cycle.\n\n";
+
void
callg_blurb (file)
FILE *file;
{
- fputs ("\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs ("call graph profile:\n", file);
- fputs (" The sum of self and descendents is the major sort\n", file);
- fputs (" for this listing.\n", file);
- fputs ("\n", file);
- fputs (" function entries:\n", file);
- fputs ("\n", file);
- fputs ("index the index of the function in the call graph\n", file);
- fputs (" listing, as an aid to locating it (see below).\n", file);
- fputs ("\n", file);
- fputs ("%time the percentage of the total time of the program\n", file);
- fputs (" accounted for by this function and its\n", file);
- fputs (" descendents.\n", file);
- fputs ("\n", file);
- fputs ("self the number of seconds spent in this function\n", file);
- fputs (" itself.\n", file);
- fputs ("\n", file);
- fputs ("descendents\n", file);
- fputs (" the number of seconds spent in the descendents of\n", file);
- fputs (" this function on behalf of this function.\n", file);
- fputs ("\n", file);
- fputs ("called the number of times this function is called (other\n", file);
- fputs (" than recursive calls).\n", file);
- fputs ("\n", file);
- fputs ("self the number of times this function calls itself\n", file);
- fputs (" recursively.\n", file);
- fputs ("\n", file);
- fputs ("name the name of the function, with an indication of\n", file);
- fputs (" its membership in a cycle, if any.\n", file);
- fputs ("\n", file);
- fputs ("index the index of the function in the call graph\n", file);
- fputs (" listing, as an aid to locating it.\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs (" parent listings:\n", file);
- fputs ("\n", file);
- fputs ("self* the number of seconds of this function's self time\n", file);
- fputs (" which is due to calls from this parent.\n", file);
- fputs ("\n", file);
- fputs ("descendents*\n", file);
- fputs (" the number of seconds of this function's\n", file);
- fputs (" descendent time which is due to calls from this\n", file);
- fputs (" parent.\n", file);
- fputs ("\n", file);
- fputs ("called** the number of times this function is called by\n", file);
- fputs (" this parent. This is the numerator of the\n", file);
- fputs (" fraction which divides up the function's time to\n", file);
- fputs (" its parents.\n", file);
- fputs ("\n", file);
- fputs ("total* the number of times this function was called by\n", file);
- fputs (" all of its parents. This is the denominator of\n", file);
- fputs (" the propagation fraction.\n", file);
- fputs ("\n", file);
- fputs ("parents the name of this parent, with an indication of the\n", file);
- fputs (" parent's membership in a cycle, if any.\n", file);
- fputs ("\n", file);
- fputs ("index the index of this parent in the call graph\n", file);
- fputs (" listing, as an aid in locating it.\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs (" children listings:\n", file);
- fputs ("\n", file);
- fputs ("self* the number of seconds of this child's self time\n", file);
- fputs (" which is due to being called by this function.\n", file);
- fputs ("\n", file);
- fputs ("descendent*\n", file);
- fputs (" the number of seconds of this child's descendent's\n", file);
- fputs (" time which is due to being called by this\n", file);
- fputs (" function.\n", file);
- fputs ("\n", file);
- fputs ("called** the number of times this child is called by this\n", file);
- fputs (" function. This is the numerator of the\n", file);
- fputs (" propagation fraction for this child.\n", file);
- fputs ("\n", file);
- fputs ("total* the number of times this child is called by all\n", file);
- fputs (" functions. This is the denominator of the\n", file);
- fputs (" propagation fraction.\n", file);
- fputs ("\n", file);
- fputs ("children the name of this child, and an indication of its\n", file);
- fputs (" membership in a cycle, if any.\n", file);
- fputs ("\n", file);
- fputs ("index the index of this child in the call graph listing,\n", file);
- fputs (" as an aid to locating it.\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs (" * these fields are omitted for parents (or\n", file);
- fputs (" children) in the same cycle as the function. If\n", file);
- fputs (" the function (or child) is a member of a cycle,\n", file);
- fputs (" the propagated times and propagation denominator\n", file);
- fputs (" represent the self time and descendent time of the\n", file);
- fputs (" cycle as a whole.\n", file);
- fputs ("\n", file);
- fputs (" ** static-only parents and children are indicated\n", file);
- fputs (" by a call count of 0.\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs ("\n", file);
- fputs (" cycle listings:\n", file);
- fputs (" the cycle as a whole is listed with the same\n", file);
- fputs (" fields as a function entry. Below it are listed\n", file);
- fputs (" the members of the cycle, and their contributions\n", file);
- fputs (" to the time and call counts of the cycle.\n", file);
- fputs ("\f\n", file);
+ if (bsd_style_output)
+ fputs(callg_blurb_bsd, file);
+ else
+ fputs(callg_blurb_fsf, file);
}
#endif /* not lint */
#include "gprof.h"
+#include <demangle.h>
printprof()
{
int index, timecmp();
actime = 0.0;
- printf( "\f\n" );
+ if ( bsd_style_output ) {
+ printf( "\f\n" );
+ if ( bflag) {
+ printf( "\n\n\nflat profile:\n" );
+ flat_blurb(stdout);
+ }
+ }
+ else
+ printf ("Flat profile:\n");
flatprofheader();
/*
* Sort the symbol table in by time
}
actime = 0.0;
cfree( sortednlp );
+ if ( bflag && !bsd_style_output ) {
+ flat_blurb(stdout);
+ }
}
timecmp( npp1 , npp2 )
flatprofheader()
{
- if ( bflag ) {
- flat_blurb(stdout);
- }
- printf( "\ngranularity: each sample hit covers %d byte(s)" ,
- (long) scale * sizeof(UNIT) );
- if ( totime > 0.0 ) {
- printf( " for %.2f%% of %.2f seconds\n\n" ,
- 100.0/totime , totime / hz );
- } else {
- printf( " no time accumulated\n\n" );
+ if (bsd_style_output) {
+ printf( "\ngranularity: each sample hit covers %d byte(s)" ,
+ (long) scale * sizeof(UNIT) );
+ if ( totime > 0.0 ) {
+ printf( " for %.2f%% of %.2f seconds\n\n" ,
+ 100.0/totime , totime / hz );
+ } else {
+ printf( " no time accumulated\n\n" );
/*
* this doesn't hurt since all the numerators will be zero.
*/
- totime = 1.0;
+ totime = 1.0;
+ }
+ }
+ else {
+ printf( "\nEach sample counts as %g seconds.\n",
+ 1.0 / hz);
}
printf( "%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n" ,
"% " , "cumulative" , "self " , "" , "self " , "total " , "" );
return;
}
actime += np -> time;
- printf( "%5.1f %10.2f %8.2f" ,
- 100 * np -> time / totime , actime / hz , np -> time / hz );
+ if (bsd_style_output)
+ printf( "%5.1f %10.2f %8.2f" ,
+ 100 * np -> time / totime , actime / hz , np -> time / hz );
+ else
+ printf( "%6.2f %9.2f %8.2f" ,
+ 100 * np -> time / totime , actime / hz , np -> time / hz );
if ( np -> ncall != 0 ) {
printf( " %8d %8.2f %8.2f " , np -> ncall ,
1000 * np -> time / hz / np -> ncall ,
} else {
printf( " %8.8s %8.8s %8.8s " , "" , "" , "" );
}
- printname( np );
+ if (bsd_style_output)
+ printname( np );
+ else
+ printnameonly( np );
printf( "\n" );
}
gprofheader()
{
- if ( bflag ) {
- callg_blurb(stdout);
- }
+ if (!bsd_style_output)
+ if (bflag)
+ printf ("\t\t Call graph (explanation follows)\n\n");
+ else
+ printf ("\t\t\tCall graph\n\n");
printf( "\ngranularity: each sample hit covers %d byte(s)" ,
(long) scale * sizeof(UNIT) );
if ( printtime > 0.0 ) {
*/
printtime = 1.0;
}
- printf( "%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n" ,
- "" , "" , "" , "" , "called" , "total" , "parents");
- printf( "%-6.6s %5.5s %7.7s %11.11s %7.7s+%-7.7s %-8.8s\t%5.5s\n" ,
- "index" , "%time" , "self" , "descendents" ,
- "called" , "self" , "name" , "index" );
- printf( "%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n" ,
- "" , "" , "" , "" , "called" , "total" , "children");
- printf( "\n" );
+ if (bsd_style_output) {
+ printf( "%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n" ,
+ "" , "" , "" , "" , "called" , "total" , "parents");
+ printf( "%-6.6s %5.5s %7.7s %11.11s %7.7s+%-7.7s %-8.8s\t%5.5s\n" ,
+ "index" , "%time" , "self" , "descendents" ,
+ "called" , "self" , "name" , "index" );
+ printf( "%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n" ,
+ "" , "" , "" , "" , "called" , "total" , "children");
+ printf( "\n" );
+ } else {
+ printf( "index %% time self children called name\n" );
+ }
}
gprofline( np )
char kirkbuffer[ BUFSIZ ];
sprintf( kirkbuffer , "[%d]" , np -> index );
- printf( "%-6.6s %5.1f %7.2f %11.2f" ,
- kirkbuffer ,
- 100 * ( np -> propself + np -> propchild ) / printtime ,
- np -> propself / hz ,
- np -> propchild / hz );
+ printf(bsd_style_output
+ ? "%-6.6s %5.1f %7.2f %11.2f"
+ : "%-6.6s %5.1f %7.2f %7.2f" ,
+ kirkbuffer ,
+ 100 * ( np -> propself + np -> propchild ) / printtime ,
+ np -> propself / hz ,
+ np -> propchild / hz );
if ( ( np -> ncall + np -> selfcalls ) != 0 ) {
printf( " %7d" , np -> ncall );
if ( np -> selfcalls != 0 ) {
/*
* Print out the structured profiling list
*/
+ if ( bflag && bsd_style_output ) {
+ callg_blurb(stdout);
+ }
gprofheader();
for ( index = 0 ; index < nname + ncycle ; index ++ ) {
parentp = timesortnlp[ index ];
gprofline( parentp );
printchildren( parentp );
}
- printf( "\n" );
+ if (bsd_style_output)
+ printf( "\n" );
printf( "-----------------------------------------------\n" );
- printf( "\n" );
+ if (bsd_style_output)
+ printf( "\n" );
}
cfree( timesortnlp );
+ if ( bflag && !bsd_style_output) {
+ callg_blurb(stdout);
+ }
}
/*
cycleheadp = childp;
}
if ( childp -> parents == 0 ) {
- printf( "%6.6s %5.5s %7.7s %11.11s %7.7s %7.7s <spontaneous>\n" ,
+ printf(bsd_style_output
+ ? "%6.6s %5.5s %7.7s %11.11s %7.7s %7.7s <spontaneous>\n"
+ : "%6.6s %5.5s %7.7s %7.7s %7.7s %7.7s <spontaneous>\n" ,
"" , "" , "" , "" , "" , "" );
return;
}
/*
* selfcall or call among siblings
*/
- printf( "%6.6s %5.5s %7.7s %11.11s %7d %7.7s " ,
+ printf(bsd_style_output
+ ? "%6.6s %5.5s %7.7s %11.11s %7d %7.7s "
+ : "%6.6s %5.5s %7.7s %7.7s %7d %7.7s " ,
"" , "" , "" , "" ,
arcp -> arc_count , "" );
printname( parentp );
/*
* regular parent of child
*/
- printf( "%6.6s %5.5s %7.2f %11.2f %7d/%-7d " ,
+ printf(bsd_style_output
+ ? "%6.6s %5.5s %7.2f %11.2f %7d/%-7d "
+ : "%6.6s %5.5s %7.2f %7.2f %7d/%-7d ",
"" , "" ,
arcp -> arc_time / hz , arcp -> arc_childtime / hz ,
arcp -> arc_count , cycleheadp -> ncall );
/*
* self call or call to sibling
*/
- printf( "%6.6s %5.5s %7.7s %11.11s %7d %7.7s " ,
- "" , "" , "" , "" , arcp -> arc_count , "" );
+ printf(bsd_style_output
+ ? "%6.6s %5.5s %7.7s %11.11s %7d %7.7s "
+ : "%6.6s %5.5s %7.7s %7.7s %7d %7.7s " ,
+ "" , "" , "" , "" , arcp -> arc_count , "" );
printname( childp );
printf( "\n" );
} else {
/*
* regular child of parent
*/
- printf( "%6.6s %5.5s %7.2f %11.2f %7d/%-7d " ,
- "" , "" ,
- arcp -> arc_time / hz , arcp -> arc_childtime / hz ,
- arcp -> arc_count , childp -> cyclehead -> ncall );
+ printf(bsd_style_output
+ ? "%6.6s %5.5s %7.2f %11.2f %7d/%-7d "
+ : "%6.6s %5.5s %7.2f %7.2f %7d/%-7d " ,
+ "" , "" ,
+ arcp -> arc_time / hz , arcp -> arc_childtime / hz ,
+ arcp -> arc_count , childp -> cyclehead -> ncall );
printname( childp );
printf( "\n" );
}
}
}
+/* Print name of symbol. Return number of characters printed. */
+
+int
+printnameonly ( selfp )
+ nltype *selfp;
+{
+ int size = 0;
+ CONST char *name = selfp->name;
+ if (name != NULL) {
+ char *demangled = NULL;
+ if (!bsd_style_output) {
+ if (name[0] == '_' && name[1] && discard_underscores)
+ name++;
+ demangled = cplus_demangle (name, DMGL_ANSI|DMGL_PARAMS);
+ if (demangled)
+ name = demangled;
+ }
+ printf( "%s" , name );
+ size = strlen (name);
+ if (demangled)
+ free (demangled);
+#ifdef DEBUG
+ if ( debug & DFNDEBUG ) {
+ printf( "{%d} " , selfp -> toporder );
+ }
+ if ( debug & PROPDEBUG ) {
+ printf( "%5.2f%% " , selfp -> propfraction );
+ }
+#endif DEBUG
+ }
+ return size;
+}
+
printname( selfp )
nltype *selfp;
{
+ printnameonly (selfp);
- if ( selfp -> name != 0 ) {
- printf( "%s" , selfp -> name );
-# ifdef DEBUG
- if ( debug & DFNDEBUG ) {
- printf( "{%d} " , selfp -> toporder );
- }
- if ( debug & PROPDEBUG ) {
- printf( "%5.2f%% " , selfp -> propfraction );
- }
-# endif DEBUG
- }
if ( selfp -> cycleno != 0 ) {
printf( " <cycle %d>" , selfp -> cycleno );
}
nltype **namesortnlp;
register nltype *nlp;
int index, nnames, todo, i, j;
- char peterbuffer[ BUFSIZ ];
+ char peterbuffer[20];
/*
* Now, sort regular function name alphbetically
sprintf( peterbuffer , "(%d)" , nlp -> index );
}
if ( j < nnames ) {
- printf( "%6.6s %-19.19s" , peterbuffer , nlp -> name );
+ printf( "%6.6s " , peterbuffer );
+ if (bsd_style_output)
+ printf ("%-19.19s" , nlp->name);
+ else {
+ int size = printnameonly(nlp);
+ for ( ; size < 19; size++) putchar(' ');
+ }
} else {
printf( "%6.6s " , peterbuffer );
sprintf( peterbuffer , "<cycle %d>" , nlp -> cycleno );
}
cfree( namesortnlp );
}
+
+PTR
+xmalloc (size)
+ long size;
+{
+ PTR val = malloc (size);
+ if (val == NULL) {
+ fprintf (stderr, "virtual memory exhaused\n");
+ exit (1);
+ }
+ return val;
+}
+
+PTR
+xrealloc (oldval, size)
+ PTR oldval;
+ long size;
+{
+ PTR val = realloc (oldval, size);
+ if (val == NULL) {
+ fprintf (stderr, "virtual memory exhaused\n");
+ exit (1);
+ }
+ return val;
+}
+