SyncProfile* TableTicker::GetBacktrace() { SyncProfile* profile = NewSyncProfile(); TickSample sample; sample.threadProfile = profile; #if defined(XP_WIN) || defined(LINUX) tickcontext_t context; sample.PopulateContext(&context); #elif defined(XP_MACOSX) sample.PopulateContext(nullptr); #endif sample.isSamplingCurrentThread = true; sample.timestamp = mozilla::TimeStamp::Now(); if (!HasUnwinderThread()) { profile->BeginUnwind(); } Tick(&sample); if (!HasUnwinderThread()) { profile->EndUnwind(); } return profile; }
SyncProfile* GeckoSampler::GetBacktrace() { SyncProfile* profile = NewSyncProfile(); TickSample sample; sample.threadProfile = profile; #if defined(HAVE_NATIVE_UNWIND) #if defined(XP_WIN) || defined(LINUX) tickcontext_t context; sample.PopulateContext(&context); #elif defined(XP_MACOSX) sample.PopulateContext(nullptr); #endif #endif sample.isSamplingCurrentThread = true; sample.timestamp = mozilla::TimeStamp::Now(); profile->BeginUnwind(); Tick(&sample); profile->EndUnwind(); return profile; }