Closed Bug 925621 Opened 6 years ago Closed 6 years ago

Let startProfiling take a pid so the content process can be profiled

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: adw, Assigned: adw)

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

Attached patch patch2.diff (obsolete) — Splinter Review
I needed to get an Instruments.app profile of a particular part of a content script, but {start,stop}Profiling aren't available there.  I don't know how to make them available or if there's some alternative, so as a workaround I messaged the parent and used this patch, in combination with MOZ_DEBUG_CHILD_PROCESS to get the content pid.

This was useful for me, but it's kind of awkward so I understand if you don't want to take it.

(Not sure who to r?... Steve reviewed the original patch in bug 748669 and pops up as a "suggested reviewer," so Steve it is.)
Attachment #815714 - Flags: review?(sphink)
Comment on attachment 815714 [details] [diff] [review]
patch2.diff

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

Oops, sorry! This review slipped through the cracks. Looks good to me, and I'm assuming it works when you try it.
Attachment #815714 - Flags: review?(sphink) → review+
Thanks, Steve.

https://hg.mozilla.org/integration/mozilla-inbound/rev/712758b52e76
Assignee: nobody → adw
Status: NEW → ASSIGNED
Backed out for Linux build bustage.  I should have pushed to try first. :-(

https://hg.mozilla.org/integration/mozilla-inbound/rev/a70124509785
The Linux compiler error was that pid_t in Profilers.h was undeclared.  There were also Windows compiler errors due to pid_t and getpid being undeclared.  So this typedefs pid_t and #defines getpid on Windows (which is done in some other places in the tree), and otherwise #includes <unistd.h>.

https://tbpl.mozilla.org/?tree=Try&rev=053e0a019006
Attachment #815714 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d548421e14c5
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.