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)
Tracking
()
RESOLVED
FIXED
FxOS-S4 (07Aug)
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: arcturus, Assigned: arcturus)
References
Details
Attachments
(1 file, 4 obsolete files)
10.53 KB,
patch
|
Details | Diff | Splinter Review |
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 | ||
Updated•10 years ago
|
Assignee: nobody → francisco
Blocks: nga-toolkit-service-workers
Target Milestone: --- → FxOS-S3 (24Jul)
Assignee | ||
Comment 1•10 years ago
|
||
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 2•10 years ago
|
||
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+
Assignee | ||
Comment 3•10 years ago
|
||
Suggestions added, ready for first r?
Attachment #8638176 -
Flags: review?(amarchesini)
Comment 4•10 years ago
|
||
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+
Assignee | ||
Updated•10 years ago
|
Target Milestone: FxOS-S3 (24Jul) → FxOS-S4 (07Aug)
Assignee | ||
Comment 5•10 years ago
|
||
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 6•10 years ago
|
||
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()
Assignee | ||
Comment 7•10 years ago
|
||
Last version, try push:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d9528555bd2b
Attachment #8639342 -
Attachment is obsolete: true
Attachment #8639821 -
Flags: review?(amarchesini)
Comment 8•10 years ago
|
||
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+
Assignee | ||
Comment 9•10 years ago
|
||
Done :)
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Updated•10 years ago
|
Attachment #8639821 -
Attachment is obsolete: true
Comment 10•10 years ago
|
||
Keywords: checkin-needed
Comment 11•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(amarchesini) → needinfo?
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?
You need to log in
before you can comment on or make changes to this bug.
Description
•