Closed
Bug 1293360
Opened 7 years ago
Closed 7 years ago
Add a MOZ_CCTIMER environment variable (mirroring MOZ_GCTIMER) to dump CC stats to the console
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: terrence, Assigned: terrence)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
3.75 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
It surprised me that there's currently no easy way to get CC logs out of the CC and into a file for easy grepping, searching, and statisticsing. In the GC we have an extremely useful environment flag called MOZ_GCTIMER that lets us do just this. The attached patch adds a similar flag for the CC. I've tested this locally and it gets me enough data to move forward. Given how useful the GC flag has been, I hope we can take this (or something like it) for the CC.
Attachment #8779005 -
Flags: review?(continuation)
Comment 1•7 years ago
|
||
Comment on attachment 8779005 [details] [diff] [review] implement_MOZ_CCTIMER-v0.diff Review of attachment 8779005 [details] [diff] [review]: ----------------------------------------------------------------- I guess this is fine. ::: dom/base/nsJSEnvironment.cpp @@ +1287,5 @@ > Clear(); > mMaxSliceTimeSinceClear = 0; > + > + char* env = getenv("MOZ_CCTIMER"); > + if (env) { Please invert the test and do an early return here. @@ +1295,5 @@ > + mFile = stdout; > + } else if (strcmp(env, "stderr") == 0) { > + mFile = stderr; > + } else { > + mFile = fopen(env, "a"); This eventually won't work with content process sandboxing, FWIW. I wonder if there's some existing way to just dump the console output to a file. @@ +1616,5 @@ > uint32_t cleanups = sForgetSkippableBeforeCC ? sForgetSkippableBeforeCC : 1; > uint32_t minForgetSkippableTime = (sMinForgetSkippableTime == UINT32_MAX) > ? 0 : sMinForgetSkippableTime; > > + if (sPostGCEventsToConsole || gCCStats.mFile) { This will make us post them to the console even if that pref isn't set, but I suppose that's okay.
Attachment #8779005 -
Flags: review?(continuation) → review+
Assignee | ||
Comment 2•7 years ago
|
||
Oh, good catch! We should probably build the string in the || branch and have a separate case for each output mechanism.
Assignee | ||
Comment 3•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/160102be757f93da4d9521dfc89968ff17728962 Bug 1293360 - Implement MOZ_CCTIMER environment variable; r=mccr8
Comment 4•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/160102be757f
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•