Confirmed users
346
edits
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 | ||
*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> | |||
*How to use systrace: | |||
**[http://developer.android.com/tools/help/systrace.html systrace.py document] | |||
**./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. |