summaryrefslogtreecommitdiffstats
path: root/documentation/poky-ref-manual/development.xml
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-10-15 15:14:06 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-27 07:50:33 +0100
commit4999f788740b5cb2c4490c86e44ab5eac7b3dfe0 (patch)
treefd578c3315dcc30a0389ef55b3261491bbeb45e0 /documentation/poky-ref-manual/development.xml
parent00e061b56455e8bc6ab937a8114386f921f53fa5 (diff)
downloadpoky-4999f788740b5cb2c4490c86e44ab5eac7b3dfe0.tar.gz
documentation/pokt-ref-manual: Update with Yocto branding
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'documentation/poky-ref-manual/development.xml')
-rw-r--r--documentation/poky-ref-manual/development.xml410
1 files changed, 241 insertions, 169 deletions
diff --git a/documentation/poky-ref-manual/development.xml b/documentation/poky-ref-manual/development.xml
index 921943c155..60fb984e44 100644
--- a/documentation/poky-ref-manual/development.xml
+++ b/documentation/poky-ref-manual/development.xml
@@ -41,181 +41,253 @@
41 </para> 41 </para>
42 </section> 42 </section>
43 43
44 <section id="platdev-appdev-external-anjuta"> 44 <section id="using-the-eclipse-and-anjuta-plug-ins">
45 <title>Developing externally using the Anjuta plugin</title> 45 <title>Using the Eclipse and Anjuta Plug-ins</title>
46
47 <para>
48 An Anjuta IDE plugin exists to make developing software within the Poky framework
49 easier for the application developer. It presents a graphical IDE from which the
50 developer can cross compile an application then deploy and execute the output in a QEMU
51 emulation session. It also supports cross debugging and profiling.
52 </para>
53<!-- DISBALED, TOO BIG!
54 <screenshot>
55 <mediaobject>
56 <imageobject>
57 <imagedata fileref="screenshots/ss-anjuta-poky-1.png" format="PNG"/>
58 </imageobject>
59 <caption>
60 <para>The Anjuta Poky SDK plugin showing an active QEMU session running Sato</para>
61 </caption>
62 </mediaobject>
63 </screenshot>
64-->
65 <para>
66 To use the plugin, a toolchain and SDK built by Poky is required along with Anjuta it's development
67 headers and the Anjuta plugin. The Poky Anjuta plugin is available to download as a tarball at the
68 <ulink url='http://labs.o-hand.com/anjuta-poky-sdk-plugin/'>OpenedHand labs</ulink> page or
69 directly from the Poky Git repository located at git://git.pokylinux.org/anjuta-poky; a web interface
70 to the repository can be accessed at <ulink url='http://git.pokylinux.org/?p=anjuta-poky.git;a=summary'/>.
71 </para>
72 <para> 46 <para>
73 See the README file contained in the project for more information on dependencies and building 47 Yocto Project supports both Anjuta and Eclipse IDE plug-ins to make developing software
74 the plugin. If you want to disable remote gdb debugging, please pass --diable-gdb-integration 48 easier for the application developer. The plug-ins provide capability
75 switch when doing configure. 49 extensions to the graphical IDE allowing for cross compilation,
50 deployment and execution of the output in a QEMU emulation session.
51 Support of these plug-ins also supports cross debugging and
52 profiling. Additionally, the Eclipse plug-in provides a suite of tools
53 that allows the developer to perform remote profiling, tracing, collection of
54 power data, collection of latency data and collection of performance data.
76 </para> 55 </para>
77 56
78 <section id="platdev-appdev-external-anjuta-setup"> 57 <section id="the-eclipse-plug-in">
79 <title>Setting up the Anjuta plugin</title> 58 <title>The Eclipse Plug-in</title>
80 59 <para>
81 <para>Extract the tarball for the toolchain into / as root. The 60 To use the Eclipse plug-in, a toolchain and SDK built by Poky is required along with
82 toolchain will be installed into 61 the Eclipse Framework (Helios 3.6).
83 <filename class="directory">/opt/poky</filename>.</para> 62 To install the plug-in you need to be in the Eclipse IDE and select
84 63 the following menu:
85 <para>To use the plugin, first open or create an existing 64 <literallayout class='monospaced'>
86 project. If creating a new project the "C GTK+" project type 65 Help -> Install New Software
87 will allow itself to be cross-compiled. However you should be 66 </literallayout>
88 aware that this uses glade for the UI.</para> 67 Specify the target URL as http://yocto./download (real link needed).
89 68 </para>
90 <para>To activate the plugin go to 69 <para>
91 <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>, 70 If you want to download the source code for the plug-in you can find it in the Poky
92 then choose <guilabel>General</guilabel> from the left hand side. Choose the 71 git repository, which has a web interface, and is located at
93 Installed plugins tab, scroll down to <guilabel>Poky 72 <ulink url="http://git.pokylinux.org/cgit.cgi/eclipse-poky"></ulink>.
94 SDK</guilabel> and check the 73 </para>
95 box. The plugin is now activated but first it must be 74
96 configured.</para> 75 <section id="installing-and-setting-up-the-eclipse-ide">
97 </section> 76 <title>Installing and Setting up the Eclipse IDE</title>
98 77 <para>
99 <section id="platdev-appdev-external-anjuta-configuration"> 78 If you don't have the Eclipse IDE (Helios 3.6) on your system you need to
100 <title>Configuring the Anjuta plugin</title> 79 download and install it from <ulink url="http://www.eclipse.org/downloads"></ulink>.
101 80 Choose the Eclipse Classic, which contains the Eclipse Platform, Java Development
102 <para>The configuration options for the SDK can be found by choosing 81 Tools (JDT), and the Plug-in Development Environment.
103 the <guilabel>Poky SDK</guilabel> icon from the left hand side. The following options 82 </para>
104 need to be set:</para> 83 <para>
105 84 NOTE: Due to the Java Virtual Machine's garbage collection (GC) process the
106 <itemizedlist> 85 permanent generation space (PermGen) is not cleaned up. This space is used
107 86 to store meta-data descriptions of classes. The default value is set too small
108 <listitem><para><guilabel>SDK root</guilabel>: If we use external toolchain, we need to set SDK root. 87 and it could trigger an out of memory error like the following:
109 this is the root directory of the SDK's sysroot. For an i586 SDK this will be <filename 88 <literallayout class='monospaced'>
110 class="directory">/opt/poky/</filename>. 89 Java.lang.OutOfMemoryError: PermGen space
111 This directory will contain directories named like "bin", 90 </literallayout>
112 "include", "var", etc. under your selected target architecture subdirectory<filename class="directory"> 91 This error causes the applications to hang.
113 /opt/poky/sysroot/i586-poky-linux/</filename>. Needed cross compile tools are under 92 </para>
114 <filename class ="directory">/opt/poky/sysroot/i586-pokysdk-linux/</filename> 93 <para>
115 </para></listitem> 94 To fix this issue you can use the <command>-vmargs</command>
116 95 option when you start Eclipse to increase the size of the permenant generation space:
117 <listitem><para><guilabel>Poky root</guilabel>: If we have local poky build tree, we need to set the Poky root. 96 <literallayout class='monospaced'>
118 this is the root directory of the poky build tree, if you build your i586 target architecture 97 Eclipse -vmargs -XX:PermSize=256M
119 under the subdirectory of build_x86 within your poky tree, the Poky root directory should be 98 </literallayout>
120 <filename class="directory">${Poky_tree}/build_x86/</filename>. 99 </para>
121 </para></listitem> 100 <para>
122 101 The Eclipse plug-in depends several Eclipse projects plug-ins:
123 <listitem><para><guilabel>Target Architecture</guilabel>: this is the cross compile 102 Eclipse C/C++ Development Tools (CDT), Autotools support for CDT (Incubation) and Target
124 triplet, e.g. "i586-poky-linux". This target triplet is the prefix extracted from 103 Management (RSE).
125 the set up script file name. For examle, "i586-poky-linux" is extracted from set up script file 104 </para>
126 <filename>/opt/poky/environment-setup-i586-poky-linux</filename> 105 <para>
127 </para></listitem> 106 After installing Eclipse and bringing up the IDE for the first
128 107 time you need to be sure the following four sites are available by adding them.
129 <listitem><para><guilabel>Kernel</guilabel>: use the file chooser to select the kernel 108 </para>
130 to use with QEMU</para></listitem> 109 <itemizedlist>
131 110 <listitem>CDT - http://download.eclipse.org/tools/cdt/releases/helios</listitem>
132 <listitem><para><guilabel>Root filesystem</guilabel>: use the file chooser to select 111 <listitem>Helios - http://download.eclipse.org/releases/helios</listitem>
133 the root filesystem directory, this is the directory where you use "poky-extract-sdk" command to 112 <listitem>Target Management
134 extract the poky-image-sdk tarball.</para></listitem> 113 3.2 Updates - http://download.eclipse.org/dsdp/tm/updates/3.2</listitem>
135 </itemizedlist> 114 <listitem>The Eclipse Project Updates -
136<!-- DISBALED, TOO BIG! 115 http://download.eclipse.org/eclipse/updates/3.6</listitem>
137 <screenshot> 116 </itemizedlist>
138 <mediaobject> 117 <para>
139 <imageobject> 118 Once these sites are available do the following:
140 <imagedata fileref="screenshots/ss-anjuta-poky-2.png" format="PNG"/> 119 <itemizedlist>
141 </imageobject> 120 <listitem>Use the "Work with:" drop down list and
142 <caption> 121 select "All Available Sites--"</listitem>
143 <para>Anjuta Preferences Dialog</para> 122 <listitem><emphasis>For CDT and Autotools support:</emphasis> Expand the
144 </caption> 123 "Programming Languages" list and select "Autotools support for CDT
145 </mediaobject> 124 (Incubation)" and "C/C++ Development Tools". Click "Next" and complete
146 </screenshot> 125 the update.</listitem>
147--> 126 <listitem><emphasis>For RSE support:</emphasis> Select "TM and
127 RSE Main Features". Click "Next" and complete the update.</listitem>
128 </itemizedlist>
129 </para>
130 </section>
148 131
132 <section id="installing-the-yocto-plug-in">
133 <title>Installing the Yocto Plug-in</title>
134 <para>
135 Once you have the Eclipse IDE installed and configure you need to install the
136 Yocto plug-in. You do this similar to installing the Eclipse plug-ins in the
137 previous section.
138 </para>
139 <para>
140 Do the following to install the Yocto plug-in into the Eclipse IDE:
141 <itemizedlist>
142 <listitem>Select the "Help -> Install New Software" item.</listitem>
143 <listitem>In the "Work with:" area click "Add..." and enter the URL for
144 the Yocto plug-in (we need to supply this URL).</listitem>
145 <listitem>Finish out the installation of the update similar to any other
146 Eclipse plug-in.</listitem>
147 </itemizedlist>
148 </para>
149 </section>
150
151 <section id="configuring-yocto-eclipse-plug-in">
152 <title>Configuring Yocto Eclipse plug-in</title>
153 <para>
154 To configure the Yocto Eclipse plug-in you need to select the mode and then the
155 architecture with which you will be working. Start by selecting "Preferences"
156 from the "Window" menu and then selecting "Yocto SDK".
157 </para>
158 <para>
159 If you normally will use an installed Yocto
160 SDK (under /opt/poky) select “SDK Root Mode”. Otherwise, if your crosstool chain
161 and sysroot are within your poky tree, select “Poky Tree Mode”.
162 If you are in SDK Root Mode you will need to provide your poky tree path, for
163 example, $&lt;Poky_tree&gt;/build/.
164 </para>
165 <para>
166 Now you need to select the architecture.
167 Use the drop down list and select the architecture that you’ll be primarily
168 working against.
169 For target option, select your typical target QEMU vs External HW. If you
170 choose QEMU, you’ll need to specify your QEMU kernel file with full path and the
171 rootfs mount point. Yocto QEMU boots off user mode NFS, Please refer to QEMU
172 section for how to set it up. (Section TBD)
173 </para>
174 <para>
175 Save all your settings and they become your defaults for every new Yocto project
176 created using the Eclipse IDE.
177 </para>
178 </section>
179
180 <section id="using-the-yocto-eclipse-plug-in">
181 <title>Using the Yocto Eclipse Plug-in</title>
182 <para>
183 As an example, this section shows you how to cross-compile a Yocto C autotools
184 based project, deploy it into QEMU, and then run the debugger against it.
185 You need to configure the project, trigger <command> autogen.sh</command>, build
186 the image, start QEMU, and then debug.
187 </para>
188 <orderedlist>
189 <listitem>Creating a Yocto Autotools Based Project Using a Template:
190 Get to the Wizard selection by selecting the File -> New -> Project
191 menu. Expand "C/C++" and select "C Project". Click "Next" and select a template
192 to start with, for example "Hello World ANSI C Project". Complete the steps
193 to create a new Yocto autotools based project using this template.</listitem>
194 <listitem>Specify Specific Toolchain Configurations: By default the project
195 uses the Yocto preferences settings as defined using the procedure in
196 <link linkend="configuring-yocto-eclipse-plug-in"> the previous section</link>.
197 If there are any specific setup requirements for the newly created project
198 you need to reconfigure the Yocto plug-in through the menu selection
199 Project -> Invoke Yocto Tools -> Reconfigure Yocto. Use this dialogue
200 to specify specific toolchain and QEMU setups for the project.</listitem>
201 <listitem>Building the Project: Trigger <command>autogen.sh</command> through
202 Project -> Reconfigure Project. Then build the project using
203 Project -> Build.</listitem>
204 <listitem>Starting QEMU: Use the Run -> External Tools menu and see if there is
205 a QEMU instance for the desired target. If there is click on the instance
206 to start QEMU. If your target is not there then click "External Tools
207 Configuration". You should find an instance of QEMU for your architecture
208 under the entry under "Program". After the boot completes you are ready to
209 deploy the image into QEMU.</listitem>
210 <listitem>Debugging: To bring up your remote debugging configuration in the
211 right-hand window highlight your project in “Project Explorer”, select
212 the Run -> Debug Configurations menu item and expand “C/C++ Remote Application”.
213 Next, select projectname_ gdb_target-poky-linux.
214 You need to be sure that there is an
215 entry for the remote target you want to deploy and cross debug with. If there
216 is no entry then click "New..." to bring up the wizard. Using the wizard
217 select TCF and enter the IP address of you remote target in the
218 “Host name:” field. Back in the remote debug configure window,
219 you need to specify the absolute path for the program on the remote target
220 in the “Remote Absolute File Path for C/C++ Application” field. By default,
221 the program deploys into the remote target. If you don't want this then check
222 “Skip download to target path”. Finally, click "Debug” to start the remote
223 debugging session.</listitem>
224 </orderedlist>
225 </section>
226
227 <section id="using-yocto-eclipse-plug-in-remote-tools-suite">
228 <title>Using Yocto Eclipse plug-in Remote Tools Suite</title>
229 <para>
230 Remote tools let you do things like perform system profiling, kernel tracing,
231 examine power consumption, and so forth. To see and access the remote tools use the
232 Window -> YoctoTools menu.
233 </para>
234 <para>
235 Once you pick a tool you need to configure it for the remote target. Every tool
236 needs to have the connection configured. You have to select an existing TCF-based
237 RSE connection to the remote target. If one does not exist you need to create one
238 by clicking "New"
239 </para>
240 <para>
241 Here are some specifics about the remote tools:
242 <itemizedlist>
243 <listitem>Oprofile: Selecting this tool causes the oprofile-server on the remote
244 target to launch on the local host machine. To use the oprofile the oprofile-viewer
245 must be installed on the local host machine and the oprofile-server must be
246 installed on the remote target.</listitem>
247 <listitem>lttng: Selecting this tool runs ustrace on the remote target, transfers
248 the output data back to the local host machine and uses lttv-gui to graphically
249 display the output. To use this tool the lttv-gui must be installed on the
250 local host machine. See <ulink url="http://lttng.org/files/ust/manual/ust.html">
251 </ulink> for information on how to use <command>lttng</command> to trace an
252 application.
253 <para>
254 For "Application" you must supply the absolute path name to the application to
255 be traced by user mode lttng. For example, typing <command>/path/to/foo"
256 </command> triggers <command>usttrace /path/to/foo</command> on the
257 remote target to trace the program <command>/path/to/foo</command>.
258 </para>
259 <para>
260 "Argument" is passed to "usttrace" running on the remote target.
261 </para>
262 </listitem>
263 <listitem>powertop: Selecting this tool runs <command>powertop</command> on the
264 remote target machine and displays the result in a new view called "powertop".
265 <para>
266 "Time to gather data(sec):" is the time passed in seconds before data is
267 gathered from the remote target for analysis.
268 </para>
269 <para>
270 "show pids in wakeups list:" corresponds to the <command>-p</command>
271 argument passed to <command>powertop</command>
272 </para>
273 </listitem>
274 <listitem>latencytop and perf: The <command>latencytop</command> identifies
275 system latency, while <command>perf</command> monitors the system's performance
276 counter registers. Selecting either of these tools causes an RSE
277 terminal view to appear in which you can run the tools. Both tools refresh the
278 entire screen to display results while they run.</listitem>
279 </itemizedlist>
280 </para>
281 </section>
149 </section> 282 </section>
150 283
151 <section id="platdev-appdev-external-anjuta-usage"> 284 <section id="external-development-using-the-anjuta-plug-in">
152 <title>Using the Anjuta plugin</title> 285 <title>External Development Using the Anjuta Plug-in</title>
153 286 <para>
154 <para>As an example, cross-compiling a project, deploying it into 287 (Note: We will stop Anjuta plug-in support after Yocto project 0.9 release. Its source
155 QEMU and running a debugger against it and then doing a system 288 code can be downloaded from git respository listed below, and free for the community to
156 wide profile.</para> 289 continue supporting it moving forward.)
157 290 </para>
158 <para>Choose <menuchoice><guimenu>Build</guimenu><guimenuitem>Run
159 Configure</guimenuitem></menuchoice> or
160 <menuchoice><guimenu>Build</guimenu><guimenuitem>Run
161 Autogenerate</guimenuitem></menuchoice> to run "configure"
162 (or to run "autogen") for the project. This passes command line
163 arguments to instruct it to cross-compile.</para>
164
165 <para>Next do
166 <menuchoice><guimenu>Build</guimenu><guimenuitem>Build
167 Project</guimenuitem></menuchoice> to build and compile the
168 project. If you have previously built the project in the same
169 tree without using the cross-compiler you may find that your
170 project fails to link. Simply do
171 <menuchoice><guimenu>Build</guimenu><guimenuitem>Clean
172 Project</guimenuitem></menuchoice> to remove the old
173 binaries. You may then try building again.</para>
174
175 <para>Next start QEMU by using
176 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Start
177 QEMU</guimenuitem></menuchoice>, this will start QEMU and
178 will show any error messages in the message view. Once Poky has
179 fully booted within QEMU you may now deploy into it.</para>
180
181 <para>Once built and QEMU is running, choose
182 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Deploy</guimenuitem></menuchoice>,
183 this will install the package into a temporary directory and
184 then copy using rsync over SSH into the target. Progress and
185 messages will be shown in the message view.</para>
186
187 <para>To debug a program installed into onto the target choose
188 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Debug
189 remote</guimenuitem></menuchoice>. This prompts for the
190 local binary to debug and also the command line to run on the
191 target. The command line to run should include the full path to
192 the to binary installed in the target. This will start a
193 gdbserver over SSH on the target and also an instance of a
194 cross-gdb in a local terminal. This will be preloaded to connect
195 to the server and use the <guilabel>SDK root</guilabel> to find
196 symbols. This gdb will connect to the target and load in
197 various libraries and the target program. You should setup any
198 breakpoints or watchpoints now since you might not be able to
199 interrupt the execution later. You may stop
200 the debugger on the target using
201 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Stop
202 debugger</guimenuitem></menuchoice>.</para>
203
204 <para>It is also possible to execute a command in the target over
205 SSH, the appropriate environment will be be set for the
206 execution. Choose
207 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Run
208 remote</guimenuitem></menuchoice> to do this. This will open
209 a terminal with the SSH command inside.</para>
210
211 <para>To do a system wide profile against the system running in
212 QEMU choose
213 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Profile
214 remote</guimenuitem></menuchoice>. This will start up
215 OProfileUI with the appropriate parameters to connect to the
216 server running inside QEMU and will also supply the path to the
217 debug information necessary to get a useful profile.</para>
218
219 </section> 291 </section>
220 </section> 292 </section>
221 293