Closed
Bug 1170314
Opened 9 years ago
Closed 9 years ago
Make console.timeStamp to add also Gecko profiler markers if Gecko profiler is active
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: smaug, Assigned: smaug)
References
Details
Attachments
(2 files)
2.70 KB,
patch
|
BenWa
:
review+
baku
:
review+
|
Details | Diff | Splinter Review |
2.69 KB,
patch
|
Details | Diff | Splinter Review |
...or we could use some other method too, but I guess reusing the existing one should be fine, at least for now. do_GetService is a bit slow call, so want to cache the service.
Attachment #8613704 -
Flags: review?(bgirard)
Comment 1•9 years ago
|
||
Comment on attachment 8613704 [details] [diff] [review] v1 Review of attachment 8613704 [details] [diff] [review]: ----------------------------------------------------------------- Profiler integration looks good. This matches with chrome. (unrelated) It would be nice someday to standardize a devtools performance API IMO. This is a DOM change so, at your discretion, consider having a DOM peer review this.
Attachment #8613704 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8613704 [details] [diff] [review] v1 baku, I need some way to add markers to Gecko profiler (not the builtin devtools profiler), and this seemed to be ok-ish way to use existing method.
Attachment #8613704 -
Flags: review?(amarchesini)
Comment 3•9 years ago
|
||
DevTools performance profiler doesn't use the same markers, so this won't affect that tool. If you want to piggyback the logic used for the perf tools' timeStamp marker, you can add the block to TimestampTimelineMarker's constructor, if that's possible, so we keep our marker generators in one place
Comment 4•9 years ago
|
||
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #3) > If you want to piggyback the logic used for the perf tools' timeStamp > marker, you can add the block to TimestampTimelineMarker's constructor, if > that's possible, so we keep our marker generators in one place I don't think that it would be simpler than what we're doing here since just sending the string through without reusing any of the existing meta data. It's just one line of code.
Assignee | ||
Comment 5•9 years ago
|
||
Activating devtools seem to actually affect to performance profiles so much, that I don't want this code to rely on that stuff.
Comment 6•9 years ago
|
||
The DT marker would only trigger if the docshell is set to record, so I was wrong, probably best to keep it out of that
Comment 7•9 years ago
|
||
Comment on attachment 8613704 [details] [diff] [review] v1 Review of attachment 8613704 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/Console.cpp @@ +870,5 @@ > + mProfiler = do_GetService("@mozilla.org/tools/profiler;1"); > + } > + if (mProfiler) { > + bool active = false; > + mProfiler->IsActive(&active); ok... in theory it cannot fail, but we don't know how this code evolve. I prefer: nsresult rv = mProfiler->IsActive(&active); if (NS_SUCCEEDED(mProfiler->IsActive(&active)) && active) { or otherwise we should add %{C++ inline bool IsActive() { bool active; return NS_SUCCEEDED(IsActive(&active)) && active; } %} in nsIProfiler.idl. ::: dom/base/Console.h @@ +18,5 @@ > #include "nsPIDOMWindow.h" > > class nsIConsoleAPIStorage; > class nsIXPConnectJSObjectHolder; > +class nsIProfiler; alphabetic order.
Attachment #8613704 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 8•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3f8269d2b491
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•