You do not need to do anything special to prepare most programs for data collection and analysis. You should read one or more of the subsections below if your program does any of the following:
Installs a signal handler. See Data Collection and Signals.
Explicitly dynamically loads a system library. See Using System Libraries.
Dynamically compiles functions. See Dynamic Functions and Modules.
Creates descendant processes that you want to profile. See Using System Libraries.
Uses the profiling timer or hardware counter API directly. See Using System Libraries.
Calls setuid(2) or executes a setuid file. See Data Collection and Signals and Using setuid and setgid.
Also, if you want to control data collection from your program during runtime, see Program Control of Data Collection Using libcollector Library.