Commit Graph

7 Commits

Author SHA1 Message Date
Michael Layzell
9782242b7e Bug 1367406 - Part 1: Add interleaved stack functionality to HangStack, r=froydnj
- This patch was written in 3 interdependent parts, which are described below -

Part 1A: Allow HangStack to contain raw PCs and Module offsets, r=froydnj

The HangStack previously consisted of an array of const char* pointers into its
backing string buffer, which represented pseudostack entries. With interleaved
stacks, it is now possible for the stack to contain raw unresolved program
counters (Kind::PC), and module/offset pairs (Kind::MODOFFSET). To do this, we
use a discriminated union, and make the backing array use the discriminated
union instead of const char*s.

The code cannot use mozilla::Variant<const char*, uintptr_t, Module>
unfortuantely, as we cannot use the implementation of ParamTraits for Variant in
HangStack's ParamTraits implementation.

When deserializing a HangStack over IPC, we need to read the string frame
entries into the backing string buffer, and generate const char* entries for
each of the strings which we read in over IPC. The default implementation of
ParamTraits wouldn't give us access to the enclusing HangStack object while
deserializing each individual entry, so we couldn't use it. In fact, Entries
don't have ParamTraits implemented for them at all, and can only be sent over
IPC as part of a HangStack due to this dependency.

Part 1B: Remove nsIHangDetails.pseudoStack, replace ProcessedStack w/ new HangStack type, r=froydnj

Previously there were two stack objects on each HangDetails object: mStack and
mPseudoStack. mStack was a Telemetry::ProcessedStack, while mPseudoStack was a
HangStack. After the changes in part 1A, HangStack can now contain all of the
information of both the old HangStack and ProcessedStack, so the mPseudoStack
field is renamed to mStack, and the old mStack field is removed.

This patch also implements the new GetStack getter, which generates the JS data
format for the new HangStack type.

Part 1C: Collect interleaved stacks w/ ProfilerStackCollector API in ThreadStackHelper, r=froydnj

This new API was added by njn in bug 1380286, and provides both pseudostack and
native stack entries to the consumer of the API.

This patch changes ThreadStackHelper to use this new API instead of the previous
one, and use it to collect the frames directly into HangStack objects.
2017-08-16 11:44:02 -04:00
Michael Layzell
f2fe978e6f Bug 1380081 - Part 7: Add all necessary data for BHR to nsIHangDetails, r=froydnj
We're going to use HangDetails as the type containing hang information. We'll
have a JS component which reads the data out of nsIHangDetails, builds the
payload, and submits it to telemetry for us.

We'll do it in JS because telemetry has to be submitted from JS.

This patch also adds IPC serization for the relevant types so that we can send
HangDetails objects over IPDL.

MozReview-Commit-ID: CeikKabY9Vs
2017-08-15 16:35:39 -04:00
Michael Layzell
7b4695ef97 Bug 1380081 - Part 4: Move BHR into its own component, r=froydnj
MozReview-Commit-ID: 7TOGofAYM6W
2017-08-15 16:35:00 -04:00
Sebastian Hengst
8b5eefd3f4 Backed out changeset 68bec6464338 (bug 1380081) 2017-08-11 09:28:42 +02:00
Sebastian Hengst
e67b0c168b Backed out changeset 6bc453505dc3 (bug 1380081) 2017-08-11 09:28:27 +02:00
Michael Layzell
ed445e5753 Bug 1380081 - Part 7: Add all necessary data for BHR to nsIHangDetails, r=froydnj
We're going to use HangDetails as the type containing hang information. We'll
have a JS component which reads the data out of nsIHangDetails, builds the
payload, and submits it to telemetry for us.

We'll do it in JS because telemetry has to be submitted from JS.

This patch also adds IPC serization for the relevant types so that we can send
HangDetails objects over IPDL.

MozReview-Commit-ID: CeikKabY9Vs
2017-08-10 15:55:12 -04:00
Michael Layzell
256d95d616 Bug 1380081 - Part 4: Move BHR into its own component, r=froydnj
MozReview-Commit-ID: 7TOGofAYM6W
2017-08-10 15:55:12 -04:00