Firefox OS/Performance/Profiling: Difference between revisions

Jump to navigation Jump to search
Line 6: Line 6:


= Profiling with systrace =
= Profiling with systrace =
Good at: Shows process preemption, shows all calls to instrumented functions, Familiar for android developers
Good at: Shows process preemption, shows all calls to instrumented functions, Familiar for android developers


Bad at: Requires configure option, higher overhead
Bad at: Requires configure option, higher overhead


'''Better instructions coming:''' Build with '--enable-systrace' and follow [http://developer.android.com/tools/help/systrace.html these instructions for systrace.py].
*Download android sdk to get systrace tool:
**[http://developer.android.com/sdk/index.html 1. download link]
**2. the systrace.py tool is at path-to-android-sdk/tools/systrace
 
*Enable systrace in B2G:
**Build with '--enable-systrace' config or just uncomment the MOZ_USE_SYSTRACE define in gecko/tools/profiler/GeckoProfilerImpl.h like:
<pre>
#define MOZ_USE_SYSTRACE
#ifdef MOZ_USE_SYSTRACE
# define ATRACE_TAG ATRACE_TAG_ALWAYS
// We need HAVE_ANDROID_OS to be defined for Trace.h.
// If its not set we will set it temporary and remove it.
# ifndef HAVE_ANDROID_OS
#  define HAVE_ANDROID_OS
#  define REMOVE_HAVE_ANDROID_OS
# endif
</pre>


Note: Gecko code is tagged as ATRACE_TAG_ALWAYS, so the command is for your reference.
*How to use systrace:
**[http://developer.android.com/tools/help/systrace.html systrace.py document]
**./systrace.py --time=10 -o mynewtrace.html sched


./systrace.py --time=10 -o mynewtrace.html sched
Note: Gecko code is tagged as ATRACE_TAG_ALWAYS, so we don't set the category type.
Confirmed users
346

edits

Navigation menu