Last Comment Bug 731853 - add easy way to do shutdown WANT_ALL_TRACES CC logging
: add easy way to do shutdown WANT_ALL_TRACES CC logging
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla20
Assigned To: Andrew McCreight [:mccr8]
: Nathan Froyd [:froydnj]
Depends on:
Blocks: 723783 794974
  Show dependency treegraph
Reported: 2012-02-29 16:14 PST by Andrew McCreight [:mccr8]
Modified: 2012-12-20 13:48 PST (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

add two globals to control shutdown logging (2.30 KB, patch)
2012-09-28 10:13 PDT, Andrew McCreight [:mccr8]
bugs: review+
Details | Diff | Splinter Review

Description User image Andrew McCreight [:mccr8] 2012-02-29 16:14:47 PST
The most common kind of leak hunting is looking at shutdown leaks.  It would be handy if there was an easy way to
a) log only shutdown CCs, as that's often all you care about for shutdown leaks
b) make them WANT_ALL_TRACES, as this is needed if the leak is in JS (as it often is...)

For this bug, at first I'll just try out a compile flag in nsCycleCollector.cpp.  If we want to get fancy later we can add an environment flag in debug builds or something.
Comment 1 User image Andrew McCreight [:mccr8] 2012-09-28 10:13:33 PDT
Created attachment 665959 [details] [diff] [review]
add two globals to control shutdown logging

I haven't tested this, but it does compile. I add two boolean flags at the top of nsCycleCollector.cpp. One will log all shutdown CCs, the other will make all shutdown CCs AllTraces(). Shutdown CCs always do a GC beforehand, so we don't need to do any further trickery to disable CC optimization.
Comment 2 User image Olli Pettay [:smaug] (pto-ish for couple of days) 2012-10-11 07:16:56 PDT
Comment on attachment 665959 [details] [diff] [review]
add two globals to control shutdown logging

It would be nice to be able to control this all using some
prefs or env variables.
Comment 3 User image Andrew McCreight [:mccr8] 2012-10-11 07:31:46 PDT
That's a good point. I was thinking that myself. I'll figure out how to work that in there.
Comment 4 User image Andrew McCreight [:mccr8] 2012-12-19 11:47:22 PST
Hrmph, I guess I never landed this. I'll land it soon and file a followup for a way to trigger this without recompiling.
Comment 5 User image Andrew McCreight [:mccr8] 2012-12-19 13:12:33 PST

Filed bug 823226 for controlling logging via environment variables.
Comment 6 User image Ed Morley [:emorley] 2012-12-20 13:48:41 PST

Note You need to log in before you can comment on or make changes to this bug.