- /*
- * who am i, for error messages.
- */
-char *whoami;
-
- /*
- * booleans
- */
-typedef int bool;
-#define FALSE 0
-#define TRUE 1
-
- /*
- * ticks per second
- */
-long hz;
-
-typedef u_short UNIT; /* unit of profiling */
-char *a_outname;
-#define A_OUTNAME "a.out"
-
-char *gmonname;
-#define GMONNAME "gmon.out"
-#define GMONSUM "gmon.sum"
-
- /*
- * a constructed arc,
- * with pointers to the namelist entry of the parent and the child,
- * a count of how many times this arc was traversed,
- * and pointers to the next parent of this child and
- * the next child of this parent.
- */
-struct arcstruct {
- struct nl *arc_parentp; /* pointer to parent's nl entry */
- struct nl *arc_childp; /* pointer to child's nl entry */
- long arc_count; /* how calls from parent to child */
- double arc_time; /* time inherited along arc */
- double arc_childtime; /* childtime inherited along arc */
- struct arcstruct *arc_parentlist; /* parents-of-this-child list */
- struct arcstruct *arc_childlist; /* children-of-this-parent list */
-};
-typedef struct arcstruct arctype;
-
- /*
- * The symbol table;
- * for each external in the specified file we gather
- * its address, the number of calls and compute its share of cpu time.
- */
-struct nl {
- char *name; /* the name */
- unsigned long value; /* the pc entry point */
- unsigned long svalue; /* entry point aligned to histograms */
- double time; /* ticks in this routine */
- double childtime; /* cumulative ticks in children */
- long ncall; /* how many times called */
- long selfcalls; /* how many calls to self */
- double propfraction; /* what % of time propagates */
- double propself; /* how much self time propagates */
- double propchild; /* how much child time propagates */
- bool printflag; /* should this be printed? */
- int index; /* index in the graph list */
- int toporder; /* graph call chain top-sort order */
- int cycleno; /* internal number of cycle on */
- struct nl *cyclehead; /* pointer to head of cycle */
- struct nl *cnext; /* pointer to next member of cycle */
- arctype *parents; /* list of caller arcs */
- arctype *children; /* list of callee arcs */
-};
-typedef struct nl nltype;
-
-nltype *nl; /* the whole namelist */
-nltype *npe; /* the virtual end of the namelist */
-int nname; /* the number of function names */
-
- /*
- * flag which marks a nl entry as topologically ``busy''
- * flag which marks a nl entry as topologically ``not_numbered''
- */
-#define DFN_BUSY -1
-#define DFN_NAN 0
-
- /*
- * namelist entries for cycle headers.
- * the number of discovered cycles.
- */
-nltype *cyclenl; /* cycle header namelist */
-int ncycle; /* number of cycles discovered */