2014-02-15 18:49:35 +05:30
|
|
|
#include "BaseProfiler.h"
|
|
|
|
|
2014-02-15 22:45:41 +05:30
|
|
|
#include <QProcess>
|
|
|
|
|
2015-02-09 06:21:14 +05:30
|
|
|
BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent)
|
|
|
|
: BaseExternalTool(settings, instance, parent)
|
2014-02-15 18:49:35 +05:30
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-07-04 23:32:43 +05:30
|
|
|
void BaseProfiler::beginProfiling(std::shared_ptr<BaseLauncher> process)
|
2014-02-15 18:49:35 +05:30
|
|
|
{
|
|
|
|
beginProfilingImpl(process);
|
|
|
|
}
|
|
|
|
|
2014-02-16 13:24:52 +05:30
|
|
|
void BaseProfiler::abortProfiling()
|
|
|
|
{
|
2014-02-16 14:00:38 +05:30
|
|
|
abortProfilingImpl();
|
2014-02-16 13:24:52 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
void BaseProfiler::abortProfilingImpl()
|
|
|
|
{
|
|
|
|
if (!m_profilerProcess)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
m_profilerProcess->terminate();
|
|
|
|
m_profilerProcess->deleteLater();
|
2014-02-16 14:00:38 +05:30
|
|
|
m_profilerProcess = 0;
|
|
|
|
emit abortLaunch(tr("Profiler aborted"));
|
2014-02-16 13:24:52 +05:30
|
|
|
}
|
|
|
|
|
2014-03-30 23:41:05 +05:30
|
|
|
BaseProfiler *BaseProfilerFactory::createProfiler(InstancePtr instance, QObject *parent)
|
2014-02-15 18:49:35 +05:30
|
|
|
{
|
2014-02-16 15:16:14 +05:30
|
|
|
return qobject_cast<BaseProfiler *>(createTool(instance, parent));
|
2014-02-15 18:49:35 +05:30
|
|
|
}
|