1 # ====================================================================
5 # cpu load measurements
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 2003 eCosCentric Ltd.
12 ## Copyright (C) 2002 Gary Thomas
14 ## eCos is free software; you can redistribute it and/or modify it under
15 ## the terms of the GNU General Public License as published by the Free
16 ## Software Foundation; either version 2 or (at your option) any later version.
18 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
19 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 ## You should have received a copy of the GNU General Public License along
24 ## with eCos; if not, write to the Free Software Foundation, Inc.,
25 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 ## As a special exception, if other files instantiate templates or use macros
28 ## or inline functions from this file, or you compile this file and link it
29 ## with other works to produce a work based on this file, this file does not
30 ## by itself cause the resulting work to be covered by the GNU General Public
31 ## License. However the source code for this file must still be made available
32 ## in accordance with section (3) of the GNU General Public License.
34 ## This exception does not invalidate any other reasons why a work based on
35 ## this file might be covered by the GNU General Public License.
37 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
38 ## at http://sources.redhat.com/ecos/ecos-license/
39 ## -------------------------------------------
40 #####ECOSGPLCOPYRIGHTEND####
41 # ====================================================================
42 ######DESCRIPTIONBEGIN####
44 # Author(s): Gary Thomas
45 # Original data: Gary Thomas
46 # Contributors: Bart Veer
49 #####DESCRIPTIONEND####
51 # ====================================================================
53 cdl_package CYGPKG_PROFILE_GPROF {
54 display "Runtime profile statistics"
55 requires CYGPKG_MEMALLOC
56 requires { CYGINT_PROFILE_HAL_TIMER != 0 }
58 # The profiling package itself must be built without -pg.
59 # Otherwise you can end up with infinite recursion in
61 requires { is_substr(CYGPKG_PROFILE_GPROF_CFLAGS_REMOVE, " -pg ") }
62 doc ref/services-profile-gprof.html
64 include_dir cyg/profile
68 This package enables runtime profiling of an application.
69 The actual profile collection must be turned on by the application,
70 once it has been initialized. The data collected on the target can
71 be extracted using either a gdb macro or tftp."
73 cdl_interface CYGINT_PROFILE_HAL_TIMER {
74 display "High resolution timer, implemented by platform"
76 Profiling requires access to a high resolution timer which
77 is platform dependent."
80 cdl_interface CYGINT_PROFILE_HAL_MCOUNT {
81 display "HAL supports call-graph profiling"
83 On some platforms the HAL may support an mcount() call. This
84 allows the profiling package to gather additional information,
85 used by gprof to determine a call graph."
88 cdl_component CYGPKG_PROFILE_CALLGRAPH {
89 display "Collect call-graph profiling data"
90 active_if CYGINT_PROFILE_HAL_MCOUNT
93 There are several different types of profiling information
94 that can be gathered. One type is used by gprof to determine
95 the application callgraph. This is not required but can be used
96 to gain additional insight in the application's behaviour,
97 at the cost of increased overheads in gathering the data. It
98 requires that application code be compiled with the -pg flag,
99 and it also requires HAL support that may not be available
102 cdl_option CYGNUM_PROFILE_CALLGRAPH_HASH_SHIFT {
103 display "Control size of call-graph hash table"
108 The call graph code uses a hash table to map program counter
109 addresses into an array index. The hash function is a simple
110 shift operation, so the size of the hash table depends on
111 the amount of code being profiled and the shift size. With
112 a default value of 8 the hash table needs one 32-bit integer
113 for every 256 bytes of code. Increasing the shift size reduces
114 memory requirements at the cost of extra run-time processing
115 to handle hash collisions."
118 cdl_option CYGNUM_PROFILE_CALLGRAPH_ARC_PERCENTAGE {
119 display "Control size of arc table"
122 legal_values 1 to 100
124 Determining the call graph requires keeping track of where
125 every function is called from, in an arc table. The size of
126 this table is calculated as a percentage of the amount of
127 code being profiled. The default value of 5% is appropriate
128 for typical applications."
132 cdl_component CYGPKG_PROFILE_TFTP {
133 display "Allow the profile data to be collected by tftp"
137 requires CYGPKG_NET_TFTP
139 There are two supported ways of transferring the profile data
140 from the target to the host. The first is to use a gdb macro
141 inside a gdb session, dumping the data directly from memory
142 to a file gmon.out. Usually this is the most convenient
143 approach. However it does require a gdb session and it can
144 be slow when debugging over e.g. a serial line. Alternatively
145 the profile package can provide a tftp daemon, allowing other
146 machines to retrieve the data over ethernet."
148 cdl_option CYGNUM_PROFILE_TFTP_PORT {
149 display "Port used by TFTP server for profile data"
153 By default the profiling package will create a tftp daemon
154 that listens on port 69, the standard port for this service.
155 If there are other packages that start a tftp daemon, or
156 if application code wants to provide this service, then
157 there is a conflict: each daemon requires a unique port.
158 This configuration option can be used to change the port
159 used by the profiling tftp daemon."
163 cdl_component CYGPKG_PROFILE_GPROF_OPTIONS {
164 display "Profiling build options"
167 Package specific build options including control over
168 compiler flags used only in building this package,
169 and details of which tests are built."
172 cdl_option CYGPKG_PROFILE_GPROF_CFLAGS_ADD {
173 display "Additional compiler flags"
178 This option modifies the set of compiler flags for
179 building this package. These flags are used in addition
180 to the set of global flags."
183 cdl_option CYGPKG_PROFILE_GPROF_CFLAGS_REMOVE {
184 display "Suppressed compiler flags"
187 default_value { "-pg" }
189 This option modifies the set of compiler flags for
190 building this package. These flags are removed from
191 the set of global flags if present."