Annotation of researchv8dc/cmd/trace/trace.d, revision 1.1

1.1     ! root        1:  struct ELM {
        !             2:        short transf;           /* next state function */
        !             3:        short valtrans;         /* value transferred   */
        !             4:  };
        !             5: 
        !             6:  struct IND {
        !             7:        short nrpils;
        !             8:        struct ELM *one;
        !             9:  };
        !            10: 
        !            11:  struct VARPARS {
        !            12:        short nrms,    *ms;             /* message parameters */
        !            13:        short nrvs,    *vs;             /* pvar parameters    */
        !            14:        short nrlvars, *lvarvals;       /* local variables    */
        !            15:  };
        !            16: 
        !            17:  struct TBLPARS {
        !            18:        short nrms;
        !            19:        short nrvs;                     /* max available space for params */    
        !            20:        short nrlvars;                  /* max available space for locvars */
        !            21:  };
        !            22: 
        !            23:  struct LOCVARS {
        !            24:        short nrlvars, *lvarvals;
        !            25:  };
        !            26: 
        !            27:  struct CPARS {
        !            28:        short callwhat;
        !            29:        short nrms,    *ms;             /* message parameters */
        !            30:        short nrvs,    *vs;             /* pvar parameters    */
        !            31:  };
        !            32: 
        !            33:  struct LBT {
        !            34:        int *mapcol, *orgcol;           /* mapped versions of colmap and colorg */
        !            35:  };
        !            36: 
        !            37: /*
        !            38:  *     endrow:         proper endstates of the process table
        !            39:  *     deadrow:        set if deadend (eg return state)
        !            40:  *     badrow:         row with at least one output option
        !            41:  *     labrow:         labeled row (potential start of a loop)
        !            42:  */
        !            43: 
        !            44:  struct TBL {
        !            45:        int nrrows, nrcols;
        !            46:        int *endrow, *deadrow, *badrow, *labrow;
        !            47:        int *colmap, *colorg, *coltyp;
        !            48: 
        !            49:        struct IND **ptr;
        !            50:        struct CPARS *calls;
        !            51:  };
        !            52: 
        !            53:  struct MBOX {
        !            54:        char limit;             /* length of queue */
        !            55:        char owner;             /* the process reading from this queue */
        !            56:        char qname[PLENTY];     /* user-level name for the queue */
        !            57:  };
        !            58: 
        !            59:  struct MNAME {
        !            60:        char mname[PLENTY];
        !            61:  };
        !            62: 
        !            63:  struct BLTIN {
        !            64:        short target;
        !            65:        short type;
        !            66:        short value;
        !            67:  };
        !            68: 
        !            69:  struct REVPOL {
        !            70:        char toktyp;
        !            71:        short tokval;
        !            72:  };
        !            73: 
        !            74:  struct PROCSTACK {
        !            75:        short uptable;                  /* table where we come from         */
        !            76:        short uptransf;                 /* pending transition in that table */
        !            77: 
        !            78:        struct VARPARS  *varparsaved;   /* saves parameters and locals */
        !            79:        struct PROCSTACK *follow;       /* next stackframe */
        !            80:  };
        !            81: 
        !            82: #define USED   32768
        !            83: #define PASSED 16384
        !            84: 
        !            85:  struct QUEUE {
        !            86:        short mesg;                     /* on rcv PASSED is OR'ed in */
        !            87:        unsigned short cargo;           /* when set USED is OR'ed in */
        !            88:        struct QUEUE *next;
        !            89:        struct QUEUE *last;
        !            90:        struct QUEUE *s_forw;
        !            91:        struct QUEUE *s_back;
        !            92:  };
        !            93: 
        !            94:  struct CONTS {
        !            95:        short mesg;
        !            96:        unsigned short cargo;
        !            97:  };
        !            98: 
        !            99:  struct TUPLE {
        !           100:        short prev;
        !           101:        short pmap;
        !           102:  };
        !           103: 
        !           104:  struct STATE {
        !           105:        short hash;
        !           106:        int nrvisits;           /* nr of returns to this state (diff q's) */
        !           107: 
        !           108:        short *g_vars;                  /* current globals */
        !           109:        struct TUPLE *trip;             /* old states, and maps */
        !           110:        struct LOCVARS   **l_vars;      /* current local vars */
        !           111:        struct PROCSTACK **traceback;   /* traceback of complete stack */
        !           112: 
        !           113:        struct VISIT *next;     /* for loop analysis along a single path  */
        !           114:  };
        !           115: 
        !           116:  struct STUFF {
        !           117:        struct QUEUE *s;        /* pntr to last message sent  */
        !           118:  };
        !           119: 
        !           120:  struct VISIT {
        !           121:        char analyzed;          /* set when done with tree below this node */
        !           122:        char howmany;           /* how many queues are nonempty when analyzed */
        !           123:        struct {
        !           124:                struct STUFF *h;        /* when searching, points into history */
        !           125:                struct CONTS **c;       /* when analyzed, points to qcontents  */
        !           126:        } prop;
        !           127:        struct VISIT *next;
        !           128:  };
        !           129: 
        !           130: /*
        !           131:  *     normal ppushes (via forward()) save the parameters in the procstack
        !           132:  *     so that the corresponding ppop (via backup()) can reset them properly
        !           133:  *
        !           134:  *     series of ppushes and ppops, performed in a single freeze() call
        !           135:  *     (via the retable() and dotable() subroutines) are different:
        !           136:  *
        !           137:  *     additional ppushes are no problem, since they save the
        !           138:  *     proper state information via the normal route
        !           139:  *
        !           140:  *     additional ppops however would lose the procstacked info
        !           141:  *     that info is stored in the CUBE structure so that when
        !           142:  *     a ppop from freeze() is undone in unfreeze()
        !           143:  *     the proper state information can be restored onto the procstack
        !           144:  */
        !           145: 
        !           146:  struct CUBE {
        !           147:        short poporpush;
        !           148:        short which;
        !           149:        short procsaved;
        !           150:        short transfsaved;
        !           151: 
        !           152:        struct VARPARS  *varparsaved;   /* parameter map and local var map */
        !           153: 
        !           154:        struct CUBE *pntr;
        !           155:        struct CUBE *rtnp;
        !           156:  };
        !           157: 
        !           158:  struct FREEZE {
        !           159:        short lastsav;
        !           160:        short *statsaved;               /* save states of tables */
        !           161:        short *varsaved;                /* save global variables */
        !           162: 
        !           163:        short whichvar;                 /* set if a var changed */
        !           164:        short oldvalue;                 /* of that loc var      */
        !           165: 
        !           166:        struct CUBE *cube;              /* place to save stackframe */
        !           167:  };
        !           168: 
        !           169: #define NSPOKES        10
        !           170: 
        !           171:  struct Spoke {                        /* spokes and wheels are used in trace8.c */
        !           172:        struct STATE *st;
        !           173:        struct VISIT *vi;
        !           174:  };
        !           175:  struct Wheel {
        !           176:        struct Spoke spoke[NSPOKES];
        !           177:        short n;
        !           178:  };
        !           179: 
        !           180:  struct Swiffle {
        !           181:        struct STATE *st;
        !           182:        struct VISIT *vi;
        !           183:        struct Swiffle *next;
        !           184:        struct Swiffle *last;
        !           185:  };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.