| 39 | } |
| 40 | |
| 41 | void JVisualVM::beginProfilingImpl(shared_qobject_ptr<LaunchTask> process) |
| 42 | { |
| 43 | QProcess* profiler = new QProcess(this); |
| 44 | QStringList profilerArgs = { "--openpid", QString::number(process->pid()) }; |
| 45 | auto programPath = globalSettings->get("JVisualVMPath").toString(); |
| 46 | |
| 47 | profiler->setArguments(profilerArgs); |
| 48 | profiler->setProgram(programPath); |
| 49 | |
| 50 | connect(profiler, &QProcess::started, this, &JVisualVM::profilerStarted); |
| 51 | connect(profiler, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &JVisualVM::profilerFinished); |
| 52 | |
| 53 | profiler->start(); |
| 54 | m_profilerProcess = profiler; |
| 55 | } |
| 56 | |
| 57 | void JVisualVMFactory::registerSettings(SettingsObjectPtr settings) |
| 58 | { |