Target Deployment Technology
When designing embedded and real-time software, it is frequent to have applications which are designed to loop indefinitely and do not exit.
A good method for data retrieval for this type of application can be as follows:
Set the usr_init routine to only return 0.
Set the usr_open routine to open the file in append mode and return the handle of the file.
Set the usr_write to write the buffer s into the file f.
Set the usr_close routine to close the file f.
Set the atexit function to NONE
Use the On Function Return setting in the Snapshot page of the General Runtime Analysis settings (or the -DUMPRETURNING option from the Instrumentor command line) from a function which is reachable but not executed frequently. The best is to setup a dedicated function which is executed on demand.
For this type of application, it can be useful to close the output file at the end of each dump in order to use the file for reporting in Studio even if the application is still running. To do this, compile the files with the following compiler option:
-D_ATCPQ_RESET=_ATCPQ_CLOSE