3 * This file contains the standard insrumentation functions that are provied
4 * by the instrumentation layer.
11 typedef void (*instFunc)(void *cdata, int type, char *eventData);
13 typedef struct intCounterRec intCounter;
15 struct _parameteters {
33 /* parameters to a instremented function */
34 typedef struct _parameteters parameters;
35 typedef enum { processTime, wallTime } timerType;
37 /* 64 bit time values */
38 typedef long long int time64;
40 unsigned int aggregate:1;
44 typedef struct sampleIdRec sampleId;
47 struct intCounterRec {
54 typedef struct floatCounterRec floatCounter;
55 struct floatCounterRec {
62 typedef struct tTimerRec tTimer;
65 int counter; /* must be 0 to start/stop */
70 int normalize; /* value to divide total by to get seconds */
76 * standard inst. functions.
83 void DYNINSTstartTimer(tTimer *timer);
85 void DYNINSTstopTimer(tTimer *timer);
88 * increment the passed counter by one.
91 void DYNINSTincremmentCounter(intCounter*);
94 * decrement the passed counter by one.
97 void DYNINSTdecrementCounter(intCounter*);
100 * Special purpose inst functiions that use trace type specific data.
104 /* add bytes field to passed counter */
105 void addBytesCounter(intCounter *data);
108 void *filterData; /* data to filter on */
109 instFunc toCall; /* function to call if it passes filter */
110 void *callData; /* data to pass to toCall if it is called */
113 /* check src/dest matched passed arg. */
114 void filterSrc(filterArgs, int type, void *eventData);
115 void filterDest(filterArgs, int type, void *eventData);
117 /* check message type field */
118 void filterMessageType(filterArgs, int type, void *eventData);
120 /* parse file name (using fd to fileName mapping as needed) */
121 void filterFileName(filterArgs, int type, void *eventData);
125 * timestamp and write the passed trace type, and event data to the passed
129 void DYNINSTgenerateTraceRecord(traceStream destination,
135 * Define the size of the per process data area.
137 * This should be a power of two to reduce paging and chacing shifts.
139 #define SYN_INST_BUF_SIZE 256*1024