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 */
69 time64 snapShot; /* used to get consistant value during st/stp */
71 int normalize; /* value to divide total by to get seconds */
78 * standard inst. functions.
85 void DYNINSTstartTimer(tTimer *timer);
87 void DYNINSTstopTimer(tTimer *timer);
90 * increment the passed counter by one.
93 void DYNINSTincremmentCounter(intCounter*);
96 * decrement the passed counter by one.
99 void DYNINSTdecrementCounter(intCounter*);
102 * Special purpose inst functiions that use trace type specific data.
106 /* add bytes field to passed counter */
107 void addBytesCounter(intCounter *data);
110 void *filterData; /* data to filter on */
111 instFunc toCall; /* function to call if it passes filter */
112 void *callData; /* data to pass to toCall if it is called */
115 /* check src/dest matched passed arg. */
116 void filterSrc(filterArgs, int type, void *eventData);
117 void filterDest(filterArgs, int type, void *eventData);
119 /* check message type field */
120 void filterMessageType(filterArgs, int type, void *eventData);
122 /* parse file name (using fd to fileName mapping as needed) */
123 void filterFileName(filterArgs, int type, void *eventData);
127 * timestamp and write the passed trace type, and event data to the passed
131 void DYNINSTgenerateTraceRecord(traceStream destination,
137 * Define the size of the per process data area.
139 * This should be a power of two to reduce paging and chacing shifts.
141 #define SYN_INST_BUF_SIZE 256*1024