Closed Bug 1088683 Opened 10 years ago Closed 10 years ago

Unable to capture profile on B2G

Categories

(Core :: Gecko Profiler, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
2.1 S8 (7Nov)

People

(Reporter: gerard-majax, Assigned: wcosta)

References

Details

(Keywords: regression)

Attachments

(1 file)

STR:
 0. ./profile.sh start -p b2g -t Compositor,GeckoMain,Gecko_IOThread,GonkSensors,InputReader -i 1
 1. ./profile.sh capture

Expected:
 Profile captured:

Actual:
> Signaling Profiled Processes: 206
> Stabilizing 206 b2g ...
> Pulling /data/local/tmp/profile_0_206.txt into profile_206_b2g.txt
> Adding symbols to profile_206_b2g.txt and creating profile_206_b2g.sym ...
> Merging profile:  profile_206_b2g.sym
> ./gecko/tools/profiler/merge-profiles.py profile_206_b2g.sym
> Traceback (most recent call last):
>   File "./gecko/tools/profiler/merge-profiles.py", line 91, in <module>
>    MergeProfiles(sys.argv[1:])
>  File "./gecko/tools/profiler/merge-profiles.py", line 32, in MergeProfiles
>    fp = open(fname, "r")
> IOError: [Errno 2] No such file or directory: 'profile_206_b2g.sym'

That's on a fresh Gecko/Gaia build, git uptodate, Flame KK.

Results: profile_captured.sym
Removing old profile files (from device) ... done
Component: General → Gecko Profiler
Product: Firefox OS → Core
Any idea?
Flags: needinfo?(wcosta)
Flags: needinfo?(jld)
In profile.sh, there's a |> /dev/null| statement on the profiler-symbolicate.py script call.
This is hiding the real error:
> print "'TARGET_TOOLS_PREFIX' needs to be defined in the environment"

This comes from: https://github.com/mozilla-b2g/B2G/commit/ca3248ff

This is from your fix for bug 1022928.
Depends on: 1022928
Flags: needinfo?(wcosta)
Flags: needinfo?(jld)
TARGET_TOOLS_PREFIX=/home/alex/codaz/Mozilla/b2g/devices/Flame/B2G.KK/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi- ./profile.sh capture

Works. But it's far from being user friendly.
(In reply to Alexandre LISSY :gerard-majax from comment #2)
> In profile.sh, there's a |> /dev/null| statement on the
> profiler-symbolicate.py script call.
> This is hiding the real error:
> > print "'TARGET_TOOLS_PREFIX' needs to be defined in the environment"
> 
> This comes from: https://github.com/mozilla-b2g/B2G/commit/ca3248ff
> 
> This is from your fix for bug 1022928.

The /dev/null was already there, I just split the call in two lines. The error happened because when you don't have a local build, you have to pass the '-s' <symbols-path> option to "profile.sh capture". <symbols-path> must be either a local path to breakpad symbols or the URL of the symbolicate server, i.e., http://symbolapi.mozilla.org. This blog post [1] has more details on that. The wiki page [2] still lacks update.

[1] http://walac.github.io/profiling-firefox-os-apps/
[2] https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler
That's on a local build tree.
Assignee: nobody → wcosta
Attachment #8511330 - Flags: review?(dhylands)
Instead of renaming, can you make .var.profile set both GECKO_TOOLS_PREFIX and TARGET_TOOLS_PREFIX?
(In reply to Michael Wu [:mwu] from comment #7)
> Instead of renaming, can you make .var.profile set both GECKO_TOOLS_PREFIX
> and TARGET_TOOLS_PREFIX?

Of course, but in this case, wouldn't be better profile-symbolicate deal with both cases?
Flags: needinfo?(mwu)
Sure, that makes sense too. I think the main thing is that GECKO_TOOLS_PREFIX doesn't necessary replace TARGET_TOOLS_PREFIX. It's an extra thing that may or may not be different than TARGET_TOOLS_PREFIX.
Flags: needinfo?(mwu)
Attachment #8511330 - Flags: review?(mwu)
(In reply to Michael Wu [:mwu] from comment #9)
> Sure, that makes sense too. I think the main thing is that
> GECKO_TOOLS_PREFIX doesn't necessary replace TARGET_TOOLS_PREFIX. It's an
> extra thing that may or may not be different than TARGET_TOOLS_PREFIX.

Ok, I updated the PR.
Attachment #8511330 - Attachment description: Rename TARGET_TOOLS_PREFIX to GECKO_TOOLS_PREFIX → Deal with GECKO_TOOLS_PREFIX env var.
Status: NEW → ASSIGNED
Any reason we can't have a default which will pick the right source of symbols?

Something like this perhaps?

 - no symbols -> use symbol server
 - local symbols -> use local symbols from build
 - breakpad symbols present -> use breakpad symbols
(In reply to James Lal [:lightsofapollo] from comment #11)
> Any reason we can't have a default which will pick the right source of
> symbols?
> 
> Something like this perhaps?
> 
>  - no symbols -> use symbol server
>  - local symbols -> use local symbols from build
>  - breakpad symbols present -> use breakpad symbols

:/ If there is no "out" directory, it means we don't have a local build, so it can default to symbol server. Detecting breakpad symbols automatically can only happen if we have a local build, but if we have a local build, we don't need breakpad symbols.
(In reply to Wander Lairson Costa [:wcosta] from comment #12)
> (In reply to James Lal [:lightsofapollo] from comment #11)
> > Any reason we can't have a default which will pick the right source of
> > symbols?
> > 
> > Something like this perhaps?
> > 
> >  - no symbols -> use symbol server
> >  - local symbols -> use local symbols from build
> >  - breakpad symbols present -> use breakpad symbols
> 
> :/ If there is no "out" directory, it means we don't have a local build, so
> it can default to symbol server. Detecting breakpad symbols automatically
> can only happen if we have a local build, but if we have a local build, we
> don't need breakpad symbols.

Another issue that just came to my mind is that using the symbol server when there is no local build by default depends on the image on the phone, if it is not a pvt build, symbolication will mess up.
Comment on attachment 8511330 [details] [review]
Deal with GECKO_TOOLS_PREFIX env var.

Looks reasonable to me.
Attachment #8511330 - Flags: review?(dhylands) → review+
Attachment #8511330 - Flags: review?(mwu) → review+
Keywords: checkin-needed
Master: https://github.com/mozilla-b2g/B2G/commit/b5ad3226bcaf6221892c9f438e19771053f07b55
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S8 (7Nov)
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #15)
> Master:
> https://github.com/mozilla-b2g/B2G/commit/
> b5ad3226bcaf6221892c9f438e19771053f07b55

Thanks :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: