Firefox OS/Performance/Profiling: Difference between revisions
< Firefox OS | Performance
Jump to navigation
Jump to search
(→Profiling with perf(1): Update for the miniperf→profiling merge.) |
m (Lakrits moved page FirefoxOS/Performance/Profiling to Firefox OS/Performance/Profiling: The official spelling of "Firefox OS" leaves a space between the two parts of the name. It's easier to find a page if the spelling of its name is consistent...) |
||
(12 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
= Profiling with the gecko profiler = | = Profiling with the gecko profiler = | ||
Good at: Native stacks (with runtime options) + javascript profiling, low overhead sampling, familiar for gecko developers | |||
See [https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler#Profiling_Boot_to_Gecko_%28with_a_real_device%29 these instructions]. Patches are in-flight to get native stacks in profiles, but that's not in default configurations yet. | See [https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler#Profiling_Boot_to_Gecko_%28with_a_real_device%29 these instructions]. Patches are in-flight to get native stacks in profiles, but that's not in default configurations yet. | ||
= Profiling with | = Profiling with systrace = | ||
Good at: Shows process preemption, shows all calls to instrumented functions, Familiar for android developers | |||
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. |
Latest revision as of 13:59, 1 February 2015
Profiling with the gecko profiler
Good at: Native stacks (with runtime options) + javascript profiling, low overhead sampling, familiar for gecko developers
See these instructions. Patches are in-flight to get native stacks in profiles, but that's not in default configurations yet.
Profiling with systrace
Good at: Shows process preemption, shows all calls to instrumented functions, Familiar for android developers
Bad at: Requires configure option, higher overhead
- Download android sdk to get systrace tool:
- 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:
#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
- How to use systrace:
- 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.