Closed Bug 1047391 Opened 8 years ago Closed 8 years ago

nm-symbolicate.py picks up wrong nm binary ("invalid argument -D")

Categories

(Core :: Gecko Profiler, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(1 file, 1 obsolete file)

When using "./profile.sh capture" after profiling the b2g Compositor thread, symbolication fails on my Mac and a broken profile is created.

The problem is that nm-symbolicate.py uses the wrong nm binary. On my machine it uses

Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm

when it should be using

/Volumes/firefoxos/B2G/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-nm

XCode's nm doesn't support the -D and -S flags that we pass to it and prints the following error message during ./profile.sh capture:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: invalid argument -D
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm [-agnopruUmxjlfAP[s segname sectname] [-] [-t format] [[-arch <arch_flag>] ...] [file ...]
Attached patch v1 (obsolete) — Splinter Review
Attachment #8466186 - Flags: review?(bgirard)
Comment on attachment 8466186 [details] [diff] [review]
v1

Review of attachment 8466186 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/profiler/nm-symbolicate.py
@@ +13,5 @@
>    ]
> +  try:
> +    nm_lines = subprocess.check_output(args).split("\n")
> +  except subprocess.CalledProcessError:
> +    sys.exit(-1)

You should log something instead of silently failing or just let the error bubble up so that it will be echo'ed
Attachment #8466186 - Flags: review?(bgirard) → review+
OK, I'll just revert the error handling change.
Attached patch v2Splinter Review
Attachment #8466186 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/ebfcfbeba792
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.