2014-02-15 18:49:35 +05:30
|
|
|
#include "BaseProfiler.h"
|
2019-04-08 03:29:04 +05:30
|
|
|
#include "QObjectPtr.h"
|
2014-02-15 18:49:35 +05:30
|
|
|
|
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)
|
2018-07-15 18:21:05 +05:30
|
|
|
: BaseExternalTool(settings, instance, parent)
|
2014-02-15 18:49:35 +05:30
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-04-08 03:29:04 +05:30
|
|
|
void BaseProfiler::beginProfiling(shared_qobject_ptr<LaunchTask> process)
|
2014-02-15 18:49:35 +05:30
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
beginProfilingImpl(process);
|
2014-02-15 18:49:35 +05:30
|
|
|
}
|
|
|
|
|
2014-02-16 13:24:52 +05:30
|
|
|
void BaseProfiler::abortProfiling()
|
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
abortProfilingImpl();
|
2014-02-16 13:24:52 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
void BaseProfiler::abortProfilingImpl()
|
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
if (!m_profilerProcess)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
m_profilerProcess->terminate();
|
|
|
|
m_profilerProcess->deleteLater();
|
|
|
|
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
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
return qobject_cast<BaseProfiler *>(createTool(instance, parent));
|
2014-02-15 18:49:35 +05:30
|
|
|
}
|