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 */
68 time64 snapShot; /* used to get consistant value during st/stp */
69 int normalize; /* value to divide total by to get seconds */
77 * standard inst. functions.
84 void DYNINSTstartTimer(tTimer *timer);
86 void DYNINSTstopTimer(tTimer *timer);
89 * increment the passed counter by one.
92 void DYNINSTincremmentCounter(intCounter*);
95 * decrement the passed counter by one.
98 void DYNINSTdecrementCounter(intCounter*);
101 * Special purpose inst functiions that use trace type specific data.
105 /* add bytes field to passed counter */
106 void addBytesCounter(intCounter *data);
109 void *filterData; /* data to filter on */
110 instFunc toCall; /* function to call if it passes filter */
111 void *callData; /* data to pass to toCall if it is called */
114 /* check src/dest matched passed arg. */
115 void filterSrc(filterArgs, int type, void *eventData);
116 void filterDest(filterArgs, int type, void *eventData);
118 /* check message type field */
119 void filterMessageType(filterArgs, int type, void *eventData);
121 /* parse file name (using fd to fileName mapping as needed) */
122 void filterFileName(filterArgs, int type, void *eventData);
126 * timestamp and write the passed trace type, and event data to the passed
130 void DYNINSTgenerateTraceRecord(traceStream destination,
136 * Define the size of the per process data area.
138 * This should be a power of two to reduce paging and chacing shifts.
140 #define SYN_INST_BUF_SIZE 256*1024