gperf (tool command)

Analyzes profile data


gperf [-c] [-r] [-s] [-t threshold] a.out


Displays the raw counts for each text symbol. The -t option then uses the units of raw counts for the threshold.

Displays the time used by each text symbol in seconds.

Executes in server mode; that is, it waits for a flush from the application rather than initiating a flush from gperf and not exiting. Note that the application must mutually cooperate by calling osProfileFlush.

-t threshold
Defines a threshold value at which to print results. Default value is 1.0. If the -c option is used, the threshold is in units of raw counts, otherwise the units are a percentage of execution time.


gperf converts the output data produced by the group of osProfile functions along with symbol table information from a.out (or your executable's name) into a printed report detailing the relative time spent by the program in various functions. This data is obtained using pc-sampling which interrupts the program at regular intervals to record the value of the program counter.

The gperf tool can operate in a query mode (default), in which each execution sends a request to the program running on the development board for profile data. The profiled data is transferred back to the host and displayed by gperf. After displaying the data, gperf exits. gperf can also be run in a server mode (specify the -s option) in which it spins waiting for the program to execute the osProfileFlush function. gperf then displays the data and waits for the next osProfileFlush.

The gperf tool always displays the address of the function being displayed, the function name, and the percent of execution time used by the function. Example gperf output follows:

Profile Report for osprof
Number of text symbols: 195
Sample period: 1000 microseconds
Number of profiled segments: 2
Text segment 0, start = 80200050, size = 000000d4
Text segment 1, start = 80200470, size = 000031cc 

80202088 osProfileStop.............................. 0.0616 %
80201720 osSetThreadPri............................. 0.1232 %
Overflow ........................................... 99.8152 %


If you execute gperf without the -s option and the application calls the osProfileFlush function, the application will stop responding (hang).

Revision History

1999/04/30 Changed Format