Closed Bug 911822 Opened 7 years ago Closed 6 years ago

Tracelogging doesn't record stop events for all start events

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: till, Assigned: h4writer)

Details

Attachments

(2 files)

I'm trying to add script-location-based filtering to the tracelogging converter script.

Running a tracelogging-enabled browser build, I'm running into a situation where the log's entries aren't balanced: there are fewer stop than start events.

Starting the browser to about:blank (restored from the previous session) and then immediately closing it creates a tracelogging.log file with 9133 "start,script" events, but only 8926 "stop,script" ones. In total, there are 9395 start and 9187 stop events, a difference of 208.

Note that the difference between the "start,script" and "stop,script" events is only 207, I don't know if the one other missing stop is important, though.
This fixes the issue with the wrong stop events.

(Though browser is logging with multiple threads on the defaultlogger. So not ideal to use in current state!)
Assignee: general → hv1989
Attachment #804758 - Flags: review?(till)
@Till this is a WIP patch to log different threads to different loggers. I use pthread_self() to distinguish them. So with that patch logging workers and browser should work. I don't know the cost of pthread_self(). But it shouldn't matter too much, since baseline/ionmonkey save the loggers pointer, instead of finding out through pthread_self().

Using the above patch and this patch I managed to log a browser starting up and closing again, without issues.
Comment on attachment 804758 [details] [diff] [review]
Add stop events on the right place

Review of attachment 804758 [details] [diff] [review]:
-----------------------------------------------------------------

\o/
Attachment #804758 - Flags: review?(till) → review+
(In reply to Hannes Verschore [:h4writer] from comment #2)
> Created attachment 804763 [details] [diff] [review]
> WIP browser logging
> 
> @Till this is a WIP patch to log different threads to different loggers. I
> use pthread_self() to distinguish them. So with that patch logging workers
> and browser should work. I don't know the cost of pthread_self(). But it
> shouldn't matter too much, since baseline/ionmonkey save the loggers
> pointer, instead of finding out through pthread_self().

From a cursory read-through, this looks pretty much right, yes. For tracelogging to work on Windows, you'll have to replace pthread_self() by something portable, though. I don't know if calling GetCurrentThreadId from windows.h inside the right #ifdef magic does the trick, but it might.
https://hg.mozilla.org/mozilla-central/rev/13eeedac24b4
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.