Profiling and Debugging Tools for
High-performance Android Applications
Stephen Jones, Product Line Manager, NVIDIA
(sjones@[Link])
Android By The Numbers
1.3M Android
activations per day
Android activations
predicted to double
in 2013
750M Android
devices worldwide
1.68B in Google
Play Revenue (2012)
Sources: Eric Schmidt, Andy Rubin, IHS iSuppli forecast
Android App Categories
Smartphones Tablets
Productivity
Entertainment News 1%
3% 2%
Other Utilities Other
Lifestyle 11% 4% 7%
3%
Health & Entertainment
Fitness 9%
3% Games
39%
Social
Utilities Networking
17% 10%
Games
67%
Social
Networking
24%
[Link]
Android Native Development Kit (NDK)
Native Code languages, such as C / C++
Not required
Java
— Implement your application using NativeActivity
Tools To generate and embed native code libraries
System Headers and libraries for managed resources
It is NOT a silver-bullet for performance issues
No Silver Bullet
— you can still shoot yourself in the foot
Not Standalone It does NOT replace the Android SDK
It is NOT meant for standard Android applications
Not 4 Standard
— image processing, physics, AR, facial recognition
It is NOT for alternative programming languages
No Alternative
— chicken, etc
Android Why use the Android NDK?
Android Developer Perceptions
User base
Development cost
Learning curve
Development environment
Documentation & support
Revenue Potential
Percent of developers that believe one platform is better than the other. Source: Developer Economic 2013 | [Link] | January 2013
Tegra Android Development Pack
GET STARTED in minutes NOT hours
INSTALLS all tools required for Tegra Android
CPU DEBUGGING with Nsight Tegra
GPU DEBUGGING with PerfHUD ES
OPTIMIZE applications with Tegra Profiler
REFERENCE docs, samples & tutorials
OPTIMIZED for Tegra Android development
FLASHES Tegra DevKit with OS Image
CONFIGURED for debugging and profiling
INCLUDES Kernel symbols and DS-5 support
[Link]
NVIDIA Confidential
Tegra Developer Tools
Native Android Development Tools
Nsight Tegra PerfHUD ES Tegra Profiler
Visual Studio and Eclipse integrations Examine and debug OpenGL ES frames Maximize multi-core CPU utilization
Full Android build management Automated bottleneck analysis Quickly identify CPU “hot spots”
Native Android CPU debugging Edit shaders at runtime Identify thread contention issues
Breakpoints in both Java and Native
NVIDIA Confidential
[Link]
“The most powerful solution for
Android game development”
“ …game
as much time as it took to get a console
engine to honour the Android
lifecycle, it would have taken twice that “ PerfHUD ES is by far my favourite thing about
Android development. It’s helped us make
without NVIDIA’s developer tools for
substantial improvements to the rendering
Android.
” -- TickTock Games
performance of our game.
-- Fireproof Studios ”
“…Ianother
expect in some parallel universe there’s
version of me building Android
games without NVIDIA’s Nsight Tegra
debugger, and he sure looks pissed off!
-- Strawdog Studios
”
Tegra Developer Tools
Nsight Tegra, Visual Studio Edition
Key Benefits
Visual Studio integrated Android development
INCREASED build and runtime performance
Multi-core native Tegra Android GDB DEBUGGING
Seamlessly debug Java and native C/C++ code
Manage and build Tegra Android applications
Familiar environment for Tegra Android development
Android specific features integrated into Visual
Studio (like LOGCAT)
[Link]
NVIDIA Confidential
Nsight Tegra, Visual Studio Edition
Set breakpoints in both Java and
Build native Android projects in Native (C/C++)
Visual Studio using vs-android,
ndk-build or makefiles.
Android GDB debugging in Visual
Studio
Use the familiar Visual Studio
Locals, Watches, Memory and
Breakpoints windows.
[Link]
NVIDIANVIDIA
Confidential
Confidential
Tegra Developer Tools
PerfHUD ES
Key Benefits
Examine OpenGL ES frames to reveal
rendering problems
Debug OpenGL ES API calls, parameters,
return values and errors
Execute directed tests to identify rendering
bottlenecks
Edit and apply shaders dynamically at
runtime
Monitor CPU and GPU utilization
[Link]
NVIDIA Confidential
PerfHUD ES for Android
OpenGL ES Graphics Debugging and Profiling
Performance Dashboard Frame Debugger Frame Profiler
Graph pertinent frame statistics in real-time See the current frame draw call by draw call “Bucket” draw calls that share common
render state
Directed tests help identify performance issues Scrub through all of the draw calls in a frame
Examine in-depth profiling data for each
Monitor memory usage and draw call efficiency Examine all aspects of the rendered frame, draw call in the frame
including API calls, errors, geometry,
textures, shaders and pipeline state Examine “buckets” and draw calls by cost
[Link]
NVIDIA Confidential
Tegra Developer Tools
Tegra Profiler (Windows only)
Key Benefits:
Maximize multi-core CPU utilization
Quickly find CPU hot spots and cache issues
Easily deploy applications for profiling
Visualize CPU thread state
Display OpenGL ES frame boundaries
Instrument source with custom annotations
[Link]
NVIDIANVIDIA
Confidential
Confidential
Tegra Profiler for Android
Capture multi-core CPU utilization,
L1/L2 cache counters
Visualize CPU utilization over time
Identify call chain “hot spots”
Visualize function cost over time
[Link]
NVIDIANVIDIA
Confidential
Confidential
Tegra Developer Tools Supported Devices
Nsight Tegra,
PerfHUD ES Tegra Profiler
Visual Studio Edition
ASUS Transformer
(TF201 / TF300T / TF700T)
HTC One X / One X+
ASUS Nexus 7
NVIDIA SHIELD
Ouya
NVIDIA Cardhu (DevKit)
NVIDIA Dalmore (DevKit)
NVIDIA Pluto (DevKit)
NVIDIA Confidential
Tegra Developer Tools System Requirements
Host Platform Device Device OS Requires Cost ($)
Tegra only Visual Studio 2010
Nsight Tegra,
Android 4.0+
Visual Studio Win7 (non-Tegra devices
(ICS) (Visual Studio Express
$0*
Edition supported on a limited
not supported)
basis)
Win7, OSX, Ubuntu Android 4.0+
PerfHUD ES Linux
Tegra only
(ICS)
--- $0*
Tegra DevKits
Android 4.0+
Tegra Profiler Win7
(Cardhu, Dalmore, (ICS)
--- $0*
Pluto, Shield)
All Android Devices
NVIDIA Debug Win7, OSX, Ubuntu Android 4.0+
Eclipse $0*
Manager (NVDM) Linux (QA limited on non- (ICS)
Tegra devices)
Tegra Android
Win7, OSX, Ubuntu
Development Pack Linux
Tegra only N/A --- $0*
(TADP)
*Requires Tegra Registered Developer Program Membership
NVIDIA Confidential
Tegra Developer Tools
What’s coming?
Nsight Tegra, Visual Studio Edition
Super-fast apk/file deployment and sync
Logcat filtering (ala Eclipse)
Visual Studio 2012
Windows 8 support
Tegra Profiler
Host support for OSX and Ubuntu Linux
NVIDIANVIDIA
Confidential
Confidential
Need Help?
The Tegra Registered Developer Program:
[Link]
Support Forums: [Link]
Support Email: devtools-support@[Link]
NVIDIA Confidential