Closed Bug 920250 Opened 13 years ago Closed 9 years ago

merge-profiles.py chokes on b2g's preallocted app's generated filename

Categories

(Core :: Gecko Profiler, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mikeh, Unassigned)

Details

Attachments

(1 file, 3 obsolete files)

Output: 17:16:23 ➜ 034_inari-b2g18 git:(master) ✗ ./profile.sh capture Signaling Profiled Processes: 700 745 781 852 886 Stabilizing 700 b2g ... Pulling /data/local/tmp/profile_0_700.txt into profile_700_b2g.txt Adding symbols to profile_700_b2g.txt and creating profile_700_b2g.sym ... Stabilizing 745 Usage ... Pulling /data/local/tmp/profile_2_745.txt into profile_745_Usage.txt Adding symbols to profile_745_Usage.txt and creating profile_745_Usage.sym ... Stabilizing 781 Homescreen ... Pulling /data/local/tmp/profile_2_781.txt into profile_781_Homescreen.txt Adding symbols to profile_781_Homescreen.txt and creating profile_781_Homescreen.sym ... Stabilizing 852 Camera ... Pulling /data/local/tmp/profile_2_852.txt into profile_852_Camera.txt Adding symbols to profile_852_Camera.txt and creating profile_852_Camera.sym ... Stabilizing 886 (Preallocated a ... Pulling /data/local/tmp/profile_2_886.txt into profile_886_(Preallocated a.txt Adding symbols to profile_886_(Preallocated a.txt and creating profile_886_(Preallocated a.sym ... Merging profile: profile_700_b2g.sym profile_745_Usage.sym profile_781_Homescreen.sym profile_852_Camera.sym profile_886_(Preallocated a.sym Traceback (most recent call last): File "./gecko/tools/profiler/merge-profiles.py", line 79, in <module> MergeProfiles(sys.argv[1:]) File "./gecko/tools/profiler/merge-profiles.py", line 23, in MergeProfiles raise Exception("Filename '" + fname + "' doesn't match expected pattern") Exception: Filename 'profile_886_(Preallocated' doesn't match expected pattern Results: profile_captured.sym Removing old profile files (from device) ... done
It looks like merge-profiles.py is choking on the space in the filename "profile_886_(Preallocated a.sym".
If we enable profiling per process this becomes a non issue. Not ideal but really profiling that process is a mistake.
(In reply to Benoit Girard (:BenWa) from comment #2) > > If we enable profiling per process this becomes a non issue. Not ideal but really profiling that process is a mistake. Until someone goes and names their app "Home Screen" or something with a space in it, non?
I tried changing line 202 in profile.sh to: profiles_to_merge="$profiles_to_merge $(printf %q "${CMD_SYMBOLICATE_PROFILE}")" This produces the following output: Merging profile: profile_505_b2g.sym profile_563_Homescreen.sym profile_618_Camera.sym profile_677_\(Preallocated\ a.sym That looks fine, but merge-profiles.py still seems to get a trashed filename: Exception: Filename 'profile_677_\(Preallocated\' doesn't match expected pattern I wrote a basic script: #!/usr/bin/env python import sys def foo(bar): for qux in bar: print qux foo(sys.argv[1:]) sys.exit(0) ...and call it from: #!/bin/bash d="foo" d="$d $(printf %q 'bar( qux')" ./test.py $d ./test.py cow dog\(\ cat ...that essentially does the same thing, and when I run |./test.sh| I get as output: foo bar\(\ qux cow dog( cat So something is happening to the arguments passed in the variable, but I can't seem to figure out what.
What about this: profiles_to_merge="$profiles_to_merge \"${CMD_SYMBOLICATE_PROFILE}\""
This makes the filename handling so much easier.
Attachment #810135 - Flags: review?(bgirard)
(In reply to Benoit Girard (:BenWa) from comment #5) > > What about this: > profiles_to_merge="$profiles_to_merge \"${CMD_SYMBOLICATE_PROFILE}\"" That doesn't work properly either.
This patch only changes the file names, not B2G_COMM.
Attachment #810135 - Attachment is obsolete: true
Attachment #810135 - Flags: review?(bgirard)
Attachment #810172 - Flags: review?(bgirard)
Get the HTML/link right this time.
Attachment #810172 - Attachment is obsolete: true
Attachment #810172 - Flags: review?(bgirard)
QA Contact: mhabicher
Squashing commits
Attachment #810176 - Attachment is obsolete: true
Attachment #810207 - Flags: review?(bgirard)
Comment on attachment 810207 [details] Remove non-alphanum characters from b2g process names, v3 I'm happy to r+ this
Attachment #810207 - Flags: review+
Comment on attachment 810207 [details] Remove non-alphanum characters from b2g process names, v3 Oops - wrong bug
Attachment #810207 - Flags: review+
Attachment #810207 - Flags: review?(bgirard) → review+
B2G
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: