From 4999f788740b5cb2c4490c86e44ab5eac7b3dfe0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 15 Oct 2010 15:14:06 +0100 Subject: documentation/pokt-ref-manual: Update with Yocto branding Signed-off-by: Richard Purdie --- documentation/poky-ref-manual/development.xml | 410 +++++++++++++++----------- 1 file changed, 241 insertions(+), 169 deletions(-) (limited to 'documentation/poky-ref-manual/development.xml') diff --git a/documentation/poky-ref-manual/development.xml b/documentation/poky-ref-manual/development.xml index 921943c15..60fb984e4 100644 --- a/documentation/poky-ref-manual/development.xml +++ b/documentation/poky-ref-manual/development.xml @@ -41,181 +41,253 @@ -
- Developing externally using the Anjuta plugin - - - An Anjuta IDE plugin exists to make developing software within the Poky framework - easier for the application developer. It presents a graphical IDE from which the - developer can cross compile an application then deploy and execute the output in a QEMU - emulation session. It also supports cross debugging and profiling. - - - - To use the plugin, a toolchain and SDK built by Poky is required along with Anjuta it's development - headers and the Anjuta plugin. The Poky Anjuta plugin is available to download as a tarball at the - OpenedHand labs page or - directly from the Poky Git repository located at git://git.pokylinux.org/anjuta-poky; a web interface - to the repository can be accessed at . - +
+ Using the Eclipse and Anjuta Plug-ins - See the README file contained in the project for more information on dependencies and building - the plugin. If you want to disable remote gdb debugging, please pass --diable-gdb-integration - switch when doing configure. + Yocto Project supports both Anjuta and Eclipse IDE plug-ins to make developing software + easier for the application developer. The plug-ins provide capability + extensions to the graphical IDE allowing for cross compilation, + deployment and execution of the output in a QEMU emulation session. + Support of these plug-ins also supports cross debugging and + profiling. Additionally, the Eclipse plug-in provides a suite of tools + that allows the developer to perform remote profiling, tracing, collection of + power data, collection of latency data and collection of performance data. -
- Setting up the Anjuta plugin - - Extract the tarball for the toolchain into / as root. The - toolchain will be installed into - /opt/poky. - - To use the plugin, first open or create an existing - project. If creating a new project the "C GTK+" project type - will allow itself to be cross-compiled. However you should be - aware that this uses glade for the UI. - - To activate the plugin go to - EditPreferences, - then choose General from the left hand side. Choose the - Installed plugins tab, scroll down to Poky - SDK and check the - box. The plugin is now activated but first it must be - configured. -
- -
- Configuring the Anjuta plugin - - The configuration options for the SDK can be found by choosing - the Poky SDK icon from the left hand side. The following options - need to be set: - - - - SDK root: If we use external toolchain, we need to set SDK root. - this is the root directory of the SDK's sysroot. For an i586 SDK this will be /opt/poky/. - This directory will contain directories named like "bin", - "include", "var", etc. under your selected target architecture subdirectory - /opt/poky/sysroot/i586-poky-linux/. Needed cross compile tools are under - /opt/poky/sysroot/i586-pokysdk-linux/ - - - Poky root: If we have local poky build tree, we need to set the Poky root. - this is the root directory of the poky build tree, if you build your i586 target architecture - under the subdirectory of build_x86 within your poky tree, the Poky root directory should be - ${Poky_tree}/build_x86/. - - - Target Architecture: this is the cross compile - triplet, e.g. "i586-poky-linux". This target triplet is the prefix extracted from - the set up script file name. For examle, "i586-poky-linux" is extracted from set up script file - /opt/poky/environment-setup-i586-poky-linux - - - Kernel: use the file chooser to select the kernel - to use with QEMU - - Root filesystem: use the file chooser to select - the root filesystem directory, this is the directory where you use "poky-extract-sdk" command to - extract the poky-image-sdk tarball. - - +
+ The Eclipse Plug-in + + To use the Eclipse plug-in, a toolchain and SDK built by Poky is required along with + the Eclipse Framework (Helios 3.6). + To install the plug-in you need to be in the Eclipse IDE and select + the following menu: + + Help -> Install New Software + + Specify the target URL as http://yocto./download (real link needed). + + + If you want to download the source code for the plug-in you can find it in the Poky + git repository, which has a web interface, and is located at + . + + +
+ Installing and Setting up the Eclipse IDE + + If you don't have the Eclipse IDE (Helios 3.6) on your system you need to + download and install it from . + Choose the Eclipse Classic, which contains the Eclipse Platform, Java Development + Tools (JDT), and the Plug-in Development Environment. + + + NOTE: Due to the Java Virtual Machine's garbage collection (GC) process the + permanent generation space (PermGen) is not cleaned up. This space is used + to store meta-data descriptions of classes. The default value is set too small + and it could trigger an out of memory error like the following: + + Java.lang.OutOfMemoryError: PermGen space + + This error causes the applications to hang. + + + To fix this issue you can use the -vmargs + option when you start Eclipse to increase the size of the permenant generation space: + + Eclipse -vmargs -XX:PermSize=256M + + + + The Eclipse plug-in depends several Eclipse projects plug-ins: + Eclipse C/C++ Development Tools (CDT), Autotools support for CDT (Incubation) and Target + Management (RSE). + + + After installing Eclipse and bringing up the IDE for the first + time you need to be sure the following four sites are available by adding them. + + + CDT - http://download.eclipse.org/tools/cdt/releases/helios + Helios - http://download.eclipse.org/releases/helios + Target Management + 3.2 Updates - http://download.eclipse.org/dsdp/tm/updates/3.2 + The Eclipse Project Updates - + http://download.eclipse.org/eclipse/updates/3.6 + + + Once these sites are available do the following: + + Use the "Work with:" drop down list and + select "All Available Sites--" + For CDT and Autotools support: Expand the + "Programming Languages" list and select "Autotools support for CDT + (Incubation)" and "C/C++ Development Tools". Click "Next" and complete + the update. + For RSE support: Select "TM and + RSE Main Features". Click "Next" and complete the update. + + +
+
+ Installing the Yocto Plug-in + + Once you have the Eclipse IDE installed and configure you need to install the + Yocto plug-in. You do this similar to installing the Eclipse plug-ins in the + previous section. + + + Do the following to install the Yocto plug-in into the Eclipse IDE: + + Select the "Help -> Install New Software" item. + In the "Work with:" area click "Add..." and enter the URL for + the Yocto plug-in (we need to supply this URL). + Finish out the installation of the update similar to any other + Eclipse plug-in. + + +
+ +
+ Configuring Yocto Eclipse plug-in + + To configure the Yocto Eclipse plug-in you need to select the mode and then the + architecture with which you will be working. Start by selecting "Preferences" + from the "Window" menu and then selecting "Yocto SDK". + + + If you normally will use an installed Yocto + SDK (under /opt/poky) select “SDK Root Mode”. Otherwise, if your crosstool chain + and sysroot are within your poky tree, select “Poky Tree Mode”. + If you are in SDK Root Mode you will need to provide your poky tree path, for + example, $<Poky_tree>/build/. + + + Now you need to select the architecture. + Use the drop down list and select the architecture that you’ll be primarily + working against. + For target option, select your typical target QEMU vs External HW. If you + choose QEMU, you’ll need to specify your QEMU kernel file with full path and the + rootfs mount point. Yocto QEMU boots off user mode NFS, Please refer to QEMU + section for how to set it up. (Section TBD) + + + Save all your settings and they become your defaults for every new Yocto project + created using the Eclipse IDE. + +
+ +
+ Using the Yocto Eclipse Plug-in + + As an example, this section shows you how to cross-compile a Yocto C autotools + based project, deploy it into QEMU, and then run the debugger against it. + You need to configure the project, trigger autogen.sh, build + the image, start QEMU, and then debug. + + + Creating a Yocto Autotools Based Project Using a Template: + Get to the Wizard selection by selecting the File -> New -> Project + menu. Expand "C/C++" and select "C Project". Click "Next" and select a template + to start with, for example "Hello World ANSI C Project". Complete the steps + to create a new Yocto autotools based project using this template. + Specify Specific Toolchain Configurations: By default the project + uses the Yocto preferences settings as defined using the procedure in + the previous section. + If there are any specific setup requirements for the newly created project + you need to reconfigure the Yocto plug-in through the menu selection + Project -> Invoke Yocto Tools -> Reconfigure Yocto. Use this dialogue + to specify specific toolchain and QEMU setups for the project. + Building the Project: Trigger autogen.sh through + Project -> Reconfigure Project. Then build the project using + Project -> Build. + Starting QEMU: Use the Run -> External Tools menu and see if there is + a QEMU instance for the desired target. If there is click on the instance + to start QEMU. If your target is not there then click "External Tools + Configuration". You should find an instance of QEMU for your architecture + under the entry under "Program". After the boot completes you are ready to + deploy the image into QEMU. + Debugging: To bring up your remote debugging configuration in the + right-hand window highlight your project in “Project Explorer”, select + the Run -> Debug Configurations menu item and expand “C/C++ Remote Application”. + Next, select projectname_ gdb_target-poky-linux. + You need to be sure that there is an + entry for the remote target you want to deploy and cross debug with. If there + is no entry then click "New..." to bring up the wizard. Using the wizard + select TCF and enter the IP address of you remote target in the + “Host name:” field. Back in the remote debug configure window, + you need to specify the absolute path for the program on the remote target + in the “Remote Absolute File Path for C/C++ Application” field. By default, + the program deploys into the remote target. If you don't want this then check + “Skip download to target path”. Finally, click "Debug” to start the remote + debugging session. + +
+ +
+ Using Yocto Eclipse plug-in Remote Tools Suite + + Remote tools let you do things like perform system profiling, kernel tracing, + examine power consumption, and so forth. To see and access the remote tools use the + Window -> YoctoTools menu. + + + Once you pick a tool you need to configure it for the remote target. Every tool + needs to have the connection configured. You have to select an existing TCF-based + RSE connection to the remote target. If one does not exist you need to create one + by clicking "New" + + + Here are some specifics about the remote tools: + + Oprofile: Selecting this tool causes the oprofile-server on the remote + target to launch on the local host machine. To use the oprofile the oprofile-viewer + must be installed on the local host machine and the oprofile-server must be + installed on the remote target. + lttng: Selecting this tool runs ustrace on the remote target, transfers + the output data back to the local host machine and uses lttv-gui to graphically + display the output. To use this tool the lttv-gui must be installed on the + local host machine. See + for information on how to use lttng to trace an + application. + + For "Application" you must supply the absolute path name to the application to + be traced by user mode lttng. For example, typing /path/to/foo" + triggers usttrace /path/to/foo on the + remote target to trace the program /path/to/foo. + + + "Argument" is passed to "usttrace" running on the remote target. + + + powertop: Selecting this tool runs powertop on the + remote target machine and displays the result in a new view called "powertop". + + "Time to gather data(sec):" is the time passed in seconds before data is + gathered from the remote target for analysis. + + + "show pids in wakeups list:" corresponds to the -p + argument passed to powertop + + + latencytop and perf: The latencytop identifies + system latency, while perf monitors the system's performance + counter registers. Selecting either of these tools causes an RSE + terminal view to appear in which you can run the tools. Both tools refresh the + entire screen to display results while they run. + + +
-
- Using the Anjuta plugin - - As an example, cross-compiling a project, deploying it into - QEMU and running a debugger against it and then doing a system - wide profile. - - Choose BuildRun - Configure or - BuildRun - Autogenerate to run "configure" - (or to run "autogen") for the project. This passes command line - arguments to instruct it to cross-compile. - - Next do - BuildBuild - Project to build and compile the - project. If you have previously built the project in the same - tree without using the cross-compiler you may find that your - project fails to link. Simply do - BuildClean - Project to remove the old - binaries. You may then try building again. - - Next start QEMU by using - ToolsStart - QEMU, this will start QEMU and - will show any error messages in the message view. Once Poky has - fully booted within QEMU you may now deploy into it. - - Once built and QEMU is running, choose - ToolsDeploy, - this will install the package into a temporary directory and - then copy using rsync over SSH into the target. Progress and - messages will be shown in the message view. - - To debug a program installed into onto the target choose - ToolsDebug - remote. This prompts for the - local binary to debug and also the command line to run on the - target. The command line to run should include the full path to - the to binary installed in the target. This will start a - gdbserver over SSH on the target and also an instance of a - cross-gdb in a local terminal. This will be preloaded to connect - to the server and use the SDK root to find - symbols. This gdb will connect to the target and load in - various libraries and the target program. You should setup any - breakpoints or watchpoints now since you might not be able to - interrupt the execution later. You may stop - the debugger on the target using - ToolsStop - debugger. - - It is also possible to execute a command in the target over - SSH, the appropriate environment will be be set for the - execution. Choose - ToolsRun - remote to do this. This will open - a terminal with the SSH command inside. - - To do a system wide profile against the system running in - QEMU choose - ToolsProfile - remote. This will start up - OProfileUI with the appropriate parameters to connect to the - server running inside QEMU and will also supply the path to the - debug information necessary to get a useful profile. - +
+ External Development Using the Anjuta Plug-in + + (Note: We will stop Anjuta plug-in support after Yocto project 0.9 release. Its source + code can be downloaded from git respository listed below, and free for the community to + continue supporting it moving forward.) +
-- cgit v1.2.3