Hooking up devtools, profiler to metro

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: ally, Unassigned)

Tracking

(Depends on: 1 bug)

Details

(Whiteboard: [waiting on devtools] [story])

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

6 years ago
This would involve working with devtools to hook up a profiler so we can see what is going on with performance (Im especially interested in our chrome performance)

Asa, can we get a story for this, and then this can morph into the work bug?
(Reporter)

Comment 1

6 years ago
Can we either get a story for this one, or add it to the story for testing
Flags: needinfo?(asa)

Updated

6 years ago
Blocks: 841214

Comment 2

6 years ago
https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler

Getting this running on b2g looks pretty painful, maybe we could improve on that. I guess the core issue would be getting the functionality in the desktop extension hooked up somehow.

We could certainly use this in our omtc work.
I'm going to temporarily move this to v2. If we find some jank we want to diagnose though it can move back under that story.
Blocks: 837155
No longer blocks: 841214

Updated

6 years ago
Blocks: 842686
No longer blocks: 837155
oops thanks for catching that.

Comment 5

5 years ago
Agreed, v2 unless we find ourselves unable to diagnose some issue that can only be managed by wiring this up.
Flags: needinfo?(asa)
Whiteboard: [metro-mvp?]
(Reporter)

Comment 6

5 years ago
as discussed in teammeetup to help us focus on perf on low end devices.
Flags: needinfo?(mmucci)
Moving to Planning Backlog to be included in V1.
Blocks: 841997
No longer blocks: 842686
Flags: needinfo?(mmucci)
(Reporter)

Updated

5 years ago
Assignee: nobody → ally
(Reporter)

Updated

5 years ago
Summary: Hooking up a profiler to metro → Hooking up devtools, profiler to metro
(Reporter)

Comment 8

5 years ago
For clarity of our devtools friends, on windows 8 the metrofx and the desktop fx are installed together, and are running on the same machine (I usually run with one on each monitor). The metrofx may be run in two ways, in the metro immersive environment, and in a simulated form of that on the classic desktop.

classic = aurora fx in windows desktop mode
metro =  my local m-c build of metrofx w/ harthur's devtools patch applied running in the immersive metro mode (1 app only, no popups, but there are modal dialogs)
-metrodesktop = my local m-c build of metrofx in -metrodesktop mode with harthur's patch applied. This runs on the classic desktop but has a different widget backend. This is the mode that allows use to monkeypatch in the dom inspector

prefs on all 3 forms of firefox:
classic
devtools.debugger.chrome-enabled = true
devtools.debugger.chrome-debugging-host = localhost
devtools.debugger.chrome-debugging-port = 6080
devtools.debugger.enabled = true
devtools.debugger.force-local = true
devtools.debugger.log = true
devtools.debugger.remote-enabled = true
devtools.debugger.remote-autoconnect = false
devtools.debugger.remote-host = localhost
devtools.debugger.remote-port = 6000

metro
(devtools.debuger.* has only the following 4 prefs)
devtools.debugger.force-local = false
devtools.debugger.remote-enabled = true
devtools.debugger.remote-port = 6000
devtools.debugger.log = true

-metrodesktop
(devtools.debuger.* has only the following 4 prefs)
devtools.debugger.force-local = false
devtools.debugger.log = true
devtools.debugger.remote-enabled = true
devtools.debugger.remote-port = 6000

1-set settings on classic

2-set settings on metro (or -metrodesktop. The behavior&errors are the same)

3-tools menu -> web developer -> connect
  loads chrome://browser/content/devtools/connect.xhtml
  host: localhost
  port: 6000

4- click connect

5- on metro, click accept on the incoming connection modal dialog
The following errors crop up on the jsconsole:
Timestamp: 5/21/2013 3:16:10 PM
Error: Handler function DebuggerTransport.prototype.onStopRequest threw an exception: TypeError: this.getTabContainer(...) is undefined
Call stack:
BRA_unwatchWindow@chrome://global/content/devtools/dbg-browser-actors.js:187
BRA_disconnect@chrome://global/content/devtools/dbg-browser-actors.js:68
AP_cleanup@chrome://global/content/devtools/dbg-server.js:489
DSC_onClosed@chrome://global/content/devtools/dbg-server.js:693
DT_onStopRequest@chrome://global/content/devtools/dbg-transport.js:176
@chrome://global/content/devtools/dbg-transport.js:41
Source File: chrome://global/content/devtools/dbg-transport.js
Line: 60

Timestamp: 5/21/2013 3:16:29 PM
Error: TypeError: this.getTabContainer(...) is undefined
BRA_watchWindow@chrome://global/content/devtools/dbg-browser-actors.js:178
BRA_onListTabs@chrome://global/content/devtools/dbg-browser-actors.js:105
DSC_onPacket@chrome://global/content/devtools/dbg-server.js:649
DT__processIncoming/<@chrome://global/content/devtools/dbg-transport.js:227
@chrome://global/content/devtools/dbg-transport.js:41
Source File: chrome://global/content/devtools/dbg-server.js
Line: 602

6- The classic is stuck in a spinning throbber, "Connecting..."
The jsconsole spits out
Timestamp: 5/21/2013 2:44:33 PM
Error: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"error occurred while processing 'listTabs': TypeError: this.getTabContainer(...) is undefined\nBRA_watchWindow@chrome://global/content/devtools/dbg-browser-actors.js:178\nBRA_onListTabs@chrome://global/content/devtools/dbg-browser-actors.js:105\nDSC_onPacket@chrome://global/content/devtools/dbg-server.js:649\nDT__processIncoming/<@chrome://global/content/devtools/dbg-transport.js:227\n@chrome://global/content/devtools/dbg-transport.js:41\n"}
Source File: resource://gre/modules/devtools/dbg-client.jsm
Line: 587

7- They never connect

Other Notes:
-I get the same behavior if I try to connect to metro or -metrodesktop
-When Heather & Nick patiently walked me through this the first time, we able to get the metro & the classic to connect, but classic said there was no data to connect to and metro spit out an error about actors.js being undefined. I am unable to reproduce that part now.

Updated

5 years ago
Blocks: 731280, 838081
No longer blocks: 841997
Summary: Hooking up devtools, profiler to metro → Story - Hooking up devtools, profiler to metro
Whiteboard: feature=story c=testing u=developer p=0
You will need to provide a metro-specific override of the browser actors (formerly dbg-browser-actors.js, as of a few minutes ago webbrowser.js). The error message you are hitting points to a missing getBrowser() method on your window, presumably because you don't use a XUL window?

See for example how Fennec implements the getTabContainer() method in their version of the browser actors:

http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/dbg-browser-actors.js#110

Bug 870081 and its dependencies will simplify this process, providing a cleaner API to base your work on.
(Reporter)

Updated

5 years ago
Depends on: 870081, 859372
Whiteboard: feature=story c=testing u=developer p=0 → feature=story c=testing u=developer p=0 [waiting on devtools]
(Reporter)

Comment 10

5 years ago
Created attachment 752858 [details] [diff] [review]
patch courtesy of harthur
(Reporter)

Updated

5 years ago
Blocks: 872780

Updated

5 years ago
Blocks: 875026

Updated

5 years ago
No longer blocks: 838081
Hi Ally, can you provide a point estimate for this feature story.
Flags: needinfo?(ally)
QA Contact: jbecerra
(Reporter)

Updated

5 years ago
Flags: needinfo?(ally)
Whiteboard: feature=story c=testing u=developer p=0 [waiting on devtools] → feature=story c=testing u=developer p=0
(Reporter)

Comment 12

5 years ago
p=13. It's uncharted territory with a brand new api

Updated

5 years ago
Whiteboard: feature=story c=testing u=developer p=0 → feature=story c=testing u=developer p=13

Updated

5 years ago
Status: NEW → ASSIGNED

Updated

5 years ago
Priority: -- → P2
(Reporter)

Comment 13

5 years ago
Created attachment 762435 [details]
current error message on both sides of the connection
(Reporter)

Comment 14

5 years ago
Created attachment 762438 [details] [diff] [review]
nonworking patch, empty function bodies

the function bodies on this patch are empty as I try(and fail) to demonstrate that the override code works. This code is modeled from http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/dbg-browser-actors.js#110, the error messages are in the other attachment.
(Reporter)

Comment 15

5 years ago
(6:30:45 PM) mbrubeck: ally: gBrowser is a Firefox thing; I think it points to the <tabbrowser> widget, which we don't use
(6:31:20 PM) mbrubeck: We'll either need to fake up a gBrowser that implements the methods/properties that devtools needs, or modify their code not to depend on gBrowser
(Reporter)

Comment 16

5 years ago
Created attachment 762999 [details] [diff] [review]
connects, tabs ok, profiler page blank

- The debug server starts & connects. We get list of tabs, the console, the debugger, and the network tools.

yay!

The profiler though, shows start & stop buttons, but no actual data is displayed 

The desktop when attached to metro occasionally spits out the following, which may be relevant

sometime when messing with the settings, desktop spat the following otu
Timestamp: 6/14/2013 2:38:37 PM
Error: TypeError: this._debuggee is undefined: @resource://app/modules/devtools/StyleEditorPanel.jsm:118
EventEmitter_emit@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/shared/event-emitter.js:107
TabTarget.prototype.destroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/framework/target.js:388
TBOX_destroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/framework/toolbox.js:718
EventEmitter_emit@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/shared/event-emitter.js:107
WindowHost.prototype._boundUnload@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/framework/toolbox-hosts.js:243

Source File: resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/shared/event-emitter.js
Line: 112
Attachment #752858 - Attachment is obsolete: true
Attachment #762438 - Attachment is obsolete: true
That error happens when the style editor is being destroyed, so if it seems to work fine in normal use there may be a race in our shutdown path somewhere.

A protocol dump would be very useful to determine what is going on with the profiler and the other actors.
Comment on attachment 762999 [details] [diff] [review]
connects, tabs ok, profiler page blank

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

::: toolkit/devtools/client/dbg-client.jsm
@@ +530,4 @@
>     *        debugging server responds.
>     */
>    request: function DC_request(aRequest, aOnResponse) {
> +    Cu.reportError("request(): "+ JSON.stringify(aRequest)); //anaaktge debug

You shouldn't need this if you enable the devtools.debugger.log pref, since it produces large swaths of debug output in the terminal. If terminal and metro don't get along well, you could change dumpn() in toolkit/devtools/server/main.js to use Cu.reportError instead.
(Reporter)

Updated

5 years ago
Depends on: 833507
(Reporter)

Updated

5 years ago
Component: General → Metro Operations
Product: Firefox for Metro → Tracking
Version: unspecified → ---
(Reporter)

Updated

5 years ago
Depends on: 886546
(Reporter)

Updated

5 years ago
Depends on: 886555

Updated

5 years ago
Blocks: 882638
No longer blocks: 875026
(Reporter)

Updated

5 years ago
Blocks: 875026
No longer blocks: 882638

Updated

5 years ago
Blocks: 882638
No longer blocks: 875026
(Reporter)

Updated

5 years ago
Depends on: 888079
(Reporter)

Updated

5 years ago
Depends on: 888111
(Reporter)

Comment 19

5 years ago
The metro-side work has been finished off. Unassigning myself.
Assignee: ally → nobody

Updated

5 years ago
Blocks: 838081
No longer blocks: 882638
Status: ASSIGNED → NEW
QA Contact: jbecerra
Whiteboard: feature=story c=testing u=developer p=13 → [waiting on devtools] feature=story c=testing u=developer p=13

Updated

5 years ago
No longer blocks: 872780

Updated

5 years ago
Blocks: 861680
No longer blocks: 838081

Updated

5 years ago
No longer blocks: 731280

Updated

5 years ago
Summary: Story - Hooking up devtools, profiler to metro → Hooking up devtools, profiler to metro
Whiteboard: [waiting on devtools] feature=story c=testing u=developer p=13 → [waiting on devtools] [story]

Updated

5 years ago
Priority: P2 → --

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Updated

5 years ago
No longer depends on: 963629
You need to log in before you can comment on or make changes to this bug.