gperf.1
2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.TH gperf 1P local "Silicon Graphics, Inc."
.SH NAME
gperf \- analyze profile data
.SH SYNOPSIS
\f3gperf\f1 [-c] [-r] [-s] [-t threshold] a.out
.SH DESCRIPTION
The
.I gperf
program converts the output data produced by the
.I osProfile (3P)
functions along with symbol table informtation from
.I 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
.B pc-sampling
which interrupts the program at regular intervals, recording the value
of the program counter.
.PP
.I Gperf
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
.I gperf.
After displaying the data, gperf exits.
.I Gperf
can also be run in a server mode,
.B \-s
option,
in which it spins waiting for the program to execute the
.I osProfileFlush
function.
.I Gperf
will then display the data and wait for the next
.I osProfileFlush.
.PP
.I Gperf
will always display the address of the function being displayed, the function
name, and the percent of execution time used by the function. An example of
.I gperf's
output is:
.PP
.nf
-------------------------------------------------------------
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 %
.fi
.SS Options
.TP
.B \-c
Display the raw counts for each text symbol. The -t option will then
use units of raw counts for the threshold.
.TP
.B \-r
Display the time used by each text symbol in seconds.
.TP
.B \-s
Execute in server mode, i.e. wait for a flush from application rather than
initiating a flush from
.I gperf
and don't exit. Note that the application must cooperate
by sending a
.I osProfileFlush.
.TP
.B \-t threshold
Define 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 percent of execution time.
.SH BUGS
If you execute
.I gperf
without the
.B \-s
option and the application executes a
.I osProfileFlush,
the application will hang.