We only have one global Sampler, gSampler, and so SamplerRegistry is just an
unnecessary and obfuscating wrapper around it.
--HG--
extra : rebase_source : b675c414d0081dab2cd7dac864ffdff5070afe7d
StaticMutexes don't need to be created or destroyed, which avoids the need for
checking if they still exist.
This patch also adds locking to a few functions that lacked it. Every access to
sRegisteredThreads is now protected appropriately.
--HG--
extra : rebase_source : 2ea1d7372652ddd532e6e98c167be0997df33f07
Sampler::sRegisteredThreadsMutex is public. Might as well make
Sampler::sRegisteredThreads public too. This allows the getter to be removed,
and makes the code a little easier to read.
--HG--
extra : rebase_source : 4ff3ba92c9d74ae1b10a2be227ca15f61d15bee2
This patch makes it possible to collect code coverage for xpcshell tests using the linux64-jsdcov build. It also enables the use of a 'coverage' flag to disable tests when they are instrumented with the js debugger for code coverage. Lastly, it uses the 'coverage' flag to disable certain tests.
MozReview-Commit-ID: 97VFkJmlwQn
--HG--
extra : rebase_source : 26c841f5a68f927889c0903e701bfde4b7ca84ac
Back when the class was written, for the packaging code, it made sense
that the default was True. But now that it's used all over the place,
and that the vast majority of uses are with find_executables=False, it
makes more sense for that to be the default.
--HG--
extra : rebase_source : ff813735fc0d53093f348f20eb77ee03e9b09d4e
The patch also moves some Sampler methods from platform.cpp to Sampler.cpp. Now
all Sampler methods are in Sampler.cpp except for a small number of
platform-specific ones, which are in platform-*.cpp.
--HG--
rename : tools/profiler/core/GeckoSampler.cpp => tools/profiler/core/Sampler.cpp
extra : rebase_source : a13862dccfcb1c78567cc9eb22e92b8410d2e544
There's no point having them as separate classes. This removes the need for
some virtual functions, too.
--HG--
extra : rebase_source : b2607ba2431ae043b6e015f4f435b0d660b02d71
They're defined separately for each platform, but the definitions are almost
identical and can be commoned up.
--HG--
extra : rebase_source : 67b7f88410db1951a20f03f6c156aa6b35a3ee20
It's a clumsy cross-platform abstraction. GetCurrentId() and tid_t are the only
genuinely cross-platform things in it, and the patch keeps those in place.
The remaining methods are not implemented on all platforms (none are
implemented on Linux) and the fields are all used on either Mac or Windows, but
not both. So the patch moves the relevant Thread method implementations and
fields into the existing SamplerThread classes. There is sufficiently little
overlap between the two SamplerThread classes that there is no point sharing a
base class between them. This avoids the need for virtual functions, and
simplifies thread naming on Mac.
The patch also changes some of the existing code to use Gecko style, e.g.
|mFoo| instead of |foo_| for class fields.
This variable is set in GeckoSampler's destructor and cleared in GeckoSampler's
destructor, which means it's just another handle to the GeckoSampler singleton,
which means it duplicates gSampler.
This patch replaces its uses with gSampler uses. This exposes various places
where GeckoSampler is being accessed off the main thread, which I have marked
with XXX comments.
--HG--
extra : rebase_source : 3c2d012b4d38d353022f384c31a528096a462711
There is a single GeckoSampler and it is currently only accessed on the main
thread, so it's silly to use TLS for it; a normal global variable is better.
This patch also adds main thread assertions to a number of the profiler_*()
functions. Even though bug 1330184 may get rid of some of them, right now they
are a useful as both a sanity check and documentation.
--HG--
extra : rebase_source : 7613eb3cc8089b31180365f6463c81f4556c7b66
Note that the comment on ::Mutex said that it should support recursive locking,
but GeckoMutex was implemented using mozilla::Mutex which does *not* support
recursive locking.
The patch also removes OS::CreateMutex(), because it's only used twice and
doesn't make the code more concise.
--HG--
extra : rebase_source : 81f324cb3856ea5329d8b6edb457c8ec44395c56