Valgrind: Support CallgrindTool re-running

Change-Id: I2a4d6e75afed60e455ec2267f18f381e3b19157f
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-15 09:28:34 +01:00
parent 7e127b4e33
commit a3b22a6673
2 changed files with 20 additions and 18 deletions

View File

@@ -30,7 +30,6 @@ CallgrindToolRunner::CallgrindToolRunner(RunControl *runControl)
: ValgrindToolRunner(runControl)
{
setId("CallgrindToolRunner");
runControl->setSupportsReRunning(false);
connect(&m_runner, &ValgrindProcess::valgrindStarted, this, [this](qint64 pid) {
m_pid = pid;

View File

@@ -708,6 +708,26 @@ void CallgrindTool::setupRunner(CallgrindToolRunner *toolRunner)
connect(toolRunner, &CallgrindToolRunner::parserDataReady, this, &CallgrindTool::setParserData);
connect(runControl, &RunControl::stopped, this, &CallgrindTool::engineFinished);
connect(runControl, &RunControl::aboutToStart, this, [this, toolRunner] {
toolRunner->setPaused(m_pauseAction->isChecked());
// we may want to toggle collect for one function only in this run
toolRunner->setToggleCollectFunction(m_toggleCollectFunction);
m_toggleCollectFunction.clear();
m_toolBusy = true;
updateRunActions();
// enable/disable actions
m_resetAction->setEnabled(true);
m_dumpAction->setEnabled(true);
m_loadExternalLogFile->setEnabled(false);
clearTextMarks();
doClear();
Debugger::showPermanentStatusMessage(Tr::tr("Starting Function Profiler..."));
});
connect(runControl, &RunControl::started, this, [] {
Debugger::showPermanentStatusMessage(Tr::tr("Function Profiler running..."));
});
connect(this, &CallgrindTool::dumpRequested, toolRunner, &CallgrindToolRunner::dump);
connect(this, &CallgrindTool::resetRequested, toolRunner, &CallgrindToolRunner::reset);
@@ -715,13 +735,6 @@ void CallgrindTool::setupRunner(CallgrindToolRunner *toolRunner)
connect(m_stopAction, &QAction::triggered, toolRunner, [runControl] { runControl->initiateStop(); });
// initialize run control
toolRunner->setPaused(m_pauseAction->isChecked());
// we may want to toggle collect for one function only in this run
toolRunner->setToggleCollectFunction(m_toggleCollectFunction);
m_toggleCollectFunction.clear();
QTC_ASSERT(m_visualization, return);
// apply project settings
@@ -730,16 +743,6 @@ void CallgrindTool::setupRunner(CallgrindToolRunner *toolRunner)
m_visualization->setMinimumInclusiveCostRatio(settings.visualizationMinimumInclusiveCostRatio() / 100.0);
m_proxyModel.setMinimumInclusiveCostRatio(settings.minimumInclusiveCostRatio() / 100.0);
m_dataModel.setVerboseToolTipsEnabled(settings.enableEventToolTips());
m_toolBusy = true;
updateRunActions();
// enable/disable actions
m_resetAction->setEnabled(true);
m_dumpAction->setEnabled(true);
m_loadExternalLogFile->setEnabled(false);
clearTextMarks();
doClear();
}
void CallgrindTool::updateRunActions()