Пример #1
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;
}
Пример #2
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;
}
Пример #3
0
void SyncScheduler::rescheduleBackgroundActivity(const QString& aProfileName)
{
    FUNCTION_CALL_TRACE;

    SyncProfile* profile = iProfileManager.syncProfile(aProfileName);
    if (profile) {
        if (profile->syncExternallyEnabled() || profile->syncExternallyDuringRush()) {
            emit externalSyncChanged(profile, false);
        }
        setNextAlarm(profile);
    } else {
        LOG_WARNING("Invalid profile, can't reschedule switch timer for " << aProfileName);
    }
}
Пример #4
0
ClientPlugin::ClientPlugin( const QString& aPluginName,
                            const SyncProfile& aProfile,
                            PluginCbInterface *aCbInterface )
:   SyncPluginBase( aPluginName, aProfile.name(), aCbInterface ),
    iProfile( aProfile )
{
}
Пример #5
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;
}
Пример #6
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;
}
Пример #7
0
bool syncSessionPointerLessThan(SyncSession *&aLhs, SyncSession *&aRhs)
{
    if (aLhs && aRhs) {
        // Manual sync has higher priority than scheduled sync.
        if (aLhs->isScheduled() != aRhs->isScheduled())
            return !aLhs->isScheduled();

        SyncProfile *lhsProfile = aLhs->profile();
        SyncProfile *rhsProfile = aRhs->profile();
        if (lhsProfile == 0 || rhsProfile == 0)
            return false;

        // Device sync has higher priority than online sync.
        SyncProfile::DestinationType lhsDestType = lhsProfile->destinationType();
        SyncProfile::DestinationType rhsDestType = rhsProfile->destinationType();
        if (lhsDestType != rhsDestType)
            return (lhsDestType == SyncProfile::DESTINATION_TYPE_DEVICE);
    }

    return false;
}
Пример #8
0
OOPClientPlugin::OOPClientPlugin(const QString& aPluginName,
                                 const SyncProfile& aProfile,
                                 PluginCbInterface* aCbInterface,
                                 QProcess &aProcess ) : 
    ClientPlugin( aPluginName, aProfile, aCbInterface ), iDone( false )
{
    FUNCTION_CALL_TRACE;

    // randomly-generated profile names cannot be registered
    // as dbus service paths due to being purely numeric.
    QString profileName = aProfile.name();
    int numericIdx = profileName.indexOf(QRegExp("[0123456789]"));
    QString servicePath = numericIdx == 0
                        ? QString(QLatin1String("%1%2%3"))
                              .arg(DBUS_SERVICE_NAME_PREFIX)
                              .arg("profile-")
                              .arg(profileName)
                        : QString(QLatin1String("%1%2"))
                              .arg(DBUS_SERVICE_NAME_PREFIX)
                              .arg(profileName);

    // Initialise dbus for client
    iOopPluginIface = new ButeoPluginIface( servicePath,
                                         DBUS_SERVICE_OBJ_PATH,
                                         QDBusConnection::sessionBus()
                                       );
    iOopPluginIface->setTimeout(60000); // one minute.

    // Chain the signals received over dbus
    connect(iOopPluginIface, SIGNAL(transferProgress(const QString &,
            Sync::TransferDatabase, Sync::TransferType, const QString &, int)),
        this, SIGNAL(transferProgress(const QString &,
            Sync::TransferDatabase, Sync::TransferType, const QString &, int)));

    connect(iOopPluginIface, SIGNAL(error(QString,QString,int)),
        this, SLOT(onError(QString,QString,int)));

    connect(iOopPluginIface, SIGNAL(success(QString,QString)),
        this, SLOT(onSuccess(QString,QString)));

    connect(iOopPluginIface, SIGNAL(accquiredStorage(const QString &)),
        this, SIGNAL(accquiredStorage(const QString &)));

    connect(iOopPluginIface,SIGNAL(syncProgressDetail(const QString &,int)),
            this ,SIGNAL(syncProgressDetail(const QString &,int)));

    // Handle the signals from the process
    connect(&aProcess, SIGNAL(error(QProcess::ProcessError)),
            this, SLOT(onProcessError(QProcess::ProcessError)));

    connect(&aProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
            this, SLOT(onProcessFinished(int,QProcess::ExitStatus)));
}
Пример #9
0
OOPClientPlugin::OOPClientPlugin(const QString& aPluginName,
                                 const SyncProfile& aProfile,
                                 PluginCbInterface* aCbInterface,
                                 QProcess &aProcess ) : 
    ClientPlugin( aPluginName, aProfile, aCbInterface )
{
    FUNCTION_CALL_TRACE;

    // Initialise dbus for client
    iOopPluginIface = new ButeoPluginIface( DBUS_SERVICE_NAME_PREFIX + aProfile.name(),
                                         DBUS_SERVICE_OBJ_PATH,
                                         QDBusConnection::sessionBus()
                                       );
    iOopPluginIface->setTimeout(60000); // one minute.

    // Chain the signals received over dbus
    connect(iOopPluginIface, SIGNAL(transferProgress(const QString &,
            Sync::TransferDatabase, Sync::TransferType, const QString &, int)),
        this, SIGNAL(transferProgress(const QString &,
            Sync::TransferDatabase, Sync::TransferType, const QString &, int)));

    connect(iOopPluginIface, SIGNAL(error(const QString &, const QString &, int)),
        this, SIGNAL(error(const QString &, const QString &, int)));

    connect(iOopPluginIface, SIGNAL(success(const QString &, const QString &)),
        this, SIGNAL(success(const QString &, const QString &)));

    connect(iOopPluginIface, SIGNAL(accquiredStorage(const QString &)),
        this, SIGNAL(accquiredStorage(const QString &)));

    connect(iOopPluginIface,SIGNAL(syncProgressDetail(const QString &,int)),
    		this ,SIGNAL(syncProgressDetail(const QString &,int)));

    connect(&aProcess, SIGNAL(error(QProcess::ProcessError)),
            this, SIGNAL(processError(QProcess::ProcessError)));

    connect(&aProcess, SIGNAL(finished(int, QProcess::ExitStatus)),
            this, SIGNAL(processFinished(int,QProcess::ExitStatus)));
}