HP aC++/HP C A.06.20 Programmer's Guide
At compile time, the -p option produces code that counts the number of times each
routine is called. At link-time, when you are building an executable (but not a shared
library) -p picks up profiled versions of certain system libraries and picks up the prof
support library.
Example:
The following example compiles file.C and creates the executable file a.out
instrumented for use with prof.
aCC -p file.C
See the prof(1) manpage for more information.
+profilebucketsize
+profilebucketsize=[16|32]
This is a link-time option to support prof and gprof when building an executable,
but not a shared library. When prof or gprof startup code invokes sprofil, this
option specifies the size in bits of the counters used to record sampled values of the
program counter.
The effect of this option can be overridden by setting the environment variable
LD_PROFILEBUCKET_SIZE when running the instrumented program. This
environment variable has no effect when building the instrumented program. Legal
values are 16 (the default), and 32.
See gprof(1) and ld(1) manpages for more details.
Runtime Checking Options
The +check options allow you to check your application for errors at runtime.
+check
+check=all|none|bounds|globals|lock|malloc|stack|thread|truncate|uninit
The +check=xxx options provide runtime checks to detect many common coding
errors in the user program. These options introduce additional instructions for runtime
checks that can significantly slow down the user program. By default, a failed check
will result in the program aborting at the end of execution at runtime. In most cases,
an error message and a stack trace will be emitted to stderr before program
termination. The environment variable RTC_NO_ABORT can be set to 0, 1, or 2 to
change the behavior of failed runtime checks:
• 0 — A failed runtime check will abort the program immediately after the error
message is emitted.
• 1 — The default setting, which will abort the program at the end of execution upon
failure.
• 2 — A failed runtime check will not enable the end of execution abort.
Runtime Checking Options 99