Doing so made it clearer that gThreadNameFilters was being accessed from
multiple threads without synchronization, so I added a Mutex for it.
--HG--
extra : rebase_source : 60d9f4df76ed04cb5ce1b8232bbeb9c795b66535
They don't particularly belong there, and Sampler will be going away eventually
anyway.
--HG--
extra : rebase_source : 4faab111925848215f7e8db8244b33ee46c5396c
I am planning to merge Sampler into platform.cpp, so Sampler.cpp will
disappear. This change will make that easier, because things that temporarily
need to be visible in both files won't need to be declared in a header.
--HG--
extra : rebase_source : f0fa4751f6ead945c1a00a17dbc9a7d3dc870e4b
platform-*.cc and platform.cpp belong together conceptually, and combining them
into a single compilation unit makes it easier to share things and avoids the
need for some declarations in headers.
The patch also removes old_sigsave_signal_handler_ which is a long-dead field
that clang now detects and complains about.
--HG--
extra : rebase_source : 092a7ca608415b888607dba38ad5296787af824e
This patch adds NS_IsMainThread() assertions to all main-thread-only
profiler_*() functions that currently lack them, and adds comments to those
that run on multiple threads. As a result, it's now clear for every
profiler_*() function which threads it runs on.
--HG--
extra : rebase_source : 9a1b00f040a7bfc477ceee701ad6af165b468f4e
PseudoStack lifetimes are predictable because they match thread lifetimes.
There is no need for refcounting.
This patch:
- Removes the refcounting, along with StackOwningThreadInfo.
- Makes PseudoStack's ctor and dtor public, and removes the Create() method.
- Changes popAndMaybeDelete() to pop().
- Removes PseudoStack::isEmpty(), which is dead.
- Adds various comments to make clear how things now work.
--HG--
extra : rebase_source : 3a135fcf137997a6fbc09b408ff28ee846217e63
Sampler's constructor and destructor are inlined into profiler_{start,stop}(),
respectively. A trivial Sampler class is left behind (now in platform.cpp)
because there are still numerous gSampler null checks, which I will remove in a
follow-up bug.
PseudoStack::flushSamplerOnShutdown() moves into platform.cpp. MAXPATHLEN is
unused and is deleted.
Two of them (mAddMainThreadIO and mPrivacyMode) are now local variables within
profiler_start(), which is nice.
This change also lets us get rid of four sIs* variables.
It's fairly straightforward, and measures the important parts of:
- Sampler, PseudoStack, ProfileBuffer, ThreadInfo.
- LUL, PriMap, SecMap
Coverage isn't perfect, but it gets the major things I found via DMD on Linux.
Example output in about:memory:
├──151.21 MB (49.73%) -- profiler
│ ├──141.49 MB (46.53%) ── lul
│ └────9.72 MB (03.20%) ── sampler
--HG--
extra : rebase_source : 67d2ada42aead43f68f5100a08204a1d1f1cfceb
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