home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / sys / h / gprof < prev    next >
Encoding:
Text File  |  1995-01-11  |  2.6 KB  |  105 lines

  1. /*
  2.  * $Header: /ax/networking:include/sys/gprof.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/sys/gprof.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    gprof.h,v $
  8.  * Revision 1.1  95/01/11  10:19:16  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.3  88/06/17  20:19:19  beta
  12.  * Acorn Unix initial beta version
  13.  * 
  14.  */
  15. /* @(#)gprof.h    1.2 87/05/15 3.2/4.3NFSSRC */
  16. /*
  17.  * Copyright (c) 1982, 1986 Regents of the University of California.
  18.  * All rights reserved.  The Berkeley software License Agreement
  19.  * specifies the terms and conditions for redistribution.
  20.  *
  21.  *    @(#)gprof.h    7.1 (Berkeley) 6/4/86
  22.  */
  23.  
  24. struct phdr {
  25.     char    *lpc;
  26.     char    *hpc;
  27.     int        ncnt;
  28. };
  29.  
  30.     /*
  31.      *    histogram counters are unsigned shorts (according to the kernel).
  32.      */
  33. #define    HISTCOUNTER    unsigned short
  34.  
  35.     /*
  36.      *    fraction of text space to allocate for histogram counters
  37.      *    here, 1/2
  38.      */
  39. #define    HISTFRACTION    2
  40.  
  41.     /*
  42.      *    Fraction of text space to allocate for from hash buckets.
  43.      *    The value of HASHFRACTION is based on the minimum number of bytes
  44.      *    of separation between two subroutine call points in the object code.
  45.      *    Given MIN_SUBR_SEPARATION bytes of separation the value of
  46.      *    HASHFRACTION is calculated as:
  47.      *
  48.      *        HASHFRACTION = MIN_SUBR_SEPARATION / (2 * sizeof(short) - 1);
  49.      *
  50.      *    For the VAX, the shortest two call sequence is:
  51.      *
  52.      *        calls    $0,(r0)
  53.      *        calls    $0,(r0)
  54.      *
  55.      *    which is separated by only three bytes, thus HASHFRACTION is 
  56.      *    calculated as:
  57.      *
  58.      *        HASHFRACTION = 3 / (2 * 2 - 1) = 1
  59.      *
  60.      *    Note that the division above rounds down, thus if MIN_SUBR_FRACTION
  61.      *    is less than three, this algorithm will not work!
  62.      *
  63.      *    NB: for the kernel we assert that the shortest two call sequence is:
  64.      *
  65.      *        calls    $0,_name
  66.      *        calls    $0,_name
  67.      *
  68.      *    which is separated by seven bytes, thus HASHFRACTION is calculated as:
  69.      *
  70.      *        HASHFRACTION = 7 / (2 * 2 - 1) = 2
  71.      */
  72. #define    HASHFRACTION    2
  73.  
  74.     /*
  75.      *    percent of text space to allocate for tostructs
  76.      *    with a minimum.
  77.      */
  78. #define ARCDENSITY    2
  79. #define MINARCS        50
  80.  
  81. struct tostruct {
  82.     char        *selfpc;
  83.     long        count;
  84.     unsigned short    link;
  85. };
  86.  
  87.     /*
  88.      *    a raw arc,
  89.      *        with pointers to the calling site and the called site
  90.      *        and a count.
  91.      */
  92. struct rawarc {
  93.     unsigned long    raw_frompc;
  94.     unsigned long    raw_selfpc;
  95.     long        raw_count;
  96. };
  97.  
  98.     /*
  99.      *    general rounding functions.
  100.      */
  101. #define ROUNDDOWN(x,y)    (((x)/(y))*(y))
  102. #define ROUNDUP(x,y)    ((((x)+(y)-1)/(y))*(y))
  103.  
  104. /* EOF gprof.h */
  105.