By default, collect requires its target to be an ELF executable and checks the target to verify this. However, you can disable this check and enable collect to run on a script that you specify as the target.
Note - Script profiling is considered an experimental feature. The implementation may change in a subsequent release.
By default, data is collected on the program that is launched to execute the script and on all descendant processes. To collect data only on a specific process, use the -F flag to specify the name of the executable to follow. For example, to profile the script foo.sh, but collect data primarily from the executable bar, use the following commands.
% setenv SP_COLLECTOR_SKIP_CHECKEXEC % collect -F =bar foo.sh
$ export SP_COLLECTOR_SKIP_CHECKEXEC $ collect -F =bar foo.sh
Data is collected on the founder process that is launched to execute the script, and on all bar processes that are spawned from the script, but not collected for other processes.