Let's say you are running a program called COLLIE.EXE which uses queues to fetch data from another program. You could use STRACE to gather performance data on how the semaphore operations associated with the queuing activities are handled, or you could use it to monitor what semaphore operations are done to help diagnose a hang in the program. The control program semaphore functions use major code 0x0018 (see Dos Functions - 2 of 12), therefore the following sequence of commands could be used:
1. Turn trace on for the desired major code, TRACE ON 24 0x0018 in this case. 2. Turn on STRACE STRACE ON 3. Run the desired program. START COLLIE 4. When program completes, or at the appropriate STRACE OFF time, turn off STRACE. TRACE OFF 5. Get a copy of the trace information from all processors. STRACE GET /R=RUN1.RAW 6. Clear the trace buffers in preparation for running the program again. STRACE FLUSH 7. Turn on STRACE again. TRACE ON 24 STRACE ON 8. Run the program again. START COLLIE 9. Turn off STRACE at the appropriate time. STRACE OFF TRACE OFF 10. Copy the trace buffers to another file. STRACE GET /R=RUN2.RAW 11. If all tracing is complete, you could now STRACE RESET delete the trace buffers. 12. Generate readable trace data and explicitly STRACE POST /R=RUN1.RAW name all output files. /M=RUN1.MTE /O=RUN1.OUT