Closed
Bug 725512
Opened 13 years ago
Closed 13 years ago
Reduce Content Provider log spew
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox11 affected, firefox12 affected)
VERIFIED
FIXED
Firefox 13
People
(Reporter: rnewman, Assigned: rnewman)
Details
Attachments
(1 file, 3 obsolete files)
37.97 KB,
patch
|
lucasr
:
review+
|
Details | Diff | Splinter Review |
02-07 00:26:21.510 D/GeckoBrowserProvider( 9987): Getting readable database for URI: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.510 D/GeckoBrowserProvider( 9987): Query is on bookmarks: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.510 D/GeckoBrowserProvider( 9987): Running built query.
and
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Calling update on URI: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Getting writable database for URI: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Beginning update transaction: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Calling update in transaction on URI: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Updating bookmark: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Updating bookmarks on URI: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Getting writable database for URI: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Quering bookmarks to update on URI: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Extracting image values for URI: null
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Updating bookmark with ID: 2951
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Updated 1 rows for URI: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true
02-07 00:26:21.420 D/GeckoBrowserProvider( 9987): Successful update transaction: content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=tru
on every single operation isn't too helpful.
I will take a machete to this.
Assignee | ||
Comment 1•13 years ago
|
||
Here's a first stab. I'm building and testing this now, but might as well upload it.
We can use the existing preprocessing in this file to adjust whether trace logging gets turned on or not. If it's off, the compiler should be smart enough to make the trace statements 0-cost, which is a nice win.
Attachment #595571 -
Flags: review?(lucasr.at.mozilla)
Assignee | ||
Comment 2•13 years ago
|
||
This patch does three things:
* Introduce two simple static methods, "debug" and "trace". These do the correct thing for Android: check whether we should log at the requested level, and then do so.
* Replace all uses of Log.d(LOGTAG…) with debug(…).
* Replace the most repetitive uses of debug(…) with trace(…). This has the effect of eliminating thousands of lines of useless log output for routine syncs, making everyone happy — from the phone's IO subsystem all the way up to our execs. Logging can be re-enabled at runtime over ADB if so desired.
Attachment #595571 -
Attachment is obsolete: true
Attachment #595571 -
Flags: review?(lucasr.at.mozilla)
Attachment #595666 -
Flags: review?(lucasr.at.mozilla)
Assignee | ||
Comment 3•13 years ago
|
||
… and here's a version that actually compiles, thanks to me remembering to qref :)
The command to tweak log levels, by the way, is:
adb shell setprop log.tag.GeckoBrowserProvider VERBOSE
Attachment #595672 -
Flags: review?(lucasr.at.mozilla)
Assignee | ||
Comment 4•13 years ago
|
||
Oh, Android, why are you so inefficient?
https://github.com/android/platform_frameworks_base/blob/master/core/jni/android_util_Log.cpp#L59
isLoggable calls through JNI, does some string checking, and hits the System property store to retrieve the log level as a string. No caching, no opportunity for JIT here.
I'm not happy having this in the call path for every log statement. Time to make things less dynamic…
Assignee | ||
Comment 5•13 years ago
|
||
This version computes isLoggable once during static initialization. To change log levels, the app must be quit and restarted.
Attachment #595666 -
Attachment is obsolete: true
Attachment #595672 -
Attachment is obsolete: true
Attachment #595666 -
Flags: review?(lucasr.at.mozilla)
Attachment #595672 -
Flags: review?(lucasr.at.mozilla)
Attachment #595678 -
Flags: review?(lucasr.at.mozilla)
Comment 6•13 years ago
|
||
Comment on attachment 595678 [details] [diff] [review]
Proposed patch. v4
Review of attachment 595678 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good. I actually expected Log.d and Log.v to do what your patch does. i.e. Log.d and Log.v would be noop depending on the current log level. It's surprising that this is not the case. I wonder if you should add trace() and log() to a separate LogUtils class. For instance, I'd be interested in the same type of functionality for Favicons.java. Giving a r+ anyway.
Attachment #595678 -
Flags: review?(lucasr.at.mozilla) → review+
Assignee | ||
Comment 7•13 years ago
|
||
(In reply to Lucas Rocha (:lucasr) from comment #6)
> Looks good. I actually expected Log.d and Log.v to do what your patch does.
> i.e. Log.d and Log.v would be noop depending on the current log level.
Me too. Kinda like every other logging framework in the world, mm? Curse you, Android.
> I wonder if you should add trace() and
> log() to a separate LogUtils class. For instance, I'd be interested in the
> same type of functionality for Favicons.java. Giving a r+ anyway.
I did this for Sync, which will also add a really handy location for Syncorro, logging to stdout, blocking of sensitive information regardless of log level, etc.
Will file a follow-up for the Fennec side.
Assignee | ||
Comment 8•13 years ago
|
||
(In reply to Richard Newman [:rnewman] from comment #7)
> Will file a follow-up for the Fennec side.
Actually, Bug 721461 will probably take care of centralizing some of this where it makes sense.
Comment 9•13 years ago
|
||
Adding Chris since he was looking at some ways to trim back logging in bug 721461
Assignee | ||
Comment 10•13 years ago
|
||
Inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6eeb8efc079f
Will request approval when this has had a day on m-c.
Whiteboard: [inbound]
Comment 11•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
Assignee | ||
Comment 12•13 years ago
|
||
Comment on attachment 595678 [details] [diff] [review]
Proposed patch. v4
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
-- excessive log output, possible IO slowdown.
Testing completed (on m-c, etc.):
-- running locally, time on m-i and now m-c.
Risk to taking this patch (and alternatives if risky):
-- slim.
String changes made by this patch:
-- none.
Attachment #595678 -
Flags: approval-mozilla-beta?
Attachment #595678 -
Flags: approval-mozilla-aurora?
Comment 13•13 years ago
|
||
Comment on attachment 595678 [details] [diff] [review]
Proposed patch. v4
[Triage Comment]
Mobile only - approved for Aurora 12 and Beta 11.
Attachment #595678 -
Flags: approval-mozilla-beta?
Attachment #595678 -
Flags: approval-mozilla-beta+
Attachment #595678 -
Flags: approval-mozilla-aurora?
Attachment #595678 -
Flags: approval-mozilla-aurora+
Assignee | ||
Comment 14•13 years ago
|
||
Thanks Alex.
Added to blassey's patch queues for Beta and Aurora.
Comment 16•13 years ago
|
||
Comment on attachment 595678 [details] [diff] [review]
Proposed patch. v4
Clearing approval for Aurora 12 and Beta 11 because we are not currently planning a Native Fennec release of these versions. If this changes in the future, we will likely do a mass uplift of all native fennec changes. For now, let's get these bugs off the channel triage radar.
[Filter on the string "mbrubeck-bugspam" if you want to delete all of these emails at once.]
Attachment #595678 -
Flags: approval-mozilla-beta+
Attachment #595678 -
Flags: approval-mozilla-aurora+
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•