1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >Profiling functions</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="Application profiling"
23 HREF="services-profile-gprof.html"><LINK
25 TITLE="Application profiling"
26 HREF="services-profile-gprof.html"><LINK
28 TITLE="eCos Power Management Support"
29 HREF="services-power.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="services-profile-gprof.html"
71 HREF="services-power.html"
84 NAME="PROFILE-FUNCTIONS">Chapter 52. Profiling functions</H1
90 NAME="SERVICES-PROFILE-API">API</H1
92 >In order for profile data to be gathered for an application, the
93 program has to initiate the process.
94 Once started, execution histogram data will be collected in a
95 dynamic memory buffer.
96 This data can be uploaded to a host using <SPAN
103 A side effect of the upload of the data is that the histogram
105 This is useful, especially for high resolution histograms, since
106 the histogram data are collected as 16-bit counters which can be quickly
108 For example, if the histogram is being collected at a rate of 10,000
109 samples per second, a hot spot in the program could saturate after
112 > The API for the application profiling functions can be
113 found in the file <TT
115 ><cyg/profile/profile.h></TT
122 NAME="SERVICES-PROFILE-API-PROFILE-ON">profile_on</H2
124 >This function is used to initiate the gathering of the
125 runtime execution histogram data.</P
133 CLASS="PROGRAMLISTING"
134 >void profile_on(void *start, void *end, int bucket_size, int resolution);</PRE
139 >Calling this function will initiate execution profiling.
140 An execution histogram is collected at the rate of
158 will be divided up into a number of buckets, each representing
165 program bytes in length. Using statistical sampling (via a high speed timer), when
166 the program counter is found to be within the range
178 bucket (histogram entry) will be incremented.</P
191 control how large the data gathered will be, as well as how much overhead is
192 encumbered for gathering the histogram.
193 Smaller values for <TT
202 > can more closely align the data with
203 actual function names) at the expense of a larger data buffer.</P
216 > will be rounded up to a power of two.</P
227 SUMMARY="Footer navigation table"
238 HREF="services-profile-gprof.html"
256 HREF="services-power.html"
266 >Application profiling</TD
272 HREF="services-profile-gprof.html"
280 >eCos Power Management Support</TD