If you want to collect profile data while an application is running, you must start apf32dmp before you start the application, and it must remain running throughout the execution of the application. The apf32dmp utility also provides a means to collect data during selected phases of the profiling run (see below). The application may now be executed normally. Profiling will begin as soon as the application is started.
When you stop apf32dmp, it writes the profiling data to ASCII files. The data is written to DLLNAME.END, where DLLNAME is the name of the system DLL that is being profiled. For example, KERNEL32.END would contain data from the last profiling run of KERNEL32.DLL. After each run, you should rename the .END data files so that they aren't overwritten with the data from the next run.
Data from concurrent processes and threads is written to the same data file, and there is no method for separating that data. If you need separate data on different processes, profile them individually in separate runs. If you need separate data on different threads, use the CAP tool discussed later in this chapter.
The program apf32dmp also allows data to be dumped to a file or cleared from memory at any time during the profiling run. By default, the data is dumped to a file but not cleared from memory. If you choose both options, the data is first dumped and then cleared. If you clear any data without first dumping it to a file, the data will be lost. Then you'll get to do the experiment again. Some fun, huh?
To specify whether data is dumped to a file or cleared, choose the option you want in the apf32dmp dialog box.
The utility data dumps to a file DLLNAME.EXT, where DLLNAME is the name of the system DLL being profiled, and .EXT is a file extension you define. By default, this extension is .WAP, but you may change it if you want. (Do not use the extension .END, as the profiler uses this extension.) DLLNAME.EXT is placed in the working directory of apf32dmp.