home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / binutils-1.8.x.tar.gz / binutils-1.8.x.tar / binutils / gmon.h < prev    next >
C/C++ Source or Header  |  1988-02-01  |  2KB  |  49 lines

  1. /* Format of gmon.out file.  */
  2.  
  3. /* This header appears at the beginning of the gmon.out file.
  4.    LOW and HIGH are low and high water marks for the program counter
  5.    during the creation of the gmon.out file.
  6.    LOW is also the offset where the histogram table starts in the
  7.    text (code) segment.
  8.    NBYTES is the number of bytes in this header plus the histogram itself,
  9.    which immediately follows the header in the file.
  10.  
  11.    Therefore, the number of histogram entries is
  12.    (NBYTES - sizeof (struct gm_header)) / (sizeof (CHUNK)).
  13.  
  14.    Each entry applies to a range of PC values.
  15.    The first entry applies to PC values starting at LOW.
  16.    The last entry applies to PC values ending at HIGH.
  17.    Therefore, the span of each entry's range is
  18.        (HIGH - LOW) / number-of-entries
  19.    Usually this value is 4.
  20. */
  21.  
  22. struct gm_header {
  23.     unsigned long low;
  24.     unsigned long high;
  25.     long nbytes;
  26. };
  27.  
  28. /* Data type of an entry in the PC histogram.  */
  29. #define CHUNK    short
  30.  
  31. /* After the histogram cone the function call count entries.
  32.    They fill all the rest of the file.
  33.    Each count entry records the number of calls to one function
  34.    from one pc value.
  35.  
  36.    FROM describes the caller pc, as an offset into the text segment.
  37.    TO is the address of the called function.
  38.    NCALLS is the number of calls counted from FROM to TO.
  39.  
  40.    Note that if a function A is called from several places in B,
  41.    there are separate call count entries for each call, with different FROM.
  42.    All of them together count the number of calls from B to A.  */
  43.  
  44. struct gm_call {
  45.     unsigned long from;
  46.     unsigned long to;
  47.     unsigned long ncalls;
  48. };
  49.