2 * This file contains the implementation of runtime dynamic instrumentation
3 * functions for a SUNOS SPARC processor.
6 * Revision 1.2 1993/08/26 19:43:58 hollings
9 * Revision 1.1 1993/07/02 21:49:35 hollings
14 #include <sys/signal.h>
17 * Now our include files.
23 /* This marks the end of user code in the text file. */
24 /* This is to prevent system libraries with symbols compiled into them
25 * from adding extranious material to our inst. environment.
31 char DYNINSTdata[SYN_INST_BUF_SIZE];
32 char DYNINSTglobalData[SYN_INST_BUF_SIZE];
33 int DYNINSTnumSampled;
35 void DYNINSTincrementCounter(intCounter *counter)
37 if (counter->trigger && (counter->trigger->value <= 0)) return;
41 void DYNINSTdecrementCounter(intCounter *counter)
43 if (counter->trigger && (counter->trigger->value <= 0)) return;
47 void DYNINSTreportCounter(intCounter *counter)
51 sample.value = counter->value;
52 sample.id = counter->id;
54 DYNINSTgenerateTraceRecord(0, TR_SAMPLE, sizeof(sample), &sample);
57 void DYNINSTsimplePrint()
59 printf("inside dynamic inst function\n");
62 void DYNINSTentryPrint(int arg)
64 printf("enter %d\n", arg);
67 void DYNINSTcallFrom(int arg)
69 printf("call from %d\n", arg);
72 void DYNINSTcallReturn(int arg)
74 printf("return to %d\n", arg);
77 void DYNINSTexitPrint(int arg)
79 printf("exit %d\n", arg);
83 * This is a function that should be called when we want to sample the
84 * timers and counters. The code to do the sampling is added as func
85 * entry dynamic instrumentation.
88 void DYNINSTsampleValues()
93 void DYNINSTalarmExpire()
97 /* should use atomic test and set for this */
102 DYNINSTsampleValues();