You can use the -run-at-save and -run-at-exit options to automate repetitive performance analysis and reporting tasks. Both options take a quoted string containing sh(1) shell commands. Quantify passes the string to sh whenever data is saved with the API functions quantify_save_data or quantify_save_data_to_file and when the program exits, respectively. The shell command has access to all the environment variables available at the start of the Quantify'd program.
You can use conversion characters in the string. Quantify expands the conversion characters before the string is passed to the shell.
If you have an automated overnight build process, you can use the -run-at-exit option to detect any regression in your program's performance. Add a step to the build procedure to Quantify the program and then run it on a standard test data set. The qxchange script uses qxdiff to compare a saved export data file with a given export file for an executable. It then copies the given export file to become the saved export data file for subsequent comparisons.
To run this script during the nightly build, set the environment variable QUANTIFYOPTIONS to:
'-windows=no -run-at-exit="qxchange %v %x -i"'
The -windows=no option specifies that Quantify should be run without the graphical interface during the automated run. The -run-at-exit option specifies that the qxchange script should run whenever the program saves a dataset and that comparisons should ignore system call times.
By default, the output from qxchange is written to stdout. To email the comparison to yourself, you can use:
'-windows=no -run-at-exit="qxchange %v %x -i | mail $USER"'
If your program calls the API function quantify_save_data on a regular basis in order to capture incremental performance data, you can use the -run-at-save option to view each dataset as it is saved. To view each dataset as it is saved, use:
% setenv QUANTIFYOPTIONS -run-at-save="qv %b &"