@@ -72,9 +72,9 @@ RecordType selectedRecordType(const QScopedPointer<Ui::RecordPage>& ui)
7272 return ui->recordTypeComboBox ->currentData ().value <RecordType>();
7373}
7474
75- void updateStartRecordingButtonState (const QScopedPointer<Ui::RecordPage>& ui)
75+ void updateStartRecordingButtonState (PerfRecord* record, const QScopedPointer<Ui::RecordPage>& ui)
7676{
77- if (!PerfRecord:: isPerfInstalled ()) {
77+ if (!record-> isPerfInstalled ()) {
7878 ui->startRecordingButton ->setEnabled (false );
7979 ui->applicationRecordErrorMessage ->setText (QObject::tr (" Please install perf before trying to record." ));
8080 ui->applicationRecordErrorMessage ->setVisible (true );
@@ -361,7 +361,7 @@ RecordPage::RecordPage(QWidget* parent)
361361 ui->processesTableView ->setSelectionBehavior (QAbstractItemView::SelectRows);
362362 ui->processesTableView ->setSelectionMode (QAbstractItemView::MultiSelection);
363363 connect (ui->processesTableView ->selectionModel (), &QItemSelectionModel::selectionChanged, this ,
364- [this ]() { updateStartRecordingButtonState (ui); });
364+ [this ]() { updateStartRecordingButtonState (m_perfRecord, ui); });
365365
366366 ResultsUtil::connectFilter (ui->processesFilterBox , m_processProxyModel);
367367
@@ -387,7 +387,7 @@ RecordPage::RecordPage(QWidget* parent)
387387 ui->sampleCpuCheckBox ->setChecked (config ().readEntry (QStringLiteral (" sampleCpu" ), true ));
388388 ui->mmapPagesSpinBox ->setValue (config ().readEntry (QStringLiteral (" mmapPages" ), 0 ));
389389 ui->mmapPagesUnitComboBox ->setCurrentIndex (config ().readEntry (QStringLiteral (" mmapPagesUnit" ), 2 ));
390- ui->useAioCheckBox ->setChecked (config ().readEntry (QStringLiteral (" useAio" ), PerfRecord:: canUseAio ()));
390+ ui->useAioCheckBox ->setChecked (config ().readEntry (QStringLiteral (" useAio" ), m_perfRecord-> canUseAio ()));
391391
392392 const auto callGraph = config ().readEntry (" callGraph" , ui->callGraphComboBox ->currentData ());
393393 const auto callGraphIdx = ui->callGraphComboBox ->findData (callGraph);
@@ -419,19 +419,19 @@ RecordPage::RecordPage(QWidget* parent)
419419 }
420420 });
421421
422- if (!PerfRecord:: canSampleCpu ()) {
422+ if (!m_perfRecord-> canSampleCpu ()) {
423423 ui->sampleCpuCheckBox ->hide ();
424424 ui->sampleCpuLabel ->hide ();
425425 }
426- if (!PerfRecord:: canSwitchEvents ()) {
426+ if (!m_perfRecord-> canSwitchEvents ()) {
427427 ui->offCpuCheckBox ->hide ();
428428 ui->offCpuLabel ->hide ();
429429 }
430- if (!PerfRecord:: canUseAio ()) {
430+ if (!m_perfRecord-> canUseAio ()) {
431431 ui->useAioCheckBox ->hide ();
432432 ui->useAioLabel ->hide ();
433433 }
434- if (!PerfRecord:: canCompress ()) {
434+ if (!m_perfRecord-> canCompress ()) {
435435 ui->compressionComboBox ->hide ();
436436 ui->compressionLabel ->hide ();
437437 } else {
@@ -504,24 +504,24 @@ void RecordPage::onStartRecordingButtonClicked(bool checked)
504504 perfOptions += KShell::splitArgs (customOptions);
505505
506506 const bool offCpuProfilingEnabled = ui->offCpuCheckBox ->isChecked ();
507- if (offCpuProfilingEnabled && PerfRecord:: canSwitchEvents ()) {
507+ if (offCpuProfilingEnabled && m_perfRecord-> canSwitchEvents ()) {
508508 if (eventType.isEmpty ()) {
509509 // TODO: use clock event in VM context
510510 perfOptions += QStringLiteral (" --event" );
511511 perfOptions += QStringLiteral (" cycles" );
512512 }
513- perfOptions += PerfRecord:: offCpuProfilingOptions ();
513+ perfOptions += m_perfRecord-> offCpuProfilingOptions ();
514514 }
515515 config ().writeEntry (QStringLiteral (" offCpuProfiling" ), offCpuProfilingEnabled);
516516
517517 const bool useAioEnabled = ui->useAioCheckBox ->isChecked ();
518- if (useAioEnabled && PerfRecord:: canUseAio ()) {
518+ if (useAioEnabled && m_perfRecord-> canUseAio ()) {
519519 perfOptions += QStringLiteral (" --aio" );
520520 }
521521 config ().writeEntry (QStringLiteral (" useAio" ), useAioEnabled);
522522
523523 const auto compressionLevel = ui->compressionComboBox ->currentData ().toInt ();
524- if (PerfRecord:: canCompress () && compressionLevel >= 0 ) {
524+ if (m_perfRecord-> canCompress () && compressionLevel >= 0 ) {
525525 if (compressionLevel == 0 )
526526 perfOptions += QStringLiteral (" -z" );
527527 else
@@ -532,7 +532,7 @@ void RecordPage::onStartRecordingButtonClicked(bool checked)
532532 const bool elevatePrivileges = ui->elevatePrivilegesCheckBox ->isChecked ();
533533
534534 const bool sampleCpuEnabled = ui->sampleCpuCheckBox ->isChecked ();
535- if (sampleCpuEnabled && PerfRecord:: canSampleCpu ()) {
535+ if (sampleCpuEnabled && m_perfRecord-> canSampleCpu ()) {
536536 perfOptions += QStringLiteral (" --sample-cpu" );
537537 }
538538
@@ -653,7 +653,7 @@ void RecordPage::onApplicationNameChanged(const QString& filePath)
653653
654654 m_multiConfig->setConfig (applicationConfig (ui->applicationName ->text ()));
655655 }
656- updateStartRecordingButtonState (ui);
656+ updateStartRecordingButtonState (m_perfRecord, ui);
657657}
658658
659659void RecordPage::onWorkingDirectoryNameChanged (const QString& folderPath)
@@ -669,7 +669,7 @@ void RecordPage::onWorkingDirectoryNameChanged(const QString& folderPath)
669669 } else {
670670 setError ({});
671671 }
672- updateStartRecordingButtonState (ui);
672+ updateStartRecordingButtonState (m_perfRecord, ui);
673673}
674674
675675void RecordPage::onViewPerfRecordResultsButtonClicked ()
@@ -695,7 +695,7 @@ void RecordPage::onOutputFileNameChanged(const QString& /*filePath*/)
695695 } else {
696696 setError ({});
697697 }
698- updateStartRecordingButtonState (ui);
698+ updateStartRecordingButtonState (m_perfRecord, ui);
699699}
700700
701701void RecordPage::onOutputFileNameSelected (const QString& filePath)
@@ -727,7 +727,7 @@ void RecordPage::updateProcessesFinished()
727727
728728 if (selectedRecordType (ui) == AttachToProcess) {
729729 // only update the state when we show the attach app page
730- updateStartRecordingButtonState (ui);
730+ updateStartRecordingButtonState (m_perfRecord, ui);
731731 QTimer::singleShot (1000 , this , &RecordPage::updateProcesses);
732732 }
733733}
@@ -754,23 +754,23 @@ void RecordPage::updateRecordType()
754754 m_perfOutput->setInputVisible (recordType == LaunchApplication);
755755 m_perfOutput->clear ();
756756 ui->elevatePrivilegesCheckBox ->setEnabled (recordType != ProfileSystem);
757- ui->sampleCpuCheckBox ->setEnabled (recordType != ProfileSystem && PerfRecord:: canSampleCpu ());
757+ ui->sampleCpuCheckBox ->setEnabled (recordType != ProfileSystem && m_perfRecord-> canSampleCpu ());
758758 if (recordType == ProfileSystem) {
759759 ui->elevatePrivilegesCheckBox ->setChecked (true );
760- ui->sampleCpuCheckBox ->setChecked (true && PerfRecord:: canSampleCpu ());
760+ ui->sampleCpuCheckBox ->setChecked (true && m_perfRecord-> canSampleCpu ());
761761 }
762762
763763 if (recordType == AttachToProcess) {
764764 updateProcesses ();
765765 }
766766
767- updateStartRecordingButtonState (ui);
767+ updateStartRecordingButtonState (m_perfRecord, ui);
768768}
769769
770770void RecordPage::updateOffCpuCheckboxState ()
771771{
772772 const bool enableOffCpuProfiling =
773- (ui->elevatePrivilegesCheckBox ->isChecked () || PerfRecord:: canProfileOffCpu ()) && PerfRecord:: canSwitchEvents ();
773+ (ui->elevatePrivilegesCheckBox ->isChecked () || m_perfRecord-> canProfileOffCpu ()) && m_perfRecord-> canSwitchEvents ();
774774
775775 if (enableOffCpuProfiling == ui->offCpuCheckBox ->isEnabled ()) {
776776 return ;
0 commit comments