Determine the program’s process ID (PID).
If you started the program from the command line and put it in the background, its PID will be printed to standard output by the shell. Otherwise you can determine the program’s PID by typing the following.
% ps -ef | grep program-name |
Use the collect command to enable data collection on the process, and set any optional parameters.
% collect -P pid collect-options |
The collector options are described in Data Collection Options. For information about clock-based profiling, see -p option. For information about hardware clock profiling, see -h option.