예제 #1
0
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;
}
예제 #2
0
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;
}
예제 #3
0
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;
}
예제 #4
0
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;
}