Perf profiler: Fix UI text

Change-Id: I3a2e7a67db1259f847f04ff523bd9a2b12863510
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Leena Miettinen
2019-03-01 16:58:35 +01:00
parent 0c177cd0d1
commit 26f6cbf8b5
7 changed files with 40 additions and 40 deletions

View File

@@ -211,7 +211,7 @@ void PerfConfigWidget::handleProcessFinished()
if (tracePoints.isEmpty()) { if (tracePoints.isEmpty()) {
Core::AsynchronousMessageBox::warning( Core::AsynchronousMessageBox::warning(
tr("No trace points found"), tr("No Trace Points Found"),
tr("Trace points can be defined with \"perf probe -a\".")); tr("Trace points can be defined with \"perf probe -a\"."));
} else { } else {
for (const QByteArray &event : qAsConst(tracePoints)) { for (const QByteArray &event : qAsConst(tracePoints)) {
@@ -233,7 +233,7 @@ void PerfConfigWidget::handleProcessError(QProcess::ProcessError error)
{ {
if (error == QProcess::FailedToStart) { if (error == QProcess::FailedToStart) {
Core::AsynchronousMessageBox::warning( Core::AsynchronousMessageBox::warning(
tr("Cannot list trace points"), tr("Cannot List Trace Points"),
tr("\"perf probe -l\" failed to start. Is perf installed?")); tr("\"perf probe -l\" failed to start. Is perf installed?"));
m_ui->useTracePointsButton->setEnabled(true); m_ui->useTracePointsButton->setEnabled(true);
} }

View File

@@ -75,8 +75,8 @@ PerfDataReader::PerfDataReader(QObject *parent) :
} }
if (exitCode != 0) { if (exitCode != 0) {
QMessageBox::warning(Core::ICore::mainWindow(), QMessageBox::warning(Core::ICore::mainWindow(),
tr("Perf data parser failed"), tr("Perf Data Parser Failed"),
tr("The perf data parser failed to process all the samples. " tr("The Perf data parser failed to process all the samples. "
"Your trace is incomplete. The exit code was %1.") "Your trace is incomplete. The exit code was %1.")
.arg(exitCode)); .arg(exitCode));
} }
@@ -101,17 +101,17 @@ PerfDataReader::PerfDataReader(QObject *parent) :
connect(&m_input, &QProcess::errorOccurred, this, [this](QProcess::ProcessError e){ connect(&m_input, &QProcess::errorOccurred, this, [this](QProcess::ProcessError e){
switch (e) { switch (e) {
case QProcess::FailedToStart: case QProcess::FailedToStart:
emit processFailed(tr("perfparser failed to start")); emit processFailed(tr("perfparser failed to start."));
QMessageBox::warning(Core::ICore::mainWindow(), QMessageBox::warning(Core::ICore::mainWindow(),
tr("Perf data parser failed"), tr("Perf Data Parser Failed"),
tr("Could not start the 'perfparser' utility program. " tr("Could not start the perfparser utility program. "
"Make sure a working perf parser is available at the location " "Make sure a working Perf parser is available at the location "
"given by the PERFPROFILER_PARSER_FILEPATH environment " "given by the PERFPROFILER_PARSER_FILEPATH environment "
"variable.")); "variable."));
break; break;
case QProcess::Crashed: case QProcess::Crashed:
QMessageBox::warning(Core::ICore::mainWindow(), QMessageBox::warning(Core::ICore::mainWindow(),
tr("Perf data parser crashed"), tr("Perf Data Parser Crashed"),
tr("This is a bug. Please report it.")); tr("This is a bug. Please report it."));
break; break;
case QProcess::ReadError: case QProcess::ReadError:
@@ -346,8 +346,8 @@ void PerfDataReader::writeChunk()
m_input.kill(); m_input.kill();
emit finished(); emit finished();
QMessageBox::warning(Core::ICore::mainWindow(), QMessageBox::warning(Core::ICore::mainWindow(),
tr("Cannot send data to Perf data parser"), tr("Cannot Send Data to Perf Data Parser"),
tr("The perf data parser doesn't accept further input. " tr("The Perf data parser does not accept further input. "
"Your trace is incomplete.")); "Your trace is incomplete."));
} }
} }

View File

@@ -19,7 +19,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label1"> <widget class="QLabel" name="label1">
<property name="text"> <property name="text">
<string>&amp;Trace File:</string> <string>&amp;Trace file:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>traceFileLineEdit</cstring> <cstring>traceFileLineEdit</cstring>
@@ -39,7 +39,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label2"> <widget class="QLabel" name="label2">
<property name="text"> <property name="text">
<string>Directory of &amp;Executable:</string> <string>Directory of &amp;executable:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>executableDirLineEdit</cstring> <cstring>executableDirLineEdit</cstring>
@@ -64,7 +64,7 @@
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="2"> <item row="2" column="1" colspan="2">
<widget class="ProjectExplorer::KitChooser" name="kitChooser" native="true"/> <widget class="ProjectExplorer::KitChooser" name="kitChooser" native="true"/>
</item> </item>
</layout> </layout>
</item> </item>

View File

@@ -138,10 +138,10 @@ public:
// The terminate() below will frequently lead to QProcess::Crashed. We're not interested // The terminate() below will frequently lead to QProcess::Crashed. We're not interested
// in that. FailedToStart is the only actual failure. // in that. FailedToStart is the only actual failure.
if (e == QProcess::FailedToStart) { if (e == QProcess::FailedToStart) {
QString msg = tr("perf process failed to start"); QString msg = tr("Perf Process Failed to Start");
QMessageBox::warning(Core::ICore::mainWindow(), QMessageBox::warning(Core::ICore::mainWindow(),
msg, tr("Make sure you are running a recent Linux kernel and " msg, tr("Make sure that you are running a recent Linux kernel and "
"that the 'perf' utility is available.")); "that the \"perf\" utility is available."));
reportFailure(msg); reportFailure(msg);
} }
}); });
@@ -227,7 +227,7 @@ void PerfProfilerRunner::start()
}); });
connect(recorder, &DeviceProcess::readyReadStandardOutput, this, [this, reader, recorder] { connect(recorder, &DeviceProcess::readyReadStandardOutput, this, [this, reader, recorder] {
if (!reader->feedParser(recorder->readAllStandardOutput())) if (!reader->feedParser(recorder->readAllStandardOutput()))
reportFailure(tr("Failed to transfer perf data to perfparser")); reportFailure(tr("Failed to transfer Perf data to perfparser."));
}); });
} }

View File

@@ -89,19 +89,19 @@ PerfProfilerTool::PerfProfilerTool(QObject *parent) :
options->menu()->setEnabled(true); options->menu()->setEnabled(true);
const Core::Context globalContext(Core::Constants::C_GLOBAL); const Core::Context globalContext(Core::Constants::C_GLOBAL);
m_loadPerfData = new QAction(tr("Load perf.data file"), options); m_loadPerfData = new QAction(tr("Load perf.data File"), options);
Core::Command *command = Core::ActionManager::registerAction( Core::Command *command = Core::ActionManager::registerAction(
m_loadPerfData, Constants::PerfProfilerTaskLoadPerf, globalContext); m_loadPerfData, Constants::PerfProfilerTaskLoadPerf, globalContext);
connect(m_loadPerfData, &QAction::triggered, this, &PerfProfilerTool::showLoadPerfDialog); connect(m_loadPerfData, &QAction::triggered, this, &PerfProfilerTool::showLoadPerfDialog);
options->addAction(command); options->addAction(command);
m_loadTrace = new QAction(tr("Load trace file"), options); m_loadTrace = new QAction(tr("Load Trace File"), options);
command = Core::ActionManager::registerAction(m_loadTrace, Constants::PerfProfilerTaskLoadTrace, command = Core::ActionManager::registerAction(m_loadTrace, Constants::PerfProfilerTaskLoadTrace,
globalContext); globalContext);
connect(m_loadTrace, &QAction::triggered, this, &PerfProfilerTool::showLoadTraceDialog); connect(m_loadTrace, &QAction::triggered, this, &PerfProfilerTool::showLoadTraceDialog);
options->addAction(command); options->addAction(command);
m_saveTrace = new QAction(tr("Save trace file"), options); m_saveTrace = new QAction(tr("Save Trace File"), options);
command = Core::ActionManager::registerAction(m_saveTrace, Constants::PerfProfilerTaskSaveTrace, command = Core::ActionManager::registerAction(m_saveTrace, Constants::PerfProfilerTaskSaveTrace,
globalContext); globalContext);
connect(m_saveTrace, &QAction::triggered, this, &PerfProfilerTool::showSaveTraceDialog); connect(m_saveTrace, &QAction::triggered, this, &PerfProfilerTool::showSaveTraceDialog);
@@ -126,7 +126,7 @@ PerfProfilerTool::PerfProfilerTool(QObject *parent) :
}); });
options->addAction(command); options->addAction(command);
QAction *tracePointsAction = new QAction(tr("Create memory trace points"), options); QAction *tracePointsAction = new QAction(tr("Create Memory Trace Points"), options);
tracePointsAction->setIcon(Debugger::Icons::TRACEPOINT_TOOLBAR.icon()); tracePointsAction->setIcon(Debugger::Icons::TRACEPOINT_TOOLBAR.icon());
tracePointsAction->setIconVisibleInMenu(false); tracePointsAction->setIconVisibleInMenu(false);
tracePointsAction->setToolTip(tr("Create trace points for memory profiling on the target " tracePointsAction->setToolTip(tr("Create trace points for memory profiling on the target "
@@ -141,7 +141,7 @@ PerfProfilerTool::PerfProfilerTool(QObject *parent) :
m_tracePointsButton->setDefaultAction(tracePointsAction); m_tracePointsButton->setDefaultAction(tracePointsAction);
auto action = new QAction(tr("Performance Analyzer"), this); auto action = new QAction(tr("Performance Analyzer"), this);
action->setToolTip(tr("The Performance Analyzer can be used to find performance bottlenecks")); action->setToolTip(tr("Finds performance bottlenecks."));
menu->addAction(ActionManager::registerAction(action, Constants::PerfProfilerLocalActionId), menu->addAction(ActionManager::registerAction(action, Constants::PerfProfilerLocalActionId),
Debugger::Constants::G_ANALYZER_TOOLS); Debugger::Constants::G_ANALYZER_TOOLS);
QObject::connect(action, &QAction::triggered, this, [this] { QObject::connect(action, &QAction::triggered, this, [this] {
@@ -251,7 +251,7 @@ void PerfProfilerTool::createViews()
connect(m_recordButton, &QAbstractButton::clicked, this, &PerfProfilerTool::setRecording); connect(m_recordButton, &QAbstractButton::clicked, this, &PerfProfilerTool::setRecording);
m_clearButton->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon()); m_clearButton->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon());
m_clearButton->setToolTip(tr("Discard data")); m_clearButton->setToolTip(tr("Discard data."));
connect(m_clearButton, &QAbstractButton::clicked, this, &PerfProfilerTool::clear); connect(m_clearButton, &QAbstractButton::clicked, this, &PerfProfilerTool::clear);
m_filterButton->setIcon(Utils::Icons::FILTER.icon()); m_filterButton->setIcon(Utils::Icons::FILTER.icon());
@@ -410,10 +410,10 @@ void PerfProfilerTool::onReaderFinished()
m_readerRunning = false; m_readerRunning = false;
if (m_traceManager->traceDuration() <= 0) { if (m_traceManager->traceDuration() <= 0) {
QMessageBox::warning(Core::ICore::mainWindow(), QMessageBox::warning(Core::ICore::mainWindow(),
tr("No data loaded"), tr("No Data Loaded"),
tr("The profiler did not produce any samples. " tr("The profiler did not produce any samples. "
"Make sure you are running a recent Linux kernel and that the " "Make sure that you are running a recent Linux kernel and that "
"'perf' utility is available and generates useful call " "the \"perf\" utility is available and generates useful call "
"graphs.")); "graphs."));
clear(); clear();
} else { } else {
@@ -612,7 +612,7 @@ void PerfProfilerTool::showLoadTraceDialog()
m_perspective.select(); m_perspective.select();
QString filename = QFileDialog::getOpenFileName( QString filename = QFileDialog::getOpenFileName(
ICore::mainWindow(), tr("Load trace file"), ICore::mainWindow(), tr("Load Trace File"),
"", tr("Trace File (*.ptr)")); "", tr("Trace File (*.ptr)"));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
@@ -627,7 +627,7 @@ void PerfProfilerTool::showSaveTraceDialog()
m_perspective.select(); m_perspective.select();
QString filename = QFileDialog::getSaveFileName( QString filename = QFileDialog::getSaveFileName(
ICore::mainWindow(), tr("Save trace file"), ICore::mainWindow(), tr("Save Trace File"),
"", tr("Trace File (*.ptr)")); "", tr("Trace File (*.ptr)"));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
@@ -641,8 +641,8 @@ void PerfProfilerTool::showSaveTraceDialog()
void PerfProfilerTool::setAggregated(bool aggregated) void PerfProfilerTool::setAggregated(bool aggregated)
{ {
m_aggregateButton->setChecked(aggregated); m_aggregateButton->setChecked(aggregated);
m_aggregateButton->setToolTip(aggregated ? tr("Show all addresses") m_aggregateButton->setToolTip(aggregated ? tr("Show all addresses.")
: tr("Aggregate by functions")); : tr("Aggregate by functions."));
emit aggregatedChanged(aggregated); emit aggregatedChanged(aggregated);
} }
@@ -653,8 +653,8 @@ void PerfProfilerTool::setRecording(bool recording)
m_recordButton->setIcon(recording ? recordOn : recordOff); m_recordButton->setIcon(recording ? recordOn : recordOff);
m_recordButton->setChecked(recording); m_recordButton->setChecked(recording);
m_recordButton->setToolTip(recording ? tr("Stop collecting profile data") : m_recordButton->setToolTip(recording ? tr("Stop collecting profile data.") :
tr("Collect profile data")); tr("Collect profile data."));
emit recordingChanged(recording); emit recordingChanged(recording);
} }
@@ -668,7 +668,7 @@ void PerfProfilerTool::updateTime(qint64 duration, qint64 delay)
m_recordedLabel->clear(); m_recordedLabel->clear();
if (delay > 0) if (delay > 0)
m_delayLabel->setText(tr("Processing Delay: %1.%2s").arg(delay / e9) m_delayLabel->setText(tr("Processing delay: %1.%2s").arg(delay / e9)
.arg(qAbs(delay / e8) % ten)); .arg(qAbs(delay / e8) % ten));
else if (delay == 0) else if (delay == 0)
m_delayLabel->clear(); m_delayLabel->clear();

View File

@@ -94,13 +94,13 @@ void PerfProfilerEventStorage::clear()
m_file.clear(); m_file.clear();
m_size = 0; m_size = 0;
if (!m_file.open()) if (!m_file.open())
m_errorHandler(tr("Failed to reset temporary trace file")); m_errorHandler(tr("Failed to reset temporary trace file."));
} }
void PerfProfilerEventStorage::finalize() void PerfProfilerEventStorage::finalize()
{ {
if (!m_file.flush()) if (!m_file.flush())
m_errorHandler(tr("Failed to flush temporary trace file")); m_errorHandler(tr("Failed to flush temporary trace file."));
} }
bool PerfProfilerEventStorage::replay( bool PerfProfilerEventStorage::replay(
@@ -110,13 +110,13 @@ bool PerfProfilerEventStorage::replay(
case Timeline::TraceStashFile<PerfEvent>::ReplaySuccess: case Timeline::TraceStashFile<PerfEvent>::ReplaySuccess:
return true; return true;
case Timeline::TraceStashFile<PerfEvent>::ReplayOpenFailed: case Timeline::TraceStashFile<PerfEvent>::ReplayOpenFailed:
m_errorHandler(tr("Cannot re-open temporary trace file")); m_errorHandler(tr("Cannot re-open temporary trace file."));
break; break;
case Timeline::TraceStashFile<PerfEvent>::ReplayLoadFailed: case Timeline::TraceStashFile<PerfEvent>::ReplayLoadFailed:
// Happens if the loader rejects an event. Not an actual error // Happens if the loader rejects an event. Not an actual error
break; break;
case Timeline::TraceStashFile<PerfEvent>::ReplayReadPastEnd: case Timeline::TraceStashFile<PerfEvent>::ReplayReadPastEnd:
m_errorHandler(tr("Read past end from temporary trace file")); m_errorHandler(tr("Read past end from temporary trace file."));
break; break;
} }
return false; return false;

View File

@@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Creating memory trace points</string> <string>Creating Memory Trace Points</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
@@ -29,7 +29,7 @@
<item> <item>
<widget class="QLabel" name="privilegeslabel"> <widget class="QLabel" name="privilegeslabel">
<property name="text"> <property name="text">
<string>Elevate privileges using</string> <string>Elevate privileges using:</string>
</property> </property>
</widget> </widget>
</item> </item>