Performance-Monitoring Counters Library, for Intel/AMD Processors and Linux
This example introduces
   rabbit command-line options -sample n -rotate n -flush n -trim n

Return to Main Menu

Command-Line Options -sample n n samples per second (0 < n <= 100), default 100 As the Intel performance-monitoring counters are only 40 bits wide, with no graceful provision to notice overflow and wraparound, an interval timer is used to guarantee that overflow will not be a problem. The maximum rate (100 samples per second) is based on operating system considerations. The AMD counters are 48 bits wide, but the same problems are presented. Set the sample rate to 1 to minimize overhead when investigating average behavior. If the program is subject to variable or periodic behavior that could be smoothed out over time, set the sample rate to the maximum and look for transients in the plotted -output files. '-sample 0' treats the whole experiment as one sample, so overflow could be a problem. -rotate n n samples per rotation (0 < n), default 1 This option governs the time-sharing nature of a group of event pairs. The event selection is advanced to the next pair in the list after n samples have been taken with the current event. The first event follows the last in the list. -flush n n samples per -output data file flush This option only has an effect in conjunction with the -output option. n > 0 will cause the -output data files to be flushed to disk after the event pairs have been sampled this many times each. The disk activity is started outside the measured time intervals. n = 0 (the default) implies that the data files will not be explicitly flushed during the run. It is possible in either case that system software or daemons will be active during a measured interval; for example, the file buffers could be flushed at 1024 bytes, no matter what flush rate has been supplied. For this reason, it is recommended that n be chosen between 0 and 12 (1024 byte buffer / 80 characters per line for two counters). -trim n If n > 0, omit the first n samples, and the last sample. The default is n = 0, so all samples are accumulated. This option allows an initialization phase to be avoided. The last sample tends to cover a shorter time period.
Example To monitor the progress of a long-running program on a network with a cross-mounted file system, rabbit -o z -s 1 -f 1 foo # on the target system gnuplot z/plot # on a different system The data files will be updated every 34 seconds (there are 34 event pairs in the default group on a Pentium Pro), and will always be readable by gnuplot.
Notes Although these options are available to any program using pmc_getargs(), they are not useful without pmc_run_command(), which is used by the rabbit command, or pmc_begin_sampling(), which gives greater control over the sampling time interval.

Performance-Monitoring Counters Library, for Intel/AMD Processors and Linux
Author: Don Heller,
Last revised: 2 August 2000