Closed Bug 1186880 Opened 10 years ago Closed 10 years ago

Performance timing api in workers should output entires if preference is enabled

Categories

(Core :: DOM: Workers, defect)

40 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
FxOS-S4 (07Aug)
Tracking Status
firefox42 --- fixed

People

(Reporter: arcturus, Assigned: arcturus)

References

Details

Attachments

(1 file, 4 obsolete files)

The performance timing api in content output any mark or measure if the preference 'dom.performance.enable_user_timing_logging' is enabled. This is used in some tools, like raptor, to extract and accumulate information. In workers we should be able to output to the console the entries information too, so we can benefit from those performance tools for workers too.
Assignee: nobody → francisco
Target Milestone: --- → FxOS-S3 (24Jul)
Attached patch v1.diff (obsolete) — Splinter Review
Hei Baku, I'm not a gecko person ;), but tried my best, please could you guide me towards having this ready?
Attachment #8637877 - Flags: feedback?(amarchesini)
Comment on attachment 8637877 [details] [diff] [review] v1.diff Review of attachment 8637877 [details] [diff] [review]: ----------------------------------------------------------------- looks good to me. ::: dom/workers/Performance.cpp @@ +22,5 @@ > Performance::Performance(WorkerPrivate* aWorkerPrivate) > : mWorkerPrivate(aWorkerPrivate) > { > mWorkerPrivate->AssertIsOnWorkerThread(); > + remove this empty line. @@ +71,5 @@ > +void > +Performance::InsertUserEntry(PerformanceEntry* aEntry) > +{ > + if (mWorkerPrivate->PerformanceLoggingEnabled()) { > + PERFLOG("Performance Entry: %s|%s|%s|%f|%f|%" PRIu64 "\n", Can you share this code with the main-thread code? Something like: void Performance::LogEntry(PerformanceEntry* aEntry, const nsAString& aScript);
Attachment #8637877 - Flags: feedback?(amarchesini) → feedback+
Attached patch v2.diff (obsolete) — Splinter Review
Suggestions added, ready for first r?
Attachment #8638176 - Flags: review?(amarchesini)
Comment on attachment 8638176 [details] [diff] [review] v2.diff Review of attachment 8638176 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsPerformance.cpp @@ +743,5 @@ > if(NS_FAILED(rv)) { > // If we have no URI, just put in "none". > uri.AssignLiteral("none"); > } > + PerformanceBase::LogEntry(aEntry, NS_ConvertUTF8toUTF16(uri)); Just pass uri in utf8. @@ +973,5 @@ > ClearUserEntries(aName, NS_LITERAL_STRING("measure")); > } > > void > +PerformanceBase::LogEntry(PerformanceEntry* aEntry, const nsAString& aOwner) const nsACString& aOwner @@ +976,5 @@ > void > +PerformanceBase::LogEntry(PerformanceEntry* aEntry, const nsAString& aOwner) > +{ > + PERFLOG("Performance Entry: %s|%s|%s|%f|%f|%" PRIu64 "\n", > + NS_ConvertUTF16toUTF8(aOwner).get(), No additional converts. ::: dom/base/nsPerformance.h @@ +349,5 @@ > { > return mResourceEntries.Length() >= mResourceTimingBufferSize; > } > > + void LogEntry(PerformanceEntry* aEntry, const nsAString& aOwner); void LogEntry(PerformanceEntry* aEntry, const nsACString& aOWner) const; ::: dom/workers/Performance.cpp @@ +62,5 @@ > +void > +Performance::InsertUserEntry(PerformanceEntry* aEntry) > +{ > + if (mWorkerPrivate->PerformanceLoggingEnabled()) { > + PerformanceBase::LogEntry(aEntry, mWorkerPrivate->ScriptURL()); NS_ConvertUTF16toUTF8(mWorkerPrivate->ScriptURL()
Attachment #8638176 - Flags: review?(amarchesini) → review+
Target Milestone: FxOS-S3 (24Jul) → FxOS-S4 (07Aug)
Attached patch v3.diff (obsolete) — Splinter Review
v3 with latest comments, but not compiling getting the following errors: https://pastebin.mozilla.org/8840719
Attachment #8637877 - Attachment is obsolete: true
Attachment #8638176 - Attachment is obsolete: true
Flags: needinfo?(amarchesini)
Comment on attachment 8639342 [details] [diff] [review] v3.diff Review of attachment 8639342 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsPerformance.cpp @@ +977,5 @@ > +PerformanceBase::LogEntry(PerformanceEntry* aEntry, > + const nsACString& aOwner) const > +{ > + PERFLOG("Performance Entry: %s|%s|%s|%f|%f|%" PRIu64 "\n", > + aOwner, 1. indentation 2. aOwner.get()
Attached patch v4.patch (obsolete) — Splinter Review
Attachment #8639342 - Attachment is obsolete: true
Attachment #8639821 - Flags: review?(amarchesini)
Comment on attachment 8639821 [details] [diff] [review] v4.patch Review of attachment 8639821 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsPerformance.cpp @@ +976,5 @@ > void > +PerformanceBase::LogEntry(PerformanceEntry* aEntry, const nsACString& aOwner) const > +{ > + PERFLOG("Performance Entry: %s|%s|%s|%f|%f|%" PRIu64 "\n", > + aOwner.BeginReading(), Indentation. aOwner should be under the " ::: dom/workers/Performance.cpp @@ +62,5 @@ > +void > +Performance::InsertUserEntry(PerformanceEntry* aEntry) > +{ > + if (mWorkerPrivate->PerformanceLoggingEnabled()) { > + PerformanceBase::LogEntry(aEntry, NS_ConvertUTF16toUTF8(mWorkerPrivate->ScriptURL())); 80chars. Put NS_ConvertUTF.. under aEntry.
Attachment #8639821 - Flags: review?(amarchesini) → review+
Attached patch v5.patchSplinter Review
Done :)
Attachment #8639821 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Flags: needinfo?(amarchesini) → needinfo?
Flags: needinfo?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: