OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [services/] [profile/] [gprof/] [v2_0/] [doc/] [profile.sgml] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
2
Application profiling
3
4
5
The profile_gprof package provides a mechanism to measure the
6
runtime performance of an application.  This is done by gathering
7
an execution histogram.
8
9
10
When profiling is started on the target device, a
11
TFTP
12
server will be started
13
which exports the single file
14
PROFILE.DAT
15
This analysis data can then be fetched
16
by connecting to the target with a TFTP
17
client program
18
and then be processed by the
19
gprof
20
utility program.
21
NOTE
22
23
Be sure and specify binary mode transfers for this data file,
24
which may not be the default with on some TFTP
25
client programs.
26
27
28
NOTE
29
30
The port used for this TFTP server is
31
configurable.  The default will be the IETF standard port
32
of 69/UDP, but it may be changed to any UDP port via the
33
CYGNUM_PROFILE_TFTP_PORT CDL option.
34
35
36
37
38
39
Profiling functions
40
41
 API 
42
43
In order for profile data to be gathered for an application, the
44
program has to initiate the process.
45
Once started, execution histogram data will be collected in a
46
dynamic memory buffer.
47
This data can be uploaded to a host using TFTP.
48
A side effect of the upload of the data is that the histogram
49
is reset.
50
This is useful, especially for high resolution histograms, since
51
the histogram data are collected as 16-bit counters which can be quickly
52
saturated.
53
For example, if the histogram is being collected at a rate of 10,000
54
samples per second, a hot spot in the program could saturate after
55
only 6.5 seconds.
56
57
 The API for the application profiling functions can be
58
found in the file <cyg/profile/profile.h>.
59
60
61
profile_on
62
63
This function is used to initiate the gathering of the
64
runtime execution histogram data.
65
66
67
void profile_on(void *start, void *end, int bucket_size, int resolution);
68
69
70
Calling this function will initiate execution profiling.
71
An execution histogram is collected at the rate of
72
resolution times per second.
73
The area between start and end
74
will be divided up into a number of buckets, each representing
75
bucket_size
76
program bytes in length.  Using statistical sampling (via a high speed timer), when
77
the program counter is found to be within the range
78
start..end, the appropriate
79
bucket (histogram entry) will be incremented.
80
81
82
The choice of resolution and bucket_size
83
control how large the data gathered will be, as well as how much overhead is
84
encumbered for gathering the histogram.
85
Smaller values for bucket_size will garner better
86
results (gprof can more closely align the data with
87
actual function names) at the expense of a larger data buffer.
88
89
NOTE
90
91
The value of bucket_size will be rounded up to a power of two.
92
93
94
95
96
97
98
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.