Android Development: a System Perspective Javier Orensanz 1
ARM - Linux and Communities Linux kernel GNU Tools 2
Linaro Partner Initiative Mission: Make open source development easier by delivering a common software foundation, across multiple distributions and vertical segments, deployed by the industry's leading OEM, MNO and Semiconductor companies Collaborate on common and undifferentiating parts of OSS components Include support for latest ARM CPU and features Validate upstream contributions Improved Tools support Reduced fragmentation 3
ARM Open Source Tools Engagement with the developer community for GNU tools GNU core tools (GCC, GAS, GLD, binutils, eglibc) Thumb -2 support for improved performance and code size Cortex -A8 and Cortex-A9 performance tuning Sponsoring CodeSourcery releases Pre-built, pre-packaged GCC binaries Adding Linux profiling Oprofile LTTng, ftrace, perf-events Promote Linux ABI for the ARM architecture Ensures GCC and RVCT interworking Enable Debuggers and performance analyzers to work with any compilation tools 4
Smartphones Towards a Smarter World Annual sales up 24% in 2009 to 172.4 million units 14% of total sales in 2009, growing to 38% by 2013 Half of all mobile phones in North America by 2012 Sources: Gartner 2009 and 2010 5
Android on Smartphones (and Beyond) 20% of US smartphone subscribers Aug 10 (comscore) 34% of total smartphone sales in the US in Q2 10 (Canalys) Android, Symbian, Maemo and other Linux variants will account for over 62% of mobile devices by 2012 (Gartner 09) TV MID Tablet 6
Android is Made for ARM Android was developed and shipped on ARM Android is optimized for ARM 1,200 files of assembler code. 20,000 or 28% of Bionic libraries are ARM assembler 6,300 C & 4,900 C++ files many with ARM optimizations Google, ARM and other OHA Partners deliver more ARM optimizations with each Android release 7
ARM Growing the Android Ecosystem Technology Investment Processor Architecture for 21 st Century Web-centric computing Tools to get the best from processor architecture Optimization of open technologies and software Readily available tools and hardware reference designs ARM Solution Center for Android An Ecosystem nucleus that partners can orbit around Access the latest technology Collaborate Compete on a level playing field Deliver solutions Attain success! 8
ARM Solution Center for Android 70+ 9
Android Platform Android is a complex layered system Different programming languages and tools for different layers Java Native Managed code Rich UI Framework API Tight integration: System events UI Lower performance Native code Improved performance Code re-use Unsupported libraries (Very) Limited access to APIs 10
Android Development Eclipse provides a complete framework for Android software Android SDK plug-ins for Java applications DS-5 for C/C++ performance-critical native applications and libraries Java Native SDK+ADT DS-5 Nat Apps Debug JTAG Debug 11
Eclipse Framework Most Android development is done in Eclipse Code editing, debug, performance analysis with Android SDK/NDK Eclipse Integrated Development Environment (IDE) Eclipse is an open source environment for software development Works across host and target platforms and programming languages Widely used across 160+ companies, with 1100+ plug-ins on offer Eclipse increases the efficiency of development teams by integrating a diversity of tools into a single framework RTOS debuggers and profilers Software tools for ARM, DSPs and other processor architectures 12
Speeding Up on the Native Side Dalvik interpreter Native code 10-20x faster Dalvik JIT Compiler Native code ~2x faster Performance-critical code is written as C/C++ Investing resources in this area delivers highest benefit ARM DS-5 focuses on Linux and Android native development Keep an eye on performance! Native FIR in C: 884.18 ms Native FIR in C with NEON intrinsics: 310.31 ms (almost 3x faster) DS-5 Eclipse Compiler IDE Debugger Perf. Analyzer Device Configuration Database Simulation Hardware Debug 13
Efficient C/C++ Software Compilation The ARM Compiler is the reference compiler for the ARM architecture Earliest support for new processors and instruction sets Professionally supported and maintained Highly compatible with GNU Compiler Builds the ARM Debian distribution and most open source Linux packages Compiler Improvement over 5 yrs Higher performance NEON vectorization, Thumb -2 Smaller code size Better use of L1 and L2 caches 130% 120% 110% RVDS 100% 2.2 90% 80% Performance Codesize RVDS 3.1 RVDS 4.0 RVDS 4.1 14
Bring-up and Kernel Development Stop-mode debug is critical for board/platform bring-up Stop the processor after reset Configure the target with a debugger script Use debugger views to verify the system Single-step through the code ETM/PTM trace is available! Non-intrusive debug and profiling 15
Android Library Development Run-mode debug is best System and other applications always running Low cost Ethernet connection for debug DS-5 offers all the advantages of a professional debugger Automatically download and debug software Multi-thread application debug on Windows and Linux hosts Powerful debug views 16
Android Application Development Normally done with Android SDK (also run-mode debug) Android SDK is also integrated in Eclipse Same look and feel as DS-5 Simultaneous debug of applications and libraries using SDK + DS-5 Just click on a button to switch between SDK and DS-5 When a breakpoint is hit the switch is automatic Android SDK works! Very widely used (most Android developers write in Java) robust and powerful There is no benefit in using JTAG for Java development 17
Android Library Performance Analysis ARM Streamline covers performance analysis of the middleware layer Timeline analysis with annotation Profiling and call path reports Stack analysis Requires only a network (Eth, USB) connection to the target Streamline enables Analyse how your software runs on ARM targets Spot bottlenecks and code inefficiencies 18
Application Performance Analysis TraceView supports performance analysis at Java level Requires the code to be instrumented to signal start/stop Relies on instrumentation slows down application Can be used simultaneously with Streamline 19
Summary Android is very important to ARM success Accordingly, ARM is investing a lot in Android Android SDK is a widely used environment for Android Java application development ARM DS-5 provides a professional development environment for critical native code High-performance compiler Stop-mode and run-mode debugger Streamline performance analyzer See a DS-5 demo on session 42, track 3 at 3:20pm Also, on www.arm.com/ds5 20
Thank You Please visit www.arm.com for ARM related technical details For any queries contact < Salesinfo-IN@arm.com > 21