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; }
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; }
void mozilla_sampler_print_location1() { if (!stack_key_initialized) profiler_init(NULL); SyncProfile* syncProfile = NewSyncProfile(); if (!syncProfile) { return; } syncProfile->BeginUnwind(); doSampleStackTrace(syncProfile->GetPseudoStack(), *syncProfile, NULL); syncProfile->EndUnwind(); printf_stderr("Backtrace:\n"); syncProfile->IterateTags(print_callback); delete syncProfile; }
void mozilla_sampler_print_location1() { if (!stack_key_initialized) profiler_init(nullptr); SyncProfile* syncProfile = NewSyncProfile(); if (!syncProfile) { return; } syncProfile->BeginUnwind(); doSampleStackTrace(*syncProfile, nullptr, false); syncProfile->EndUnwind(); printf_stderr("Backtrace:\n"); syncProfile->IterateTags(print_callback); ThreadInfo* info = syncProfile->GetThreadInfo(); delete syncProfile; delete info; }