Closed Bug 956185 Opened 11 years ago Closed 11 years ago

Add a 'adb only' debugging option

Categories

(Firefox OS Graveyard :: General, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.3T+, b2g-v1.3T verified)

RESOLVED FIXED
blocking-b2g 1.3T+
Tracking Status
b2g-v1.3T --- verified

People

(Reporter: fabrice, Assigned: fabrice)

References

Details

(Whiteboard: [~400KB])

Attachments

(2 files, 2 obsolete files)

Currently enabling remote debugging turns on adb and the debugger server used by the devtools. The debugger server itself uses a bunch a js modules, and this adds up in memory usage. For low memory devices, it's worthwhile to have adb access while not providing remote debugging of web apps.
Attached patch debug-adb-only.patch (obsolete) — Splinter Review
I'll land it with the pref set to false, and turned on only for Tarako.
Assignee: nobody → fabrice
Attachment #8355384 - Flags: review?(dhylands)
Are we making sure that you can still enable remote debugging of web apps with an additional pref flip in the settings app?
(In reply to Jason Smith [:jsmith] from comment #2) > Are we making sure that you can still enable remote debugging of web apps > with an additional pref flip in the settings app? No. We could add that, but I'm not convinced that there is much value debugging web apps on these devices. This patch let us gather memory reports, get access to the adb shell etc.
(In reply to Fabrice Desré [:fabrice] from comment #3) > (In reply to Jason Smith [:jsmith] from comment #2) > > Are we making sure that you can still enable remote debugging of web apps > > with an additional pref flip in the settings app? > > No. We could add that, but I'm not convinced that there is much value > debugging web apps on these devices. This patch let us gather memory > reports, get access to the adb shell etc. Well, once you lower the memory usage, then app developers are going to deal with a new challenge of figuring out how to get their apps working on a device with even lower memory. This developer use case especially becomes important for apps that might currently have high memory use, but will end up being needed to be preinstalled on the Tarako device. As such, I'd expect that there will be a need for developer workflows to debug web apps on these devices, especially partner apps. I think it would be better to keep the option open to allow the developer to choose to enable the debugger server separate from adb, just so we don't end up foot gunning ourselves in case we get developer complaints down the line. If we're concerned about the memory use of the debugger server here, then we could issue a warning when the developer decides to enable the debugger server.
That's a fair point, but I'll think a bit more about that. We already have too many checkboxes in the developer panel!
Whiteboard: [tarako]
Instead of a checkbox, we could make it be a dropdown list with a list of options: none, adb only, adb and remote debugging (and also remote debugging only if that makes sense).
Comment on attachment 8355384 [details] [diff] [review] debug-adb-only.patch Review of attachment 8355384 [details] [diff] [review]: ----------------------------------------------------------------- r=me if you actually land it with the pref set to false. ::: b2g/app/b2g.js @@ +880,5 @@ > pref("apz.asyncscroll.throttle", 40); > + > +// Set this to true to only have adb active (but no devtools) when turning > +// on remote debugging. > +pref("devtools.b2g.adb_only", true); Oops. This seems to disagree with your comment of landing it with the pref set to false. ::: b2g/chrome/content/shell.js @@ +1070,3 @@ > // Start the debugger server. > start: function debugger_start() { > + if (!this.enabled) { It seems to me that we should log something here. Otherwise it might be extremely frustrating to figure out why the remote debugger isn't starting.
Attachment #8355384 - Flags: review?(dhylands) → review+
Fabrice, do we know how much memory saving we can have with this? Thanks
Flags: needinfo?(fabrice)
(In reply to Joe Cheng [:jcheng] from comment #8) > Fabrice, do we know how much memory saving we can have with this? Thanks If I recall correctly it was around 400k. I can't wait to have the memory usage reports on datazilla to track that!
Flags: needinfo?(fabrice)
Attached patch debug-adb-only.patch v2 (obsolete) — Splinter Review
Dave, I changed things a bit to use a select control in gaia. To be safe I'm using a new setting and turn on/off adb and the remote debugger according to the string value of this setting.
Attachment #8355384 - Attachment is obsolete: true
Attachment #8357305 - Flags: review?(dhylands)
Attached file gaia PR
Kaze, I'm turning the "Remote debugging" checkbox into a 3-states select control, to let us have adb without devtools.
Attachment #8357307 - Flags: review?(kaze)
Comment on attachment 8357305 [details] [diff] [review] debug-adb-only.patch v2 Review of attachment 8357305 [details] [diff] [review]: ----------------------------------------------------------------- not quite ready, just found a bug.
Attachment #8357305 - Flags: review?(dhylands)
new gecko patch, reworked to be simpler. I kept the old setting around since people usually don't upgrade gecko and gaia at the same time... I'll remove it in a couple of weeks.
Attachment #8357305 - Attachment is obsolete: true
Attachment #8357447 - Flags: review?(dhylands)
Comment on attachment 8357447 [details] [diff] [review] debug-adb-only.patch v3 Review of attachment 8357447 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me.
Attachment #8357447 - Flags: review?(dhylands) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
For future changes on devtools related code, can you please ask a devtools peer for feedback/review? At least to make sure we're aware of these changes (this patch breaks some upcoming feature we're working on).
(In reply to Paul Rouget [:paul] from comment #17) > For future changes on devtools related code, can you please ask a devtools > peer for feedback/review? At least to make sure we're aware of these changes > (this patch breaks some upcoming feature we're working on). How so? I did not touch any devtools code, only b2g/
(In reply to Fabrice Desré [:fabrice] from comment #18) > (In reply to Paul Rouget [:paul] from comment #17) > > For future changes on devtools related code, can you please ask a devtools > > peer for feedback/review? At least to make sure we're aware of these changes > > (this patch breaks some upcoming feature we're working on). > > How so? I did not touch any devtools code, only b2g/ Right, nothing we own there. I'm just saying that if you plan to change code related to RemoteDebugger and the debugger pref or settings, I'd like to know about it. We have plans to unify the way the debugger is started across the different mozilla products (B2G,Fx,metro,thunderbird…). So for future changes, a f? (well, not a r?), or a ping on IRC would be nice :)
kaze, Travis is green now!
Comment on attachment 8357307 [details] [review] gaia PR Thanks Fabrice, r=me.
Attachment #8357307 - Flags: review?(kaze) → review+
Is there still a way to get the remote debugger to start automatically by setting a property in the .userconfig file? It seems like only adb-only can be set in this way and not 'ADB and Devtools'
Flags: needinfo?(fabrice)
Try this (in your .userconfig) cat > gaia/build/custom-settings.json <<EOF {"devtools.debugger.remote-mode": "adb-devtools"} EOF
(In reply to Casper van Donderen from comment #23) > Is there still a way to get the remote debugger to start automatically by > setting a property in the .userconfig file? It seems like only adb-only can > be set in this way and not 'ADB and Devtools' What Dave said, or we could turn on adb-devtools by default for some configs. I don't have a strong opinion one way or the other.
Flags: needinfo?(fabrice)
Maybe DEVICE_DEBUG=1 should start both, instead of just ADB?
bug 942756 will make sure that the server debugger is started based on the pref (not the setting). But the default setting value should come from the pref.
I cannot get that custom-settings.json to work. It does get added in the file, but the device still defaults to adb-only (using in combination with PRODUCTION=1 & DEVICE_DEBUG=1)
It looks like gaia/build/settings.js only sets adb-only when config.REMOTE_DEBUGGER is set, and DEVICE_DEBUG also only sets adb-only. Personally, I think that this is a bug, and that settings.js should use adb-devtools There was also 2 mistakes in my override. It should look like: cat > gaia/build/config/custom-settings.json <<EOF {"debugger.remote-mode": "adb-devtools"} EOF The 2 changes are that the path should be: gaia/build/config/custom-settings.json and the setting should be debugger.remote-mode (without the devtools. at the front). I confirmed that with the above, my unagi in VARIANT=user builds defaults to adb-devtools.
remove [tarako] in whiteboard and use 1.3T?
blocking-b2g: --- → 1.3T?
Whiteboard: [tarako]
triage: save ~400KB for tarako. 1.3T+
blocking-b2g: 1.3T? → 1.3T+
Whiteboard: [~400KB]
Flags: needinfo?(timdream)
v1.3t: 0f84d0b0b9bfea1c463037f05954d0b4685b1f89 Conflict resolved by removing build tests... we don't have that in v1.3 or v1.3t. Fabrice, could you verify?
Flags: needinfo?(timdream) → needinfo?(fabrice)
Tim, thanks, that looks ok on my device!
Flags: needinfo?(fabrice)
Verified ADB only option in remote debugging section on latest 1.3T build. Environmental Variables: Device: Tarako 1.3T MOZ BuildID: 20140429014002 Gaia: b5adc5a943d3abbd6ab070a47c847f2c24891cc5 Gecko: e9890f5d4709 Version: 28.1 Firmware Version: sp6821a_gonk4.0_user.pac
Depends on: 1043122
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: