mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 942488 - Don't report pseudo-stacks without SPS profiler. r=nchen
This commit is contained in:
parent
5cd1075cce
commit
b25abb6817
@ -50,8 +50,11 @@ ThreadStackHelper::Shutdown()
|
||||
}
|
||||
|
||||
ThreadStackHelper::ThreadStackHelper()
|
||||
: mPseudoStack(mozilla_get_pseudo_stack())
|
||||
, mStackBuffer()
|
||||
:
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
mPseudoStack(mozilla_get_pseudo_stack()),
|
||||
#endif
|
||||
mStackBuffer()
|
||||
, mMaxStackSize(mStackBuffer.capacity())
|
||||
{
|
||||
#if defined(XP_LINUX)
|
||||
@ -147,15 +150,20 @@ ThreadStackHelper::SigAction(int aSignal, siginfo_t* aInfo, void* aContext)
|
||||
bool
|
||||
ThreadStackHelper::PrepareStackBuffer(Stack& aStack) {
|
||||
aStack.clear();
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
if (!mPseudoStack) {
|
||||
return false;
|
||||
}
|
||||
mStackBuffer.clear();
|
||||
return mStackBuffer.reserve(mMaxStackSize);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ThreadStackHelper::FillStackBuffer() {
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
size_t reservedSize = mMaxStackSize;
|
||||
|
||||
// Go from front to back
|
||||
@ -170,6 +178,7 @@ ThreadStackHelper::FillStackBuffer() {
|
||||
}
|
||||
// If we exited early due to buffer size, expand the buffer for next time
|
||||
mMaxStackSize += (end - entry);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -40,7 +40,9 @@ public:
|
||||
typedef Telemetry::HangHistogram::Stack Stack;
|
||||
|
||||
private:
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
const PseudoStack* const mPseudoStack;
|
||||
#endif
|
||||
Stack mStackBuffer;
|
||||
size_t mMaxStackSize;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user