Check-in merge-profiles.py

RESOLVED FIXED in mozilla26

Status

()

Core
Gecko Profiler
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: BenWa, Assigned: BenWa)

Tracking

Trunk
mozilla26
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

Attachment #803977 - Flags: review?(vdjeric)
Comment on attachment 803977 [details] [diff] [review]
patch

- Add a comment to the top of the file about what the script does and how it does it

>+    filedata = []
>+    symtable = dict()

Nit: camel case

>+        match = re.match('profile_([0-9]*)_(.*)\.sym', fname)

I think you meant 'profile_([0-9]+)_(.+)\.sym'

>+        if match is None:
>+            raise Exception("Filename '" + fname + "' doesn't match expected pattern")

Nit: consistent string quotes
>+                    frame['location'] = pid + frame['location']

Hmm, will you be able to distinguish (pid=12, location=3) from (pid=1, location=23)

>+    result = dict()
>+    result['profileJSON'] = dict()
>+    result['profileJSON']['meta'] = meta
>+    result['profileJSON']['libs'] = libs
>+    result['profileJSON']['threads'] = threads
>+    result['symbolicationTable'] = symtable
>+    result['format'] = 'profileJSONWithSymbolicationTable,1'

You could also do this in one or two lines, e.g. result = {'profileJSON': {'meta': meta, 'libs': libs, 'threads': threads, .. }. Just a suggestion

>+print "Usage: merge-profile.py profile_....sym profile_....sym > merged.sym"

print "Usage: merge-profile.py profile_<pid1>_<pname1>.sym profile_<pid2>_<pname2>.sym > merged.sym"
Attachment #803977 - Flags: review?(vdjeric) → review+
(Assignee)

Updated

5 years ago
Blocks: 914654
(Assignee)

Comment 2

5 years ago
Created attachment 804079 [details] [diff] [review]
patch
Assignee: nobody → bgirard
Attachment #803977 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #804079 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/ed734d586569
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Created attachment 809460 [details] [diff] [review]
patch (b2g18)

merge-profiles.py, and enough of the changeset from bug 788022 to add 'startTime' logging to the profilers.

NOTE: This flag is now for security issues only. Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 914658
User impact if declined: unable to merge profiles
Testing completed: run on local builds
Risk to taking this patch (and alternatives if risky): minimal
String or UUID changes made by this patch: none
Attachment #809460 - Flags: review?(bgirard)
Attachment #809460 - Flags: approval-mozilla-b2g18?
(Assignee)

Updated

5 years ago
Attachment #809460 - Flags: review?(bgirard) → review+

Updated

4 years ago
Attachment #809460 - Flags: approval-mozilla-b2g18? → approval-mozilla-b2g18-
You need to log in before you can comment on or make changes to this bug.