Delegating to mozilla::Runnable caused us to return the wrong value once
SchedulerGroup started passing a non-empty name to the Runnable constructor.
MozReview-Commit-ID: 2zMlpiMnHwv
We rely partly on the constructor to set Registers, and partly on subsequent
assignments. This patch changes things so we rely entirely on subsequent
assignments, for consistency.
--HG--
extra : rebase_source : ca69186f5755003e710985bfb40c90072067305c
We can use a static ucontext_t on Linux for synchronous samples instead of
declaring one on the stack in profiler_get_backtrace(). This neatens
SyncPopulate()'s signature.
SyncPopulate() is also only used when HAVE_NATIVE_UNWIND is defined, so the
patch guards the definitions.
--HG--
extra : rebase_source : b71e6d76f24b37bc236ac8f4359d401b1551e2de
The patch:
- Removes some unnecessary forward declarations.
- Moves some macros to more logical locations.
- Improves and removes some comments.
--HG--
extra : rebase_source : 23f1de029bbe4a37d2cc1ebe1df76e9a6aa1b335
It's bugged me for some time that the comments explaining what all the
PROFILER_* macros do are on the empty definitions that are used when the
profiler is disabled. This patch switches the order.
--HG--
extra : rebase_source : d783aa996f91b305cbebd678e6652d6bc939fb98
This patch does the following.
- Renames some ProfilerMarkerPayload subclasses so they all of the form
"FooMarkerPayload", to make the subclass relationship clearer.
(ProfilerMarkerTracing -- now TracingMarkerPayload -- was the worst
offender.)
- Removes ProfilerMarkerImagePayload and TouchDataPayload, neither of which are
used.
- Changes streamCommonProps() to StreamCommonProps().
- Does some minor style and comment fixes in ProfilerMarkerPayload.h.
--HG--
extra : rebase_source : dd732905e96da83bcbf124c70b20011c661fc332
Once the |aPayload| argument to profile_add_marker() became a UniquePtr the
default value of nullptr caused compilation difficulties that could only be
fixed by #including ProfilerMarkerPayload.h into lots of additional places
(because the UniquePtr<T> instantiation required the T to be fully defined). To
get around this I just split profile_add_marker() into two functions, one with
1 argument and one with 2 arguments.
The patch also removes the definition of PROFILER_MARKER_PAYLOAD in the case
where MOZ_GECKO_PROFILER isn't defined. A comment explains why.
Bug 1357829 added a third kind of sample, in addition to the existing
"periodic" and "synchronous" samples. This patch cleans things up around that
change. In particular, it cleans up TickSample, which is a mess of semi-related
things.
The patch does the following.
- It removes everything from TickSample except the register values and renames
TickSample as Registers. Almost all the removed stuff is available in
ThreadInfo anyway, and the patch adds a ThreadInfo argument to various
functions. (Doing it this way wasn't possible until recently because a
ThreadInfo wasn't available in profiler_get_backtrace() until recently.)
One non-obvious consequence: in synchronous samples we used to use a value of
0 for the stackTop. Because synchronous samples now use ThreadInfo directly,
they are able to use the proper stack top value from ThreadInfo::mStackTop.
This will presumably only improve the quality of the stack traces.
- It splits Tick() in two and renames the halves DoPeriodicSample() and
DoSyncSample().
- It reorders arguments in some functions so that ProfileBuffer (the output) is
always last, and inputs are passed in roughly the order they are obtained.
- It adds a comment at the top of platform.cpp explaining the three kinds of
sample.
- It renames a couple of other things.
--HG--
extra : rebase_source : 4f1e69c605102354dd56ef7af5ebade201e1d106