Quantify installs signal handlers for many of the software signals that can be delivered to a Quantify'd process. The signal handler saves performance data to a file before proceeding with the normal signal behavior (which typically involves termination of the program). If you have already installed a signal handler for a given signal, Quantify does not save data when it receives that signal.
The initial default set of signals handled by Quantify are:
Solaris: SIGHUP, SIGINT, SIGIOT, SIGQUIT, SIGILL, SIGABRT, SIGEMT, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2, SIGPOLL, SIGRTMIN, SIGRTMAX, SIGXFSZ, SIGXCPU, SIGXFSZ
HP-UX: SIGHUP, SIGINT, SIGIOT, SIGQUIT, SIGILL, SIGABRT, SIGEMT, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2, SIGLOST, SIGRESERVE, SIGDIL, SIGXCPU, SIGXFSZ
To ignore signals in this list, use the -ignore-signals option. Specify a comma-separated list of signals to ignore. For example:
% setenv QUANTIFYOPTIONS -ignore-signals=SIGSEGV,SIGBUS
To handle additional signals, use the -handle-signals option. Specify a comma-separated list of additional signals. For example:
% setenv QUANTIFYOPTIONS -handle-signals=SIGALARM,SIGCHLD
Quantify does not handle SIGKILL, SIGTSTOP, and SIGTRAP, since doing so interferes with normal program operation. If you specify these signals with -handle-signals, Quantify silently ignores them.
If you do not want Quantify to save data on any signals, specify:
% setenv QUANTIFYOPTIONS -save-data-on-signals=no
If you have a program, such as a daemon, that does not exit, you can capture Quantify data and save it to a file while the program is running, without terminating the program. You can use either of these methods:
Write a signal handler
for a given signal that calls the Quantify API function quantify_save_data. To clear
the Quantify counters, call quantify_clear_data.
To send the signal to the process, type:
% kill -USR1 <pid>
This causes Quantify to write the data to the next dataset number. You can view that data with qv immediately after the file is written, while the daemon continues to run. Quantify automatically resets its counters to zero after saving the data, ensuring that the next incremental dataset will contain the data since the last save.
For additional information on signals, see the signal, sigvec, and sigmask manual pages, and the /usr/include/signal.h and /usr/include/sys/signal.h files.