Closed
Bug 1167634
Opened 9 years ago
Closed 7 years ago
Make TaskTracer build and go on Windows
Categories
(Core :: Gecko Profiler, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox41 | --- | affected |
People
(Reporter: mayhemer, Unassigned)
References
Details
Attachments
(4 files)
7.00 KB,
patch
|
sinker
:
review-
|
Details | Diff | Splinter Review |
933 bytes,
patch
|
Details | Diff | Splinter Review | |
42.75 KB,
image/png
|
Details | |
60.32 KB,
image/png
|
Details |
No description provided.
Reporter | ||
Comment 1•9 years ago
|
||
bugzilla is broken, cannot attach a patch...
Reporter | ||
Comment 2•9 years ago
|
||
Reporter | ||
Updated•9 years ago
|
Attachment #8609872 -
Flags: review?(slin)
Comment 3•9 years ago
|
||
Comment on attachment 8609872 [details] [diff] [review] v1 Review of attachment 8609872 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for looking up TaskTracer on Windows, I've left some comments below, but Thinker might be a better fit for reviewer :) ::: tools/profiler/GeckoTaskTracer.cpp @@ +217,5 @@ > > void > InitTaskTracer(uint32_t aFlags) > { > + if (sInitCount++) { Does it get double init on Win platform? This will also break TaskTracer on b2g. ::: tools/profiler/TracedTaskCommon.h @@ +74,5 @@ > // their parents, e.g. The timer events. > class FakeTracedTask : public TracedTaskCommon > { > public: > + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(FakeTracedTask) Issue of FakeTracedTask will be fixed in bug 1113562, and the nit fix of TracedTaskCommon as well.
Attachment #8609872 -
Flags: review?(slin) → review?(tlee)
Reporter | ||
Comment 4•9 years ago
|
||
(In reply to Shelly Lin [:shelly] from comment #3) > Comment on attachment 8609872 [details] [diff] [review] > v1 > > Review of attachment 8609872 [details] [diff] [review]: > ----------------------------------------------------------------- > > Thanks for looking up TaskTracer on Windows, I've left some comments below, > but Thinker might be a better fit for reviewer :) > > ::: tools/profiler/GeckoTaskTracer.cpp > @@ +217,5 @@ > > > > void > > InitTaskTracer(uint32_t aFlags) > > { > > + if (sInitCount++) { > > Does it get double init on Win platform? Yes, I can give you callstacks if you want. > This will also break TaskTracer on b2g. Are you sure? If the system is initialized just once, this change should have no effect at all. > > ::: tools/profiler/TracedTaskCommon.h > @@ +74,5 @@ > > // their parents, e.g. The timer events. > > class FakeTracedTask : public TracedTaskCommon > > { > > public: > > + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(FakeTracedTask) > > Issue of FakeTracedTask will be fixed in bug 1113562, and the nit fix of > TracedTaskCommon as well. Good!
Depends on: 1113562
Comment 5•9 years ago
|
||
Comment on attachment 8609872 [details] [diff] [review] v1 Review of attachment 8609872 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for late! This patch is quite close to r+, but there is some minor changes or explanations required. ::: tools/profiler/GeckoTaskTracer.cpp @@ +285,5 @@ > { > TraceInfo* info = GetOrCreateTraceInfo(); > ENSURE_TRUE(info, 0); > > + uint32_t tid = gettid(); Please define pid_t as uint32_t, instead of changing code here. ::: tools/profiler/TracedTaskCommon.cpp @@ +21,5 @@ > TracedTaskCommon::Init() > { > TraceInfo* info = GetOrCreateTraceInfo(); > + if (!info) > + return; Why do we need to change this line? I expect info is always not null. Could you explain it ::: xpcom/base/VisualEventTracer.cpp @@ +628,5 @@ > > int32_t bytesWritten = PR_Write(fd, json.get(), json.Length()); > PR_Close(fd); > > + if (bytesWritten < 0 || (uint32_t)bytesWritten < json.Length()) { I guess |bytesWritten < json.length()| is always true if |bytesWritten < 0|. So, we can remove |bytesWritten < 0| here.
Attachment #8609872 -
Flags: review?(tlee) → review-
Reporter | ||
Comment 6•9 years ago
|
||
(In reply to Thinker Li [:sinker] from comment #5) > Comment on attachment 8609872 [details] [diff] [review] > v1 > > Review of attachment 8609872 [details] [diff] [review]: > ----------------------------------------------------------------- > > Sorry for late! This patch is quite close to r+, but there is some minor > changes or explanations required. > > ::: tools/profiler/GeckoTaskTracer.cpp > @@ +285,5 @@ > > { > > TraceInfo* info = GetOrCreateTraceInfo(); > > ENSURE_TRUE(info, 0); > > > > + uint32_t tid = gettid(); > > Please define pid_t as uint32_t, instead of changing code here. > > ::: tools/profiler/TracedTaskCommon.cpp > @@ +21,5 @@ > > TracedTaskCommon::Init() > > { > > TraceInfo* info = GetOrCreateTraceInfo(); > > + if (!info) > > + return; > > Why do we need to change this line? I expect info is always not null. > Could you explain it This is probably a left over from times GetOrCreateTraceInfo() didn't work on Win. I'll check whether it's fixed or not (and add an explanatory comment). > > ::: xpcom/base/VisualEventTracer.cpp > @@ +628,5 @@ > > > > int32_t bytesWritten = PR_Write(fd, json.get(), json.Length()); > > PR_Close(fd); > > > > + if (bytesWritten < 0 || (uint32_t)bytesWritten < json.Length()) { > > I guess |bytesWritten < json.length()| is always true if |bytesWritten < 0|. > So, we can remove |bytesWritten < 0| here. This code goes away completely in bug 1170534, so I can remove this change (I'll have to remerge anyway).
Reporter | ||
Comment 7•8 years ago
|
||
According my recent knowledge, TT should now build and run on desktop (mainly on Win) right now. Can you please confirm it? If so, I can close this bug then.
Flags: needinfo?(tlee)
Comment 8•8 years ago
|
||
Cervantes is the right person to confirm it now.
Flags: needinfo?(tlee) → needinfo?(cyu)
Comment 9•8 years ago
|
||
Bug 1221846 fixes TT on Linux and MacOS. I am not sure about Windows, but as for gettid() implementation, I don't think it works on Windows. At least we'll need gettid() counterpart on Windows in this patch. So I suggest we leave this bug open and fix what's missing on Windows.
Flags: needinfo?(cyu)
See Also: → 1221846
Comment 10•8 years ago
|
||
This fixes the missing gettid() on Windows.
Reporter | ||
Comment 11•8 years ago
|
||
(In reply to Cervantes Yu [:cyu] [:cervantes] from comment #10) > Created attachment 8708288 [details] [diff] [review] > The minimal patch to fix TT breakage on Windows > > This fixes the missing gettid() on Windows. Doesn't work. Anyway, I no longer want to be dependent on Task Tracer. I can see many more places I need to hook anyway.
Comment 14•7 years ago
|
||
TaskTracer builds on latest m-c now. I will check if it functions correctly.
Flags: needinfo?(cyu)
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
I think LogVirtualTablePtr() works correctly on Windows. See the screenshots from the VS debug session: When LogVirtualTablePtr() is called, parameter aVptr contains the value 0x7ff87e3d0aa8. VS recognizes it as {xul.dll!const nsTimerEvent::`vtable`for{`nsIRunnable`}} (attachment 8821494 [details]). To verify that the value is correct, go up several frames to where the event is dispatched (attachment 8821495 [details]), it can be seen that the runnable is actually an instance of nsTimerEvent, and the vptr value matches what is recorded in LogVirtualTablePtr(). So what we need to do is symbolication of the logged vptr values with the PDB symbols.
Comment 18•7 years ago
|
||
Is there any action needed for this bug?
Blocks: 1323076
Flags: needinfo?(cyu)
Comment 19•7 years ago
|
||
On the latest m-c and perf-html.io, there is nothing to do for this bug. I think we can close it.
Flags: needinfo?(cyu)
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•