This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Profiling
Eric Rahm edited this page Apr 29, 2015
·
2 revisions
- If you don't already have a local checkout of the B2G repo, go ahead and get one:
git clone https://github.com/mozilla-b2g/B2G.git
- Attach device, verify you can see it:
adb devices
- Get pid of app you want to profile:
adb shell b2g-ps
Note for startup profiling you want the pid of thePreallocated
process
Unfortunately I think this is necessary, it's definitely necessary for useful c++ stacks. I apologize now.
Full details: Building FxOS
wiki wiki details for a Flame:
- Do a full image flash of the release you want to test
- Make sure your device is plugged in
- Sync up, config, and build:
cd $B2G_ROOT
git pull
echo "MOZ_PROFILING=1" >> .userconfig
# If you want to build an existing release:
# BRANCH=v2.1 ./config.sh flame-kk
# -otherwise-
# if you want to build the latest and greatest:
./config.sh flame-kk
./build.sh gecko && ./build.sh gaia
./flash.sh gecko && ./flash.sh gaia
# This will grab up to 2,000,000 samples at 1 sample per ms.
# You can adjust as needed for longer durations.
$B2G_ROOT/profile.sh start -p <pid_of_preallocated> \
-t Compositor,GeckoMain -f js,leaf,stackwalk \
-e 2000000 -i 1
- Remove
stackwalk
if you don't care about C++ stacks -
Compositor
gives you various graphics related events
After performing the action you want to profile:
$B2G_ROOT/profile.sh capture
- Go to: https://people.mozilla.org/~bgirard/cleopatra/
- Load the file
profile_captured.sym
that was generated byprofile.sh