B2G RIL: enable ril debugging output in run-time

RESOLVED FIXED in Firefox 18

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
3 years ago

People

(Reporter: edgar, Assigned: edgar)

Tracking

({dev-doc-needed})

unspecified
mozilla19
ARM
Gonk (Firefox OS)
dev-doc-needed
Points:
---

Firefox Tracking Flags

(firefox18 fixed, firefox19 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Currently, to enable debug output only can be achieved in compile time. To make debug easily, we may need to add some mechanism to enable debug output in run-time.
We had similar feature in WiFi debugging in bug 806611. Ability to turn on debug messages in runtime can be handy for testing, but we still don't want to allow this through Gaia/Settings. We should instead have a default disabled preference like "ril.debugging.enabled" here.
Component: General → DOM: Device Interfaces
Product: Boot2Gecko → Core
Keywords: dev-doc-needed
Summary: RIL: enable ril debugging output in run-time → B2G RIL: enable ril debugging output in run-time
Created attachment 681369 [details] [diff] [review]
Bug_811605_patch_V1
Attachment #681369 - Flags: review+
Attachment #681369 - Flags: review+ → review?(vyang)
Comment on attachment 681369 [details] [diff] [review]
Bug_811605_patch_V1

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

Great! Thank you :)

::: dom/system/gonk/RILContentHelper.js
@@ +1063,5 @@
>  };
>  
>  this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RILContentHelper]);
>  
> +// Read debug setting from pref

Please move this segment right below "var DEBUG = ...".

@@ +1070,5 @@
> +  debugPref = Services.prefs.getBoolPref("ril.debugging.enabled");
> +} catch (e) {
> +  debugPref = false;
> +}
> +DEBUG = RIL.DEBUG_CONTENT_HELPER || debugPref;

You can have:

  try {
    let debugPref = Services.prefs.getBoolPref("ril.debugging.enabled");
    DEBUG = RIL.DEBUG_CONTENT_HELPER || debugPref;
  } catch (e) {};

instead, so that it won't insert a useless variable 'debugPref' into global ns after all these.

::: dom/system/gonk/RadioInterfaceLayer.js
@@ +282,5 @@
>    this.portAddressedSmsApps = {};
>    this.portAddressedSmsApps[WAP.WDP_PORT_PUSH] = this.handleSmsWdpPortPush.bind(this);
> +
> +  // pass debug pref to ril_worker
> +  this.worker.postMessage({rilMessageType: "updateDebug",

"setDebugEnabled"

@@ +2622,5 @@
>  };
>  
>  this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RadioInterfaceLayer]);
>  
> +// Read debug setting from pref

Please also move this segment up.
Attachment #681369 - Flags: review?(vyang) → review+
Created attachment 681421 [details] [diff] [review]
Bug_811605_patch_V2
Attachment #681369 - Attachment is obsolete: true
Attachment #681421 - Flags: review+
Keywords: checkin-needed
To enable debug log, you need to add one line, 'pref("ril.debugging.enabled", true);', into /system/b2g/defaults/pref/user.js in device. Then reboot device or restart b2g service.

detailed step:
adb remount
adb pull /system/b2g/defaults/pref/user.js user.js
[update user.js with adding 'pref("ril.debugging.enabled", true);']
adb push user.js /system/b2g/defaults/pref/user.js
adb shell reboot
https://hg.mozilla.org/integration/mozilla-inbound/rev/208c1637560b
Keywords: checkin-needed
Comment on attachment 681421 [details] [diff] [review]
Bug_811605_patch_V2

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

This is very useful for RIL debugging, asking approval to check into mozilla-aurora.

A similar runtime debugging support for Wifi also checked in to mozilla-aurora(bug 806611).
Attachment #681421 - Flags: approval-mozilla-aurora?

Comment 8

5 years ago
https://hg.mozilla.org/mozilla-central/rev/208c1637560b
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19

Comment 9

5 years ago
(In reply to Shian-Yow Wu from comment #7)
> Comment on attachment 681421 [details] [diff] [review]
> Bug_811605_patch_V2
> 
> Review of attachment 681421 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> This is very useful for RIL debugging, asking approval to check into
> mozilla-aurora.
> 
> A similar runtime debugging support for Wifi also checked in to
> mozilla-aurora(bug 806611).

Approving for Aurora assuming this will not have any major perf hits for non-debug users.

Updated

5 years ago
Attachment #681421 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/0d9385d1de1a
status-firefox18: --- → fixed
status-firefox19: --- → fixed
(In reply to Edgar Chen from comment #5)
> To enable debug log, you need to add one line,
> 'pref("ril.debugging.enabled", true);', into
> /system/b2g/defaults/pref/user.js in device. Then reboot device or restart
> b2g service.
> 
> detailed step:
> adb remount
> adb pull /system/b2g/defaults/pref/user.js user.js
> [update user.js with adding 'pref("ril.debugging.enabled", true);']
> adb push user.js /system/b2g/defaults/pref/user.js
> adb shell reboot

Thanks Edgar!  Would you also send a Gaia pull request to add "ril.debugging.enabled" in user.js with false value by default?  This will be convenient for users to know what prefs values they can change.
(In reply to Shian-Yow Wu from comment #11)
> (In reply to Edgar Chen from comment #5)
> > To enable debug log, you need to add one line,
> > 'pref("ril.debugging.enabled", true);', into
> > /system/b2g/defaults/pref/user.js in device. Then reboot device or restart
> > b2g service.
> > 
> > detailed step:
> > adb remount
> > adb pull /system/b2g/defaults/pref/user.js user.js
> > [update user.js with adding 'pref("ril.debugging.enabled", true);']
> > adb push user.js /system/b2g/defaults/pref/user.js
> > adb shell reboot
> 
> Thanks Edgar!  Would you also send a Gaia pull request to add
> "ril.debugging.enabled" in user.js with false value by default?  This will
> be convenient for users to know what prefs values they can change.

Add "ril.debugging.enabled" in user.js with false value by default.
This will be convenient for users to know what prefs values they can change. 

Send a pull request for this.
https://github.com/mozilla-b2g/gaia/pull/6532
Merged on Github:
https://github.com/mozilla-b2g/gaia/commit/da8dad4
See Also: → bug 820699
Blocks: 960926
You need to log in before you can comment on or make changes to this bug.