How to analyze the performance of C/C++ and debugging OpenGL ES frames on ARM and x86 Android devices

When growing an Android* software, you normally want to check, optimize, and debug on many various platforms. Whereas principally each {hardware} and chip producer supplies a set of customized instruments for this, builders can discover it cumbersome to put in and discover ways to use all of them.

Since their newest releases (2014 R2 as of now), Intel® Graphics Efficiency Analyzers (Intel® GPA), Intel® Body Debugger, and Intel® VTune™  Amplifier are capable of assist most mainstream Android 4.x gadgets, no matter their structure (ARM* or x86).

We now have examined these Intel instruments and efficiently used them on the ARM Android gadgets listed right here, however principally any Android 4.x machine might be appropriate.

Abstract:

Getting a high-level view of how your app is performing utilizing Intel® GPA System Analyzer.

Intel GPA System Analyzer can run on: Home windows* 7/8.x, Mac* OS X*, and Linux* and can be utilized to investigate apps operating on virtually any Android 4.x machine related over ADB.

It is a free instrument, a part of the Intel GPA suite you may get from this devoted web page or INDE.

In case your machine is rooted, this instrument can analyze any software put in on the machine. In any other case, it will probably solely analyze apps with Web permission and the debuggable flag set to true.

Setting the debuggable flag to true within the AndroidManifest is finished mechanically while you’re doing a debug construct with gradle or ant / Android Studio or Eclipse*. However in terms of analyzing the actual efficiency of an software, you need to run a model that has been optimized for launch!

You possibly can manually set this flag to true in your manifest, however lint will complain about it and trigger your construct to abort. You possibly can simply overcome that.

In Eclipse: disable “HardcodedDebugMode” in Lint Error checking inside Android Preferences. In Android Studio: set inside your construct.gradle






01 android {
02 lintOptions {
03 disable ‘HardcodedDebugMode’
04 }
05 }

Now, when operating Intel GPA System Analyzer, you first get a listing of functions operating on the machine you have chosen:

Deciding on one will set off its launch on the machine, together with its real-time evaluation:

From there, you’ll be able to drag&drop any metric from the left aspect to see its worth evolve in actual time.

It’s possible you’ll not get hardware-specific metrics on each machine as their assist varies, however you may have at the least: Goal App CPU Load, RAM utilization, Machine and Community IOs, OpenGL* metrics (draw calls, vertex depend, body time).

Along with these real-time values, you may have the flexibility to set off “state overrides” from the underside left of the window. This can enable you to decide the present bottleneck in your software:

 



Regular scene:

with all of the textures set to a easy 2×2 one:

with disabled alpha-blending:

displaying wireframe:

 

It’s also possible to disable all of the Draw calls. Then no graphics might be rendered, but when the FPS improves, the bottleneck is not on the OpenGL* aspect.

A extra in-depth article on Intel GPA together with a pattern code is offered right here: https://software program.intel.com/en-us/android/articles/using-the-intel-gpa-system-analyzer-to-improve-android-apps

Debugging an OpenGL rendered view utilizing Intel® Body Debugger

Intel Body Debugger is used to seize and totally debug OpenGL frames. It is as soon as once more a free instrument you may get from this devoted web page or INDE and totally works on most Android gadgets.

As of now, it may be run on Home windows 7/8.x platforms solely.

First add a body from a tool by clicking “Add”:

This can present you a listing of functions that you could be, or could not, have the suitable to investigate. Similar to beforehand with Intel GPA System Analyzer, chances are you’ll analyze any software on a rooted machine. In any other case, solely those with Web permission and the debuggable flags set to true:

Double-click to launch one and click on on “capture” to get a body. As soon as it is completed, return to the earlier view and choose the captured body:

You possibly can see all of the draw calls which have been made on the left aspect and the related simulated OpenGL ES framebuffer on the suitable aspect.

A double click on on one among these draw calls will help you examine all steps of the OpenGL ES pipeline related to the draw name, amongst these:

The primitives and the related Vertex Buffer Objects

The vertex and fragment shaders

You possibly can see and modify these shaders and even modify the values they’re receiving. This can modify the simulated body in addition to the rendered body in your machine if it is nonetheless related!

Analyzing the efficiency of C/C++ code from Android functions utilizing Intel® VTune™ Amplifier

Intel VTune Amplifier is a part of Intel® System Studio suite. Opposite to the earlier instruments, this suite is not free until it is for non-commercial software program improvement. As of now, this instrument will be run from Home windows and Linux hosts.

To start with VTune Amplifier, create a brand new challenge:

In its properties, select your machine and “Launch Android Package” as kind, then you’ll be able to enter your package deal identify or click on on “browse” to search for it:

As soon as that is completed, you’ll be able to launch a “basic hotspot” evaluation. Beginning the evaluation will launch the app in your machine:

Click on on Cease to cease the gathering (and mechanically shut the appliance).

The hint might be collected and displayed:

From there you’ll be able to, for instance, begin wanting on the outcomes with the “Bottom-up” view and group information by Module / Operate / Name Stack:

To affiliate full library symbols and sources to your outcomes, you’ll be able to add their paths to your challenge properties (normally ./obj/native/ABI/ for the non-stripped libs and ./jni for the sources).

Extra info on efficiency evaluation utilizing VTune will be discovered right here: https://software program.intel.com/en-us/node/471808

On supported x86 Android Gadgets (Intel® reference designs and Dell Venue* Eight with developer picture), VTune Amplifier can be utilized to investigate Java* workloads, get CPU and GPU metrics, and do energy evaluation!

For extra such Android assets and instruments from Intel, please go to the Intel® Developer Zone

Supply: https://software program.intel.com/en-us/android/articles/services-to-test-your-android-apps-on-intel-devices

Leave a Reply

Login.

To Comment.

Login to follow creators & categories, to create posts, to comment on posts.

Log In

Forgot password?

Don't have an account? Register

Forgot password?

Enter your account data and we will send you a link to reset your password.

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

To use social login you have to agree with the storage and handling of your data by this website. %privacy_policy%

Add to Collection

No Collections

Here you'll find all collections you've created before.