PerfProfiler: Convert to using Tr::tr

Change-Id: Ied3f0a499a1b5c6da752667a44525ecce66febac
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Alessandro Portale
2022-08-30 17:28:02 +02:00
parent a522215840
commit 88489fa956
22 changed files with 228 additions and 453 deletions

View File

@@ -43286,7 +43286,7 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::PerfConfigWidget</name> <name>PerfProfiler</name>
<message> <message>
<source>Stack snapshot size (kB):</source> <source>Stack snapshot size (kB):</source>
<translation>Größe des Stack-Abbilds (kB):</translation> <translation>Größe des Stack-Abbilds (kB):</translation>
@@ -43363,9 +43363,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
<source>Sample period:</source> <source>Sample period:</source>
<translation>Aufnahmehäufigkeit:</translation> <translation>Aufnahmehäufigkeit:</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfLoadDialog</name>
<message> <message>
<source>Load Perf Trace</source> <source>Load Perf Trace</source>
<translation>Perf-Trace laden</translation> <translation>Perf-Trace laden</translation>
@@ -43402,9 +43399,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
<source>Directory of &amp;executable:</source> <source>Directory of &amp;executable:</source>
<translation>Verzeichnis der &amp;ausführbaren Datei:</translation> <translation>Verzeichnis der &amp;ausführbaren Datei:</translation>
</message> </message>
</context>
<context>
<name>PerfProfilerFlameGraphView</name>
<message> <message>
<source>Samples</source> <source>Samples</source>
<translation>Samples</translation> <translation>Samples</translation>
@@ -43445,9 +43439,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
<source>Various</source> <source>Various</source>
<translation>Verschiedene</translation> <translation>Verschiedene</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfTracePointDialog</name>
<message> <message>
<source>Run the following script as root to create trace points?</source> <source>Run the following script as root to create trace points?</source>
<translation>Soll das folgende Skript als root ausgeführt werden, um Tracepoints zu erzeugen?</translation> <translation>Soll das folgende Skript als root ausgeführt werden, um Tracepoints zu erzeugen?</translation>
@@ -43925,7 +43916,7 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::PerfConfigEventsModel</name> <name>PerfProfiler</name>
<message> <message>
<source>Event Type</source> <source>Event Type</source>
<translation>Ereignistyp</translation> <translation>Ereignistyp</translation>
@@ -43942,9 +43933,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
<source>Result</source> <source>Result</source>
<translation>Ergebnis</translation> <translation>Ergebnis</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfDataReader</name>
<message> <message>
<source>Perf Data Parser Failed</source> <source>Perf Data Parser Failed</source>
<translation>Perf-Daten konnten nicht ausgewertet werden</translation> <translation>Perf-Daten konnten nicht ausgewertet werden</translation>
@@ -43989,31 +43977,18 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
<source>The Perf data parser does not accept further input. Your trace is incomplete.</source> <source>The Perf data parser does not accept further input. Your trace is incomplete.</source>
<translation>Der Perf Daten-Parser nimmt keine weiteren Eingabedaten an. Ihr Trace ist unvollständig.</translation> <translation>Der Perf Daten-Parser nimmt keine weiteren Eingabedaten an. Ihr Trace ist unvollständig.</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::PerfOptionsPage</name>
<message> <message>
<source>CPU Usage</source> <source>CPU Usage</source>
<translation>Prozessorauslastung</translation> <translation>Prozessorauslastung</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerFlameGraphModel</name>
<message> <message>
<source>[unknown]</source> <source>[unknown]</source>
<translation>[unbekannt]</translation> <translation>[unbekannt]</translation>
</message> </message>
</context>
<context>
<name>PerfProfilerStatisticsView</name>
<message> <message>
<source>Address</source> <source>Address</source>
<translation>Adresse</translation> <translation>Adresse</translation>
</message> </message>
<message>
<source>Function</source>
<translation>Funktion</translation>
</message>
<message> <message>
<source>Source Location</source> <source>Source Location</source>
<translation>Position im Quelltext</translation> <translation>Position im Quelltext</translation>
@@ -44042,10 +44017,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
<source>Recursion in Percent</source> <source>Recursion in Percent</source>
<translation>Rekursion in Prozent</translation> <translation>Rekursion in Prozent</translation>
</message> </message>
<message>
<source>Samples</source>
<translation>Samples</translation>
</message>
<message> <message>
<source>Samples in Percent</source> <source>Samples in Percent</source>
<translation>Samples in Prozent</translation> <translation>Samples in Prozent</translation>
@@ -44506,7 +44477,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::PerfProfilerRunner</name> <name>PerfProfiler</name>
<message> <message>
<source>Failed to transfer Perf data to perfparser.</source> <source>Failed to transfer Perf data to perfparser.</source>
<translation>Perf-Daten konnten nicht zum perfparser übertragen werden.</translation> <translation>Perf-Daten konnten nicht zum perfparser übertragen werden.</translation>
@@ -44543,7 +44514,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::LocalPerfRecordWorker</name> <name>PerfProfiler</name>
<message> <message>
<source>Could not start device process.</source> <source>Could not start device process.</source>
<translation>Der Prozess auf dem Gerät konnte nicht gestartet werden.</translation> <translation>Der Prozess auf dem Gerät konnte nicht gestartet werden.</translation>
@@ -44556,9 +44527,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<source>Make sure that you are running a recent Linux kernel and that the &quot;perf&quot; utility is available.</source> <source>Make sure that you are running a recent Linux kernel and that the &quot;perf&quot; utility is available.</source>
<translation>Stellen Sie sicher, dass Sie einen aktuellen Linux-Kernel verwenden und das Programm &quot;perf&quot; verfügbar ist.</translation> <translation>Stellen Sie sicher, dass Sie einen aktuellen Linux-Kernel verwenden und das Programm &quot;perf&quot; verfügbar ist.</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTool</name>
<message> <message>
<source>Performance Analyzer Options</source> <source>Performance Analyzer Options</source>
<translation>Einstellungen zur Leistungsanalyse</translation> <translation>Einstellungen zur Leistungsanalyse</translation>
@@ -44679,9 +44647,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<source>Processing delay: %1.%2s</source> <source>Processing delay: %1.%2s</source>
<translation>Verarbeitungsverzögerung: %1,%2s</translation> <translation>Verarbeitungsverzögerung: %1,%2s</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTraceManager</name>
<message> <message>
<source>Thread started</source> <source>Thread started</source>
<translation>Thread gestartet</translation> <translation>Thread gestartet</translation>
@@ -44710,24 +44675,14 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<source>Saving Trace Data</source> <source>Saving Trace Data</source>
<translation>Speichere Trace-Daten</translation> <translation>Speichere Trace-Daten</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::PerfRunConfigurationAspect</name>
<message> <message>
<source>Performance Analyzer Settings</source> <source>Performance Analyzer Settings</source>
<translation>Einstellungen zur Leistungsanalyse</translation> <translation>Einstellungen zur Leistungsanalyse</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfTimelineModel</name>
<message> <message>
<source>sample collected</source> <source>sample collected</source>
<translation>Sample aufgezeichnet</translation> <translation>Sample aufgezeichnet</translation>
</message> </message>
<message>
<source>[unknown]</source>
<translation>[unbekannt]</translation>
</message>
<message> <message>
<source>Details</source> <source>Details</source>
<translation>Details</translation> <translation>Details</translation>
@@ -44772,26 +44727,10 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<source>Duration</source> <source>Duration</source>
<translation>Dauer</translation> <translation>Dauer</translation>
</message> </message>
<message>
<source>Samples</source>
<translation>Samples</translation>
</message>
<message>
<source>Binary</source>
<translation>Binärdatei</translation>
</message>
<message> <message>
<source> (guessed from context)</source> <source> (guessed from context)</source>
<translation> (aus dem Kontext geschlossen)</translation> <translation> (aus dem Kontext geschlossen)</translation>
</message> </message>
<message>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<source>Source</source>
<translation>Quelltext</translation>
</message>
<message> <message>
<source>Total Samples</source> <source>Total Samples</source>
<translation>Samples insgesamt</translation> <translation>Samples insgesamt</translation>

View File

@@ -5455,7 +5455,7 @@ Greška: %5</translation>
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::PerfConfigWidget</name> <name>PerfProfiler</name>
<message> <message>
<source>Stack snapshot size (kB):</source> <source>Stack snapshot size (kB):</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -5532,9 +5532,6 @@ Greška: %5</translation>
<source>&quot;perf probe -l&quot; failed to start. Is perf installed?</source> <source>&quot;perf probe -l&quot; failed to start. Is perf installed?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfLoadDialog</name>
<message> <message>
<source>Load Perf Trace</source> <source>Load Perf Trace</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -5571,9 +5568,6 @@ Greška: %5</translation>
<source>Choose Directory of Executable</source> <source>Choose Directory of Executable</source>
<translation>Odaberi direktorij ili izvršavajuće</translation> <translation>Odaberi direktorij ili izvršavajuće</translation>
</message> </message>
</context>
<context>
<name>PerfProfilerFlameGraphView</name>
<message> <message>
<source>Samples</source> <source>Samples</source>
<translation>Primjeri</translation> <translation>Primjeri</translation>
@@ -5614,9 +5608,6 @@ Greška: %5</translation>
<source>Various</source> <source>Various</source>
<translation>Razno</translation> <translation>Razno</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfTracePointDialog</name>
<message> <message>
<source>Creating Memory Trace Points</source> <source>Creating Memory Trace Points</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -28722,7 +28713,7 @@ Rok upotrebe: %3</translation>
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::PerfConfigEventsModel</name> <name>PerfProfiler</name>
<message> <message>
<source>Event Type</source> <source>Event Type</source>
<translation>Vrsta događaja</translation> <translation>Vrsta događaja</translation>
@@ -28739,9 +28730,6 @@ Rok upotrebe: %3</translation>
<source>Result</source> <source>Result</source>
<translation>Rezultat</translation> <translation>Rezultat</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfDataReader</name>
<message> <message>
<source>Perf Data Parser Failed</source> <source>Perf Data Parser Failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -28786,23 +28774,14 @@ Rok upotrebe: %3</translation>
<source>The Perf data parser does not accept further input. Your trace is incomplete.</source> <source>The Perf data parser does not accept further input. Your trace is incomplete.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::PerfOptionsPage</name>
<message> <message>
<source>CPU Usage</source> <source>CPU Usage</source>
<translation>Korištenje CPU-a</translation> <translation>Korištenje CPU-a</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerFlameGraphModel</name>
<message> <message>
<source>[unknown]</source> <source>[unknown]</source>
<translation>[nepoznato]</translation> <translation>[nepoznato]</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::LocalPerfRecordWorker</name>
<message> <message>
<source>Could not start device process.</source> <source>Could not start device process.</source>
<translation>Nije bilo moguće pokrenuti proces uređaja.</translation> <translation>Nije bilo moguće pokrenuti proces uređaja.</translation>
@@ -28815,24 +28794,14 @@ Rok upotrebe: %3</translation>
<source>Make sure that you are running a recent Linux kernel and that the &quot;perf&quot; utility is available.</source> <source>Make sure that you are running a recent Linux kernel and that the &quot;perf&quot; utility is available.</source>
<translation>Provjeri, da pokrećeš najnoviji Linux kernel i da je uslužni program &quot;perf&quot; dostupan.</translation> <translation>Provjeri, da pokrećeš najnoviji Linux kernel i da je uslužni program &quot;perf&quot; dostupan.</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerRunner</name>
<message> <message>
<source>Failed to transfer Perf data to perfparser.</source> <source>Failed to transfer Perf data to perfparser.</source>
<translation>Neuspjelo prenošenje Perf podataka na perfparser.</translation> <translation>Neuspjelo prenošenje Perf podataka na perfparser.</translation>
</message> </message>
</context>
<context>
<name>PerfProfilerStatisticsView</name>
<message> <message>
<source>Address</source> <source>Address</source>
<translation>Adresa</translation> <translation>Adresa</translation>
</message> </message>
<message>
<source>Function</source>
<translation>Funkcija</translation>
</message>
<message> <message>
<source>Source Location</source> <source>Source Location</source>
<translation>Mjesto izvora</translation> <translation>Mjesto izvora</translation>
@@ -28861,10 +28830,6 @@ Rok upotrebe: %3</translation>
<source>Recursion in Percent</source> <source>Recursion in Percent</source>
<translation>Rekurzije u postocima</translation> <translation>Rekurzije u postocima</translation>
</message> </message>
<message>
<source>Samples</source>
<translation>Primjeri</translation>
</message>
<message> <message>
<source>Samples in Percent</source> <source>Samples in Percent</source>
<translation>Primjeri u postocima</translation> <translation>Primjeri u postocima</translation>
@@ -28877,9 +28842,6 @@ Rok upotrebe: %3</translation>
<source>Self in Percent</source> <source>Self in Percent</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTool</name>
<message> <message>
<source>Performance Analyzer Options</source> <source>Performance Analyzer Options</source>
<translation>Opcije analizatora preformance</translation> <translation>Opcije analizatora preformance</translation>
@@ -29008,9 +28970,6 @@ Rok upotrebe: %3</translation>
<source>Processing delay: %1.%2s</source> <source>Processing delay: %1.%2s</source>
<translation>Obrađivanje kašnjenja: %1.%2s</translation> <translation>Obrađivanje kašnjenja: %1.%2s</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTraceFile</name>
<message> <message>
<source>Invalid data format</source> <source>Invalid data format</source>
<translation>Neispravni format podataka</translation> <translation>Neispravni format podataka</translation>
@@ -29048,7 +29007,7 @@ Rok upotrebe: %3</translation>
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::PerfProfilerTraceManager</name> <name>PerfProfiler</name>
<message> <message>
<source>Thread started</source> <source>Thread started</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -29073,24 +29032,14 @@ Rok upotrebe: %3</translation>
<source>Saving Trace Data</source> <source>Saving Trace Data</source>
<translation>Spremanje Trace podataka</translation> <translation>Spremanje Trace podataka</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::PerfRunConfigurationAspect</name>
<message> <message>
<source>Performance Analyzer Settings</source> <source>Performance Analyzer Settings</source>
<translation>Postavke za analizatora preformance</translation> <translation>Postavke za analizatora preformance</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfTimelineModel</name>
<message> <message>
<source>sample collected</source> <source>sample collected</source>
<translation>primjer prikupljen</translation> <translation>primjer prikupljen</translation>
</message> </message>
<message>
<source>[unknown]</source>
<translation>[nepoznato]</translation>
</message>
<message> <message>
<source>Details</source> <source>Details</source>
<translation>Detalji</translation> <translation>Detalji</translation>
@@ -29147,26 +29096,10 @@ Rok upotrebe: %3</translation>
<source>Duration</source> <source>Duration</source>
<translation>Trajanje</translation> <translation>Trajanje</translation>
</message> </message>
<message>
<source>Samples</source>
<translation>Primjeri</translation>
</message>
<message>
<source>Binary</source>
<translation>Binarno</translation>
</message>
<message> <message>
<source> (guessed from context)</source> <source> (guessed from context)</source>
<translation> (procijenjeno iz konteksta)</translation> <translation> (procijenjeno iz konteksta)</translation>
</message> </message>
<message>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<source>Source</source>
<translation>Izvor</translation>
</message>
<message> <message>
<source>Total Samples</source> <source>Total Samples</source>
<translation>Ukupno primjera</translation> <translation>Ukupno primjera</translation>

View File

@@ -47617,7 +47617,7 @@ Output:
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::PerfConfigWidget</name> <name>PerfProfiler</name>
<message> <message>
<source>Additional arguments:</source> <source>Additional arguments:</source>
<translation>:</translation> <translation>:</translation>
@@ -47626,9 +47626,6 @@ Output:
<source>Reset</source> <source>Reset</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfLoadDialog</name>
<message> <message>
<source>&amp;Browse...</source> <source>&amp;Browse...</source>
<translation type="unfinished">(&amp;B)...</translation> <translation type="unfinished">(&amp;B)...</translation>
@@ -47887,7 +47884,7 @@ Output:
<name>Tracing</name> <name>Tracing</name>
</context> </context>
<context> <context>
<name>PerfProfilerFlameGraphView</name> <name>PerfProfiler</name>
<message> <message>
<source>Function</source> <source>Function</source>
<translation></translation> <translation></translation>
@@ -52894,29 +52891,19 @@ Stepping into the module or setting breakpoints by file and line is expected to
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::PerfConfigEventsModel</name> <name>PerfProfiler</name>
<message> <message>
<source>Result</source> <source>Result</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerFlameGraphModel</name>
<message> <message>
<source>[unknown]</source> <source>[unknown]</source>
<translation>[]</translation> <translation>[]</translation>
</message> </message>
</context>
<context>
<name>PerfProfilerStatisticsView</name>
<message> <message>
<source>Address</source> <source>Address</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>Function</source>
<translation></translation>
</message>
<message> <message>
<source>Caller</source> <source>Caller</source>
<translation></translation> <translation></translation>
@@ -52929,9 +52916,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Occurrences</source> <source>Occurrences</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTool</name>
<message> <message>
<source>Show Full Range</source> <source>Show Full Range</source>
<translation></translation> <translation></translation>
@@ -52964,9 +52948,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Reset Flame Graph</source> <source>Reset Flame Graph</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTraceManager</name>
<message> <message>
<source>Invalid</source> <source>Invalid</source>
<translation></translation> <translation></translation>
@@ -52979,13 +52960,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Saving Trace Data</source> <source>Saving Trace Data</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfTimelineModel</name>
<message>
<source>[unknown]</source>
<translation>[]</translation>
</message>
<message> <message>
<source>Details</source> <source>Details</source>
<translation></translation> <translation></translation>
@@ -53006,18 +52980,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Duration</source> <source>Duration</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>Binary</source>
<translation>2</translation>
</message>
<message>
<source>Address</source>
<translation></translation>
</message>
<message>
<source>Source</source>
<translation></translation>
</message>
</context> </context>
<context> <context>
<name>ProjectExplorer::Internal::AddRunConfigDialog</name> <name>ProjectExplorer::Internal::AddRunConfigDialog</name>

View File

@@ -28720,7 +28720,7 @@ If set to false, the target will be moved straight to the current mouse position
</message> </message>
</context> </context>
<context> <context>
<name>PerfProfiler::Internal::LocalPerfRecordWorker</name> <name>PerfProfiler</name>
<message> <message>
<source>Could not start device process.</source> <source>Could not start device process.</source>
<translation>Не удалось запустить процесс устройства.</translation> <translation>Не удалось запустить процесс устройства.</translation>
@@ -28733,9 +28733,6 @@ If set to false, the target will be moved straight to the current mouse position
<source>Make sure that you are running a recent Linux kernel and that the &quot;perf&quot; utility is available.</source> <source>Make sure that you are running a recent Linux kernel and that the &quot;perf&quot; utility is available.</source>
<translation>Убедитесь, что используете свежую версию ядра Linux, а также в наличии программы «perf».</translation> <translation>Убедитесь, что используете свежую версию ядра Linux, а также в наличии программы «perf».</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfConfigEventsModel</name>
<message> <message>
<source>Event Type</source> <source>Event Type</source>
<translation>Тип события</translation> <translation>Тип события</translation>
@@ -28752,9 +28749,6 @@ If set to false, the target will be moved straight to the current mouse position
<source>Result</source> <source>Result</source>
<translation>Результат</translation> <translation>Результат</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfConfigWidget</name>
<message> <message>
<source>Stack snapshot size (kB):</source> <source>Stack snapshot size (kB):</source>
<translatorcomment>интресно, тут 1000 байт или 1 килобайт?</translatorcomment> <translatorcomment>интресно, тут 1000 байт или 1 килобайт?</translatorcomment>
@@ -28833,9 +28827,6 @@ If set to false, the target will be moved straight to the current mouse position
<source>&quot;perf probe -l&quot; failed to start. Is perf installed?</source> <source>&quot;perf probe -l&quot; failed to start. Is perf installed?</source>
<translation>Не удалось запустить «perf probe -l». Установлен perf?</translation> <translation>Не удалось запустить «perf probe -l». Установлен perf?</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfDataReader</name>
<message> <message>
<source>Perf Data Parser Failed</source> <source>Perf Data Parser Failed</source>
<translation>Не удалось разобрать данные Perf</translation> <translation>Не удалось разобрать данные Perf</translation>
@@ -28880,9 +28871,6 @@ If set to false, the target will be moved straight to the current mouse position
<source>The Perf data parser does not accept further input. Your trace is incomplete.</source> <source>The Perf data parser does not accept further input. Your trace is incomplete.</source>
<translation>Обработчик данных Perf больше не поддерживает ввод. Трассировка не полная.</translation> <translation>Обработчик данных Perf больше не поддерживает ввод. Трассировка не полная.</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfLoadDialog</name>
<message> <message>
<source>Load Perf Trace</source> <source>Load Perf Trace</source>
<translation>Загрузка трассировки Perf</translation> <translation>Загрузка трассировки Perf</translation>
@@ -28919,23 +28907,14 @@ If set to false, the target will be moved straight to the current mouse position
<source>Choose Directory of Executable</source> <source>Choose Directory of Executable</source>
<translation>Выбор каталога приложения</translation> <translation>Выбор каталога приложения</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerFlameGraphModel</name>
<message> <message>
<source>[unknown]</source> <source>[unknown]</source>
<translation>[неизвестная]</translation> <translation>[неизвестная]</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerRunner</name>
<message> <message>
<source>Failed to transfer Perf data to perfparser.</source> <source>Failed to transfer Perf data to perfparser.</source>
<translation>Не удалось передать данные Perf в perfparser.</translation> <translation>Не удалось передать данные Perf в perfparser.</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTool</name>
<message> <message>
<source>Performance Analyzer Options</source> <source>Performance Analyzer Options</source>
<translation>Параметры анализатора производительности</translation> <translation>Параметры анализатора производительности</translation>
@@ -29066,9 +29045,6 @@ You might find further explanations in the Application Output view.</source>
<source>Processing delay: %1.%2s</source> <source>Processing delay: %1.%2s</source>
<translation>Задержка обработки: %1.%2 сек</translation> <translation>Задержка обработки: %1.%2 сек</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTraceFile</name>
<message> <message>
<source>Invalid data format. The trace file&apos;s identification string is &quot;%1&quot;.An acceptable trace file should have &quot;%2&quot;. You cannot read trace files generated with older versions of Qt Creator.</source> <source>Invalid data format. The trace file&apos;s identification string is &quot;%1&quot;.An acceptable trace file should have &quot;%2&quot;. You cannot read trace files generated with older versions of Qt Creator.</source>
<translation>Неверный формат данных. У файла трассировки задана строка идентификации «%1». А допустимой является «%2». Нельзя читать файлы трассировки, созданные старыми версиями Qt Creator.</translation> <translation>Неверный формат данных. У файла трассировки задана строка идентификации «%1». А допустимой является «%2». Нельзя читать файлы трассировки, созданные старыми версиями Qt Creator.</translation>
@@ -29077,9 +29053,6 @@ You might find further explanations in the Application Output view.</source>
<source>Invalid data format. The trace file was written with data stream version %1. We can read at most version %2. Please use a newer version of Qt.</source> <source>Invalid data format. The trace file was written with data stream version %1. We can read at most version %2. Please use a newer version of Qt.</source>
<translation>Неверный формат данных. Файл трассировки был записан потоком данных версии %1, а поддерживается максимум %2. Используйте более позднюю версию Qt.</translation> <translation>Неверный формат данных. Файл трассировки был записан потоком данных версии %1, а поддерживается максимум %2. Используйте более позднюю версию Qt.</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfProfilerTraceManager</name>
<message> <message>
<source>Thread started</source> <source>Thread started</source>
<translation>Поток запущен</translation> <translation>Поток запущен</translation>
@@ -29112,17 +29085,10 @@ You might find further explanations in the Application Output view.</source>
<source>Saving Trace Data</source> <source>Saving Trace Data</source>
<translation>Сохранение данных трассировки</translation> <translation>Сохранение данных трассировки</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfTimelineModel</name>
<message> <message>
<source>sample collected</source> <source>sample collected</source>
<translation>сделан семпл</translation> <translation>сделан семпл</translation>
</message> </message>
<message>
<source>[unknown]</source>
<translation>[неизвестная]</translation>
</message>
<message> <message>
<source>Details</source> <source>Details</source>
<translation>Описание</translation> <translation>Описание</translation>
@@ -29211,9 +29177,6 @@ You might find further explanations in the Application Output view.</source>
<source>Resource Guesses</source> <source>Resource Guesses</source>
<translation>Оценка ресурсов</translation> <translation>Оценка ресурсов</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::Internal::PerfTracePointDialog</name>
<message> <message>
<source>Creating Memory Trace Points</source> <source>Creating Memory Trace Points</source>
<translation>Создание точек трассировки памяти</translation> <translation>Создание точек трассировки памяти</translation>
@@ -29250,39 +29213,18 @@ You might find further explanations in the Application Output view.</source>
<source>Failed to run trace point script: %1</source> <source>Failed to run trace point script: %1</source>
<translation>Не удалось запустить скрипт: %1</translation> <translation>Не удалось запустить скрипт: %1</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::PerfOptionsPage</name>
<message> <message>
<source>CPU Usage</source> <source>CPU Usage</source>
<translation>Загрузка CPU</translation> <translation>Загрузка CPU</translation>
</message> </message>
</context>
<context>
<name>PerfProfiler::PerfRunConfigurationAspect</name>
<message> <message>
<source>Performance Analyzer Settings</source> <source>Performance Analyzer Settings</source>
<translation>Настройки анализатора производительности</translation> <translation>Настройки анализатора производительности</translation>
</message> </message>
</context>
<context>
<name>PerfProfilerFlameGraphView</name>
<message>
<source>Samples</source>
<translation>Семплы</translation>
</message>
<message> <message>
<source>Function</source> <source>Function</source>
<translation>Функция</translation> <translation>Функция</translation>
</message> </message>
<message>
<source>Source</source>
<translation>Источник</translation>
</message>
<message>
<source>Binary</source>
<translation>Двоичный</translation>
</message>
<message> <message>
<source>Allocations</source> <source>Allocations</source>
<translation>Выделений</translation> <translation>Выделений</translation>
@@ -29308,17 +29250,10 @@ You might find further explanations in the Application Output view.</source>
<source>Various</source> <source>Various</source>
<translation>Разное</translation> <translation>Разное</translation>
</message> </message>
</context>
<context>
<name>PerfProfilerStatisticsView</name>
<message> <message>
<source>Address</source> <source>Address</source>
<translation>Адрес</translation> <translation>Адрес</translation>
</message> </message>
<message>
<source>Function</source>
<translation>Функция</translation>
</message>
<message> <message>
<source>Source Location</source> <source>Source Location</source>
<translation>Положение в исходнике</translation> <translation>Положение в исходнике</translation>
@@ -29347,10 +29282,6 @@ You might find further explanations in the Application Output view.</source>
<source>Recursion in Percent</source> <source>Recursion in Percent</source>
<translation>Рекурсия в процентах</translation> <translation>Рекурсия в процентах</translation>
</message> </message>
<message>
<source>Samples</source>
<translation>Семплы</translation>
</message>
<message> <message>
<source>Samples in Percent</source> <source>Samples in Percent</source>
<translation>Семплы в процентах</translation> <translation>Семплы в процентах</translation>

View File

@@ -24,24 +24,24 @@ FlameGraphView {
] ]
trRoleNames: [ trRoleNames: [
PerfProfilerFlameGraphModel.SamplesRole, qsTr("Samples"), PerfProfilerFlameGraphModel.SamplesRole, qsTranslate("PerfProfiler", "Samples"),
PerfProfilerFlameGraphModel.FunctionRole, qsTr("Function"), PerfProfilerFlameGraphModel.FunctionRole, qsTranslate("PerfProfiler", "Function"),
PerfProfilerFlameGraphModel.SourceFileRole, qsTr("Source"), PerfProfilerFlameGraphModel.SourceFileRole, qsTranslate("PerfProfiler", "Source"),
PerfProfilerFlameGraphModel.ElfFileRole, qsTr("Binary"), PerfProfilerFlameGraphModel.ElfFileRole, qsTranslate("PerfProfiler", "Binary"),
PerfProfilerFlameGraphModel.ResourceAllocationsRole, qsTr("Allocations"), PerfProfilerFlameGraphModel.ResourceAllocationsRole, qsTranslate("PerfProfiler", "Allocations"),
PerfProfilerFlameGraphModel.ObservedResourceAllocationsRole, qsTr(" observed"), PerfProfilerFlameGraphModel.ObservedResourceAllocationsRole, qsTranslate("PerfProfiler", " observed"),
PerfProfilerFlameGraphModel.LostResourceRequestsRole, qsTr(" guessed"), PerfProfilerFlameGraphModel.LostResourceRequestsRole, qsTranslate("PerfProfiler", " guessed"),
PerfProfilerFlameGraphModel.ResourceReleasesRole, qsTr("Releases"), PerfProfilerFlameGraphModel.ResourceReleasesRole, qsTranslate("PerfProfiler", "Releases"),
PerfProfilerFlameGraphModel.ObservedResourceReleasesRole, qsTr(" observed"), PerfProfilerFlameGraphModel.ObservedResourceReleasesRole, qsTranslate("PerfProfiler", " observed"),
PerfProfilerFlameGraphModel.GuessedResourceReleasesRole, qsTr(" guessed"), PerfProfilerFlameGraphModel.GuessedResourceReleasesRole, qsTranslate("PerfProfiler", " guessed"),
PerfProfilerFlameGraphModel.ResourcePeakRole, qsTr("Peak Usage") PerfProfilerFlameGraphModel.ResourcePeakRole, qsTranslate("PerfProfiler", "Peak Usage")
].reduce(toMap, {}) ].reduce(toMap, {})
details: function(flameGraph) { details: function(flameGraph) {
var model = []; var model = [];
if (!flameGraph.dataValid) { if (!flameGraph.dataValid) {
model.push(trRoleNames[PerfProfilerFlameGraphModel.FunctionRole]); model.push(trRoleNames[PerfProfilerFlameGraphModel.FunctionRole]);
model.push(qsTr("Various")); model.push(qsTranslate("PerfProfiler", "Various"));
} else { } else {
function addDetail(role, format) { root.addDetail(role, format, model, flameGraph); } function addDetail(role, format) { root.addDetail(role, format, model, flameGraph); }

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfconfigeventsmodel.h" #include "perfconfigeventsmodel.h"
#include "perfprofilertr.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
@@ -165,10 +166,10 @@ QVariant PerfConfigEventsModel::headerData(int section, Qt::Orientation orientat
return QVariant(); return QVariant();
switch (section) { switch (section) {
case ColumnEventType: return tr("Event Type"); case ColumnEventType: return Tr::tr("Event Type");
case ColumnSubType: return tr("Counter"); case ColumnSubType: return Tr::tr("Counter");
case ColumnOperation: return tr("Operation"); case ColumnOperation: return Tr::tr("Operation");
case ColumnResult: return tr("Result"); case ColumnResult: return Tr::tr("Result");
default: return QVariant(); default: return QVariant();
} }

View File

@@ -4,6 +4,7 @@
#include "perfconfigeventsmodel.h" #include "perfconfigeventsmodel.h"
#include "perfconfigwidget.h" #include "perfconfigwidget.h"
#include "perfprofilerconstants.h" #include "perfprofilerconstants.h"
#include "perfprofilertr.h"
#include <coreplugin/messagebox.h> #include <coreplugin/messagebox.h>
@@ -62,20 +63,20 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent)
eventsView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); eventsView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
useTracePointsButton = new QPushButton(this); useTracePointsButton = new QPushButton(this);
useTracePointsButton->setText(tr("Use Trace Points")); useTracePointsButton->setText(Tr::tr("Use Trace Points"));
useTracePointsButton->setVisible(false); useTracePointsButton->setVisible(false);
connect(useTracePointsButton, &QPushButton::pressed, connect(useTracePointsButton, &QPushButton::pressed,
this, &PerfConfigWidget::readTracePoints); this, &PerfConfigWidget::readTracePoints);
addEventButton = new QPushButton(this); addEventButton = new QPushButton(this);
addEventButton->setText(tr("Add Event")); addEventButton->setText(Tr::tr("Add Event"));
connect(addEventButton, &QPushButton::pressed, this, [this]() { connect(addEventButton, &QPushButton::pressed, this, [this]() {
auto model = eventsView->model(); auto model = eventsView->model();
model->insertRow(model->rowCount()); model->insertRow(model->rowCount());
}); });
removeEventButton = new QPushButton(this); removeEventButton = new QPushButton(this);
removeEventButton->setText(tr("Remove Event")); removeEventButton->setText(Tr::tr("Remove Event"));
connect(removeEventButton, &QPushButton::pressed, this, [this]() { connect(removeEventButton, &QPushButton::pressed, this, [this]() {
QModelIndex index = eventsView->currentIndex(); QModelIndex index = eventsView->currentIndex();
if (index.isValid()) if (index.isValid())
@@ -83,7 +84,7 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent)
}); });
resetButton = new QPushButton(this); resetButton = new QPushButton(this);
resetButton->setText(tr("Reset")); resetButton->setText(Tr::tr("Reset"));
connect(resetButton, &QPushButton::pressed, m_settings, &PerfSettings::resetToDefault); connect(resetButton, &QPushButton::pressed, m_settings, &PerfSettings::resetToDefault);
using namespace Layouting; using namespace Layouting;
@@ -141,9 +142,9 @@ void PerfConfigWidget::apply()
void PerfConfigWidget::readTracePoints() void PerfConfigWidget::readTracePoints()
{ {
QMessageBox messageBox; QMessageBox messageBox;
messageBox.setWindowTitle(tr("Use Trace Points")); messageBox.setWindowTitle(Tr::tr("Use Trace Points"));
messageBox.setIcon(QMessageBox::Question); messageBox.setIcon(QMessageBox::Question);
messageBox.setText(tr("Replace events with trace points read from the device?")); messageBox.setText(Tr::tr("Replace events with trace points read from the device?"));
messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
if (messageBox.exec() == QMessageBox::Yes) { if (messageBox.exec() == QMessageBox::Yes) {
m_process->start(); m_process->start();
@@ -155,8 +156,8 @@ void PerfConfigWidget::handleProcessDone()
{ {
if (m_process->error() == QProcess::FailedToStart) { if (m_process->error() == QProcess::FailedToStart) {
Core::AsynchronousMessageBox::warning( Core::AsynchronousMessageBox::warning(
tr("Cannot List Trace Points"), Tr::tr("Cannot List Trace Points"),
tr("\"perf probe -l\" failed to start. Is perf installed?")); Tr::tr("\"perf probe -l\" failed to start. Is perf installed?"));
useTracePointsButton->setEnabled(true); useTracePointsButton->setEnabled(true);
return; return;
} }
@@ -178,8 +179,8 @@ void PerfConfigWidget::handleProcessDone()
if (tracePoints.isEmpty()) { if (tracePoints.isEmpty()) {
Core::AsynchronousMessageBox::warning( Core::AsynchronousMessageBox::warning(
tr("No Trace Points Found"), Tr::tr("No Trace Points Found"),
tr("Trace points can be defined with \"perf probe -a\".")); Tr::tr("Trace points can be defined with \"perf probe -a\"."));
} else { } else {
for (const QByteArray &event : qAsConst(tracePoints)) { for (const QByteArray &event : qAsConst(tracePoints)) {
int row = model->rowCount(); int row = model->rowCount();

View File

@@ -4,6 +4,7 @@
#include "perfdatareader.h" #include "perfdatareader.h"
#include "perfprofilerconstants.h" #include "perfprofilerconstants.h"
#include "perfprofilerplugin.h" #include "perfprofilerplugin.h"
#include "perfprofilertr.h"
#include "perfrunconfigurationaspect.h" #include "perfrunconfigurationaspect.h"
#include "perfsettings.h" #include "perfsettings.h"
#include "perftimelinemodel.h" #include "perftimelinemodel.h"
@@ -58,9 +59,9 @@ PerfDataReader::PerfDataReader(QObject *parent) :
} }
if (exitCode != 0) { if (exitCode != 0) {
QMessageBox::warning(Core::ICore::dialogParent(), QMessageBox::warning(Core::ICore::dialogParent(),
tr("Perf Data Parser Failed"), Tr::tr("Perf Data Parser Failed"),
tr("The Perf data parser failed to process all the samples. " Tr::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));
} }
}); });
@@ -84,18 +85,18 @@ 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::tr("perfparser failed to start."));
QMessageBox::warning(Core::ICore::dialogParent(), QMessageBox::warning(Core::ICore::dialogParent(),
tr("Perf Data Parser Failed"), Tr::tr("Perf Data Parser Failed"),
tr("Could not start the perfparser utility program. " Tr::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 "
"given by the PERFPROFILER_PARSER_FILEPATH environment " "location given by the PERFPROFILER_PARSER_FILEPATH "
"variable.")); "environment variable."));
break; break;
case QProcess::Crashed: case QProcess::Crashed:
QMessageBox::warning(Core::ICore::dialogParent(), QMessageBox::warning(Core::ICore::dialogParent(),
tr("Perf Data Parser Crashed"), Tr::tr("Perf Data Parser Crashed"),
tr("This is a bug. Please report it.")); Tr::tr("This is a bug. Please report it."));
break; break;
case QProcess::ReadError: case QProcess::ReadError:
qWarning() << "Cannot receive data from perfparser"; qWarning() << "Cannot receive data from perfparser";
@@ -186,13 +187,13 @@ void PerfDataReader::triggerRecordingStateChange(bool recording)
static_cast<qint64>(std::numeric_limits<int>::max()))); static_cast<qint64>(std::numeric_limits<int>::max())));
Core::FutureProgress *fp = Core::ProgressManager::addTimedTask( Core::FutureProgress *fp = Core::ProgressManager::addTimedTask(
future(), tr("Skipping Processing Delay"), future(), Tr::tr("Skipping Processing Delay"),
Constants::PerfProfilerTaskSkipDelay, seconds); Constants::PerfProfilerTaskSkipDelay, seconds);
fp->setToolTip(recording ? fp->setToolTip(recording ?
tr("Cancel this to ignore the processing delay and immediately " Tr::tr("Cancel this to ignore the processing delay and immediately "
"start recording.") : "start recording.") :
tr("Cancel this to ignore the processing delay and immediately " Tr::tr("Cancel this to ignore the processing delay and immediately "
"stop recording.")); "stop recording."));
connect(fp, &Core::FutureProgress::canceled, this, [this, recording]() { connect(fp, &Core::FutureProgress::canceled, this, [this, recording]() {
setRecording(recording); setRecording(recording);
}); });
@@ -325,9 +326,9 @@ void PerfDataReader::writeChunk()
m_input.kill(); m_input.kill();
emit finished(); emit finished();
QMessageBox::warning(Core::ICore::dialogParent(), QMessageBox::warning(Core::ICore::dialogParent(),
tr("Cannot Send Data to Perf Data Parser"), Tr::tr("Cannot Send Data to Perf Data Parser"),
tr("The Perf data parser does not accept further input. " Tr::tr("The Perf data parser does not accept further input. "
"Your trace is incomplete.")); "Your trace is incomplete."));
} }
} }
} else if (m_dataFinished && m_input.isWritable()) { } else if (m_dataFinished && m_input.isWritable()) {

View File

@@ -2,8 +2,8 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfloaddialog.h" #include "perfloaddialog.h"
#include "perfprofilerconstants.h" #include "perfprofilerconstants.h"
#include "perfprofilertr.h"
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/kit.h> #include <projectexplorer/kit.h>
@@ -28,20 +28,20 @@ namespace Internal {
PerfLoadDialog::PerfLoadDialog(QWidget *parent) PerfLoadDialog::PerfLoadDialog(QWidget *parent)
: QDialog(parent) : QDialog(parent)
{ {
setWindowTitle(tr("Load Perf Trace")); setWindowTitle(Tr::tr("Load Perf Trace"));
resize(710, 164); resize(710, 164);
auto label1 = new QLabel(tr("&Trace file:")); auto label1 = new QLabel(Tr::tr("&Trace file:"));
m_traceFileLineEdit = new QLineEdit(this); m_traceFileLineEdit = new QLineEdit(this);
label1->setBuddy(m_traceFileLineEdit); label1->setBuddy(m_traceFileLineEdit);
auto browseTraceFileButton = new QPushButton(tr("&Browse...")); auto browseTraceFileButton = new QPushButton(Tr::tr("&Browse..."));
auto label2 = new QLabel(tr("Directory of &executable:")); auto label2 = new QLabel(Tr::tr("Directory of &executable:"));
m_executableDirLineEdit = new QLineEdit(this); m_executableDirLineEdit = new QLineEdit(this);
label2->setBuddy(m_executableDirLineEdit); label2->setBuddy(m_executableDirLineEdit);
auto browseExecutableDirButton = new QPushButton(tr("B&rowse...")); auto browseExecutableDirButton = new QPushButton(Tr::tr("B&rowse..."));
auto label3 = new QLabel(tr("Kit:")); auto label3 = new QLabel(Tr::tr("Kit:"));
m_kitChooser = new ProjectExplorer::KitChooser(this); m_kitChooser = new ProjectExplorer::KitChooser(this);
m_kitChooser->populate(); m_kitChooser->populate();
@@ -90,8 +90,8 @@ ProjectExplorer::Kit *PerfLoadDialog::kit() const
void PerfLoadDialog::on_browseTraceFileButton_pressed() void PerfLoadDialog::on_browseTraceFileButton_pressed()
{ {
FilePath filePath = FileUtils::getOpenFilePath( FilePath filePath = FileUtils::getOpenFilePath(
this, tr("Choose Perf Trace"), {}, this, Tr::tr("Choose Perf Trace"), {},
tr("Perf traces (*%1)").arg(Constants::TraceFileExtension)); Tr::tr("Perf traces (*%1)").arg(Constants::TraceFileExtension));
if (filePath.isEmpty()) if (filePath.isEmpty())
return; return;
@@ -101,7 +101,7 @@ void PerfLoadDialog::on_browseTraceFileButton_pressed()
void PerfLoadDialog::on_browseExecutableDirButton_pressed() void PerfLoadDialog::on_browseExecutableDirButton_pressed()
{ {
FilePath filePath = FileUtils::getExistingDirectory( FilePath filePath = FileUtils::getExistingDirectory(
this, tr("Choose Directory of Executable")); this, Tr::tr("Choose Directory of Executable"));
if (filePath.isEmpty()) if (filePath.isEmpty())
return; return;

View File

@@ -1,10 +1,10 @@
// Copyright (C) 2018 The Qt Company Ltd. // Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfoptionspage.h"
#include "perfconfigwidget.h" #include "perfconfigwidget.h"
#include "perfoptionspage.h"
#include "perfprofilerconstants.h" #include "perfprofilerconstants.h"
#include "perfprofilertr.h"
#include <debugger/analyzer/analyzericons.h> #include <debugger/analyzer/analyzericons.h>
@@ -14,7 +14,7 @@ namespace Internal {
PerfOptionsPage::PerfOptionsPage(PerfSettings *settings) PerfOptionsPage::PerfOptionsPage(PerfSettings *settings)
{ {
setId(Constants::PerfSettingsId); setId(Constants::PerfSettingsId);
setDisplayName(QCoreApplication::translate("PerfProfiler::PerfOptionsPage", "CPU Usage")); setDisplayName(Tr::tr("CPU Usage"));
setCategory("T.Analyzer"); setCategory("T.Analyzer");
setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer")); setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfprofilerflamegraphmodel.h" #include "perfprofilerflamegraphmodel.h"
#include "perfprofilertr.h"
#include <QFileInfo> #include <QFileInfo>
#include <QQueue> #include <QQueue>
@@ -143,7 +144,7 @@ int PerfProfilerFlameGraphModel::columnCount(const QModelIndex &parent) const
static const QByteArray &orUnknown(const QByteArray &string) static const QByteArray &orUnknown(const QByteArray &string)
{ {
static const QByteArray unknown = PerfProfilerFlameGraphModel::tr("[unknown]").toUtf8(); static const QByteArray unknown = Tr::tr("[unknown]").toUtf8();
return string.isEmpty() ? unknown : string; return string.isEmpty() ? unknown : string;
} }

View File

@@ -108,10 +108,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 (m_process->error() == QProcess::FailedToStart) { if (m_process->error() == QProcess::FailedToStart) {
const QString msg = tr("Perf Process Failed to Start"); const QString msg = Tr::tr("Perf Process Failed to Start");
QMessageBox::warning(Core::ICore::dialogParent(), msg, QMessageBox::warning(Core::ICore::dialogParent(), msg,
tr("Make sure that you are running a recent Linux kernel and " Tr::tr("Make sure that you are running a recent Linux kernel "
"that the \"perf\" utility is available.")); "and that the \"perf\" utility is available."));
reportFailure(msg); reportFailure(msg);
return; return;
} }
@@ -192,7 +192,7 @@ void PerfProfilerRunner::start()
}); });
connect(recorder, &QtcProcess::readyReadStandardOutput, this, [this, reader, recorder] { connect(recorder, &QtcProcess::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::tr("Failed to transfer Perf data to perfparser."));
}); });
} }

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfprofilerstatisticsmodel.h" #include "perfprofilerstatisticsmodel.h"
#include "perfprofilertr.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -11,19 +12,19 @@ namespace PerfProfiler {
namespace Internal { namespace Internal {
static const char *headerLabels[] = { static const char *headerLabels[] = {
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Address"), QT_TRANSLATE_NOOP("PerfProfiler", "Address"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Function"), QT_TRANSLATE_NOOP("PerfProfiler", "Function"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Source Location"), QT_TRANSLATE_NOOP("PerfProfiler", "Source Location"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Binary Location"), QT_TRANSLATE_NOOP("PerfProfiler", "Binary Location"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Caller"), QT_TRANSLATE_NOOP("PerfProfiler", "Caller"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Callee"), QT_TRANSLATE_NOOP("PerfProfiler", "Callee"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Occurrences"), QT_TRANSLATE_NOOP("PerfProfiler", "Occurrences"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Occurrences in Percent"), QT_TRANSLATE_NOOP("PerfProfiler", "Occurrences in Percent"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Recursion in Percent"), QT_TRANSLATE_NOOP("PerfProfiler", "Recursion in Percent"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Samples"), QT_TRANSLATE_NOOP("PerfProfiler", "Samples"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Samples in Percent"), QT_TRANSLATE_NOOP("PerfProfiler", "Samples in Percent"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Self Samples"), QT_TRANSLATE_NOOP("PerfProfiler", "Self Samples"),
QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Self in Percent") QT_TRANSLATE_NOOP("PerfProfiler", "Self in Percent")
}; };
Q_STATIC_ASSERT(sizeof(headerLabels) == Q_STATIC_ASSERT(sizeof(headerLabels) ==
@@ -102,7 +103,7 @@ QVariant PerfProfilerStatisticsModel::headerData(int section, Qt::Orientation or
if (role != Qt::DisplayRole || orientation != Qt::Horizontal) if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
return QVariant(); return QVariant();
return tr(headerLabels[m_columns[section]]); return Tr::tr(headerLabels[m_columns[section]]);
} }
void PerfProfilerStatisticsMainModel::resort() void PerfProfilerStatisticsMainModel::resort()

View File

@@ -64,30 +64,30 @@ PerfProfilerTool::PerfProfilerTool()
m_zoomControl = new Timeline::TimelineZoomControl(this); m_zoomControl = new Timeline::TimelineZoomControl(this);
ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER); ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER);
ActionContainer *options = ActionManager::createMenu(Constants::PerfOptionsMenuId); ActionContainer *options = ActionManager::createMenu(Constants::PerfOptionsMenuId);
options->menu()->setTitle(tr("Performance Analyzer Options")); options->menu()->setTitle(Tr::tr("Performance Analyzer Options"));
menu->addMenu(options, Debugger::Constants::G_ANALYZER_OPTIONS); menu->addMenu(options, Debugger::Constants::G_ANALYZER_OPTIONS);
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::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::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::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);
options->addAction(command); options->addAction(command);
m_limitToRange = new QAction(tr("Limit to Range Selected in Timeline"), options); m_limitToRange = new QAction(Tr::tr("Limit to Range Selected in Timeline"), options);
command = Core::ActionManager::registerAction(m_limitToRange, Constants::PerfProfilerTaskLimit, command = Core::ActionManager::registerAction(m_limitToRange, Constants::PerfProfilerTaskLimit,
globalContext); globalContext);
connect(m_limitToRange, &QAction::triggered, this, [this]() { connect(m_limitToRange, &QAction::triggered, this, [this]() {
@@ -97,7 +97,7 @@ PerfProfilerTool::PerfProfilerTool()
}); });
options->addAction(command); options->addAction(command);
m_showFullRange = new QAction(tr("Show Full Range"), options); m_showFullRange = new QAction(Tr::tr("Show Full Range"), options);
command = Core::ActionManager::registerAction(m_showFullRange, command = Core::ActionManager::registerAction(m_showFullRange,
Constants::PerfProfilerTaskFullRange, Constants::PerfProfilerTaskFullRange,
globalContext); globalContext);
@@ -106,11 +106,11 @@ PerfProfilerTool::PerfProfilerTool()
}); });
options->addAction(command); options->addAction(command);
QAction *tracePointsAction = new QAction(tr("Create Memory Trace Points"), options); QAction *tracePointsAction = new QAction(Tr::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::tr("Create trace points for memory profiling on the target "
"device.")); "device."));
command = Core::ActionManager::registerAction(tracePointsAction, command = Core::ActionManager::registerAction(tracePointsAction,
Constants::PerfProfilerTaskTracePoints, Constants::PerfProfilerTaskTracePoints,
globalContext); globalContext);
@@ -121,8 +121,8 @@ PerfProfilerTool::PerfProfilerTool()
m_tracePointsButton->setDefaultAction(tracePointsAction); m_tracePointsButton->setDefaultAction(tracePointsAction);
m_objectsToDelete << m_tracePointsButton; m_objectsToDelete << m_tracePointsButton;
auto action = new QAction(tr("Performance Analyzer"), this); auto action = new QAction(Tr::tr("Performance Analyzer"), this);
action->setToolTip(tr("Finds performance bottlenecks.")); action->setToolTip(Tr::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] {
@@ -168,15 +168,15 @@ void PerfProfilerTool::createViews()
{ {
m_objectsToDelete.clear(); m_objectsToDelete.clear();
m_traceView = new PerfProfilerTraceView(nullptr, this); m_traceView = new PerfProfilerTraceView(nullptr, this);
m_traceView->setWindowTitle(tr("Timeline")); m_traceView->setWindowTitle(Tr::tr("Timeline"));
connect(m_traceView, &PerfProfilerTraceView::gotoSourceLocation, connect(m_traceView, &PerfProfilerTraceView::gotoSourceLocation,
this, &PerfProfilerTool::gotoSourceLocation); this, &PerfProfilerTool::gotoSourceLocation);
m_statisticsView = new PerfProfilerStatisticsView(nullptr, this); m_statisticsView = new PerfProfilerStatisticsView(nullptr, this);
m_statisticsView->setWindowTitle(tr("Statistics")); m_statisticsView->setWindowTitle(Tr::tr("Statistics"));
m_flameGraphView = new PerfProfilerFlameGraphView(nullptr, this); m_flameGraphView = new PerfProfilerFlameGraphView(nullptr, this);
m_flameGraphView->setWindowTitle(tr("Flame Graph")); m_flameGraphView->setWindowTitle(Tr::tr("Flame Graph"));
connect(m_statisticsView, &PerfProfilerStatisticsView::gotoSourceLocation, connect(m_statisticsView, &PerfProfilerStatisticsView::gotoSourceLocation,
this, &PerfProfilerTool::gotoSourceLocation); this, &PerfProfilerTool::gotoSourceLocation);
@@ -243,7 +243,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::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());
@@ -264,7 +264,7 @@ void PerfProfilerTool::createViews()
connect(m_traceManager, &PerfProfilerTraceManager::error, this, [](const QString &message) { connect(m_traceManager, &PerfProfilerTraceManager::error, this, [](const QString &message) {
QMessageBox *errorDialog = new QMessageBox(ICore::dialogParent()); QMessageBox *errorDialog = new QMessageBox(ICore::dialogParent());
errorDialog->setIcon(QMessageBox::Warning); errorDialog->setIcon(QMessageBox::Warning);
errorDialog->setWindowTitle(tr("Performance Analyzer")); errorDialog->setWindowTitle(Tr::tr("Performance Analyzer"));
errorDialog->setText(message); errorDialog->setText(message);
errorDialog->setStandardButtons(QMessageBox::Ok); errorDialog->setStandardButtons(QMessageBox::Ok);
errorDialog->setDefaultButton(QMessageBox::Ok); errorDialog->setDefaultButton(QMessageBox::Ok);
@@ -286,10 +286,10 @@ void PerfProfilerTool::createViews()
QMenu *menu1 = new QMenu(m_traceView); QMenu *menu1 = new QMenu(m_traceView);
addLoadSaveActionsToMenu(menu1); addLoadSaveActionsToMenu(menu1);
connect(menu1->addAction(tr("Limit to Selected Range")), &QAction::triggered, connect(menu1->addAction(Tr::tr("Limit to Selected Range")), &QAction::triggered,
m_limitToRange, &QAction::trigger); m_limitToRange, &QAction::trigger);
menu1->addAction(m_showFullRange); menu1->addAction(m_showFullRange);
connect(menu1->addAction(tr("Reset Zoom")), &QAction::triggered, this, [this](){ connect(menu1->addAction(Tr::tr("Reset Zoom")), &QAction::triggered, this, [this](){
m_zoomControl->setRange(m_zoomControl->traceStart(), m_zoomControl->traceEnd()); m_zoomControl->setRange(m_zoomControl->traceStart(), m_zoomControl->traceEnd());
}); });
@@ -301,13 +301,13 @@ void PerfProfilerTool::createViews()
menu1 = new QMenu(m_statisticsView); menu1 = new QMenu(m_statisticsView);
addLoadSaveActionsToMenu(menu1); addLoadSaveActionsToMenu(menu1);
connect(menu1->addAction(tr("Limit to Range Selected in Timeline")), &QAction::triggered, connect(menu1->addAction(Tr::tr("Limit to Range Selected in Timeline")), &QAction::triggered,
m_limitToRange, &QAction::trigger); m_limitToRange, &QAction::trigger);
connect(menu1->addAction(tr("Show Full Range")), &QAction::triggered, connect(menu1->addAction(Tr::tr("Show Full Range")), &QAction::triggered,
m_showFullRange, &QAction::trigger); m_showFullRange, &QAction::trigger);
connect(menu1->addAction(tr("Copy Table")), &QAction::triggered, connect(menu1->addAction(Tr::tr("Copy Table")), &QAction::triggered,
m_statisticsView, &PerfProfilerStatisticsView::copyFocusedTableToClipboard); m_statisticsView, &PerfProfilerStatisticsView::copyFocusedTableToClipboard);
QAction *copySelection = menu1->addAction(tr("Copy Row")); QAction *copySelection = menu1->addAction(Tr::tr("Copy Row"));
connect(copySelection, &QAction::triggered, connect(copySelection, &QAction::triggered,
m_statisticsView, &PerfProfilerStatisticsView::copyFocusedSelectionToClipboard); m_statisticsView, &PerfProfilerStatisticsView::copyFocusedSelectionToClipboard);
m_statisticsView->setContextMenuPolicy(Qt::CustomContextMenu); m_statisticsView->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -319,11 +319,11 @@ void PerfProfilerTool::createViews()
menu1 = new QMenu(m_flameGraphView); menu1 = new QMenu(m_flameGraphView);
addLoadSaveActionsToMenu(menu1); addLoadSaveActionsToMenu(menu1);
connect(menu1->addAction(tr("Limit to Range Selected in Timeline")), &QAction::triggered, connect(menu1->addAction(Tr::tr("Limit to Range Selected in Timeline")), &QAction::triggered,
m_limitToRange, &QAction::trigger); m_limitToRange, &QAction::trigger);
connect(menu1->addAction(tr("Show Full Range")), &QAction::triggered, connect(menu1->addAction(Tr::tr("Show Full Range")), &QAction::triggered,
m_showFullRange, &QAction::trigger); m_showFullRange, &QAction::trigger);
QAction *resetAction = menu1->addAction(tr("Reset Flame Graph")); QAction *resetAction = menu1->addAction(Tr::tr("Reset Flame Graph"));
connect(resetAction, &QAction::triggered, connect(resetAction, &QAction::triggered,
m_flameGraphView, &PerfProfilerFlameGraphView::resetRoot); m_flameGraphView, &PerfProfilerFlameGraphView::resetRoot);
m_flameGraphView->setContextMenuPolicy(Qt::CustomContextMenu); m_flameGraphView->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -398,12 +398,12 @@ void PerfProfilerTool::onReaderFinished()
m_readerRunning = false; m_readerRunning = false;
if (m_traceManager->traceDuration() <= 0) { if (m_traceManager->traceDuration() <= 0) {
QMessageBox::warning(Core::ICore::dialogParent(), QMessageBox::warning(Core::ICore::dialogParent(),
tr("No Data Loaded"), Tr::tr("No Data Loaded"),
tr("The profiler did not produce any samples. " Tr::tr("The profiler did not produce any samples. "
"Make sure that you are running a recent Linux kernel and that " "Make sure that you are running a recent Linux kernel and that "
"the \"perf\" utility is available and generates useful call " "the \"perf\" utility is available and generates useful call "
"graphs.\nYou might find further explanations in the Application " "graphs.\nYou might find further explanations in the "
"Output view.")); "Application Output view."));
clear(); clear();
} else { } else {
m_traceManager->finalize(); m_traceManager->finalize();
@@ -437,11 +437,11 @@ void PerfProfilerTool::updateRunActions()
m_stopAction->setEnabled(m_processRunning); m_stopAction->setEnabled(m_processRunning);
if (m_readerRunning || m_processRunning) { if (m_readerRunning || m_processRunning) {
m_startAction->setEnabled(false); m_startAction->setEnabled(false);
m_startAction->setToolTip(tr("A performance analysis is still in progress.")); m_startAction->setToolTip(Tr::tr("A performance analysis is still in progress."));
m_loadPerfData->setEnabled(false); m_loadPerfData->setEnabled(false);
m_loadTrace->setEnabled(false); m_loadTrace->setEnabled(false);
} else { } else {
QString whyNot = tr("Start a performance analysis."); QString whyNot = Tr::tr("Start a performance analysis.");
bool canRun = ProjectExplorerPlugin::canRunStartupProject( bool canRun = ProjectExplorerPlugin::canRunStartupProject(
ProjectExplorer::Constants::PERFPROFILER_RUN_MODE, &whyNot); ProjectExplorer::Constants::PERFPROFILER_RUN_MODE, &whyNot);
m_startAction->setToolTip(whyNot); m_startAction->setToolTip(whyNot);
@@ -493,8 +493,8 @@ void PerfProfilerTool::updateFilterMenu()
{ {
m_filterMenu->clear(); m_filterMenu->clear();
QAction *enableAll = m_filterMenu->addAction(tr("Enable All")); QAction *enableAll = m_filterMenu->addAction(Tr::tr("Enable All"));
QAction *disableAll = m_filterMenu->addAction(tr("Disable All")); QAction *disableAll = m_filterMenu->addAction(Tr::tr("Disable All"));
m_filterMenu->addSeparator(); m_filterMenu->addSeparator();
QList<PerfProfilerTraceManager::Thread> threads = m_traceManager->threads().values(); QList<PerfProfilerTraceManager::Thread> threads = m_traceManager->threads().values();
@@ -600,8 +600,8 @@ void PerfProfilerTool::showLoadTraceDialog()
{ {
m_perspective.select(); m_perspective.select();
FilePath filePath = FileUtils::getOpenFilePath(nullptr, tr("Load Trace File"), FilePath filePath = FileUtils::getOpenFilePath(nullptr, Tr::tr("Load Trace File"),
{}, tr("Trace File (*.ptq)")); {}, Tr::tr("Trace File (*.ptq)"));
if (filePath.isEmpty()) if (filePath.isEmpty())
return; return;
@@ -619,8 +619,8 @@ void PerfProfilerTool::showSaveTraceDialog()
{ {
m_perspective.select(); m_perspective.select();
FilePath filePath = FileUtils::getSaveFilePath(nullptr, tr("Save Trace File"), FilePath filePath = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Trace File"),
{}, tr("Trace File (*.ptq)")); {}, Tr::tr("Trace File (*.ptq)"));
if (filePath.isEmpty()) if (filePath.isEmpty())
return; return;
if (!filePath.endsWith(".ptq")) if (!filePath.endsWith(".ptq"))
@@ -633,8 +633,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::tr("Show all addresses.")
: tr("Aggregate by functions.")); : Tr::tr("Aggregate by functions."));
emit aggregatedChanged(aggregated); emit aggregatedChanged(aggregated);
} }
@@ -645,8 +645,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::tr("Stop collecting profile data.") :
tr("Collect profile data.")); Tr::tr("Collect profile data."));
emit recordingChanged(recording); emit recordingChanged(recording);
} }
@@ -654,13 +654,13 @@ void PerfProfilerTool::updateTime(qint64 duration, qint64 delay)
{ {
qint64 e9 = 1e9, e8 = 1e8, ten = 10; // compiler would cast to double qint64 e9 = 1e9, e8 = 1e8, ten = 10; // compiler would cast to double
if (duration > 0) if (duration > 0)
m_recordedLabel->setText(tr("Recorded: %1.%2s").arg(duration / e9) m_recordedLabel->setText(Tr::tr("Recorded: %1.%2s").arg(duration / e9)
.arg(qAbs(duration / e8) % ten)); .arg(qAbs(duration / e8) % ten));
else if (duration == 0) else if (duration == 0)
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::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

@@ -6,6 +6,7 @@
#include "perfprofilerconstants.h" #include "perfprofilerconstants.h"
#include "perfprofilerflamegraphview.h" #include "perfprofilerflamegraphview.h"
#include "perfprofilerstatisticsview.h" #include "perfprofilerstatisticsview.h"
#include "perfprofilertr.h"
#include "perfprofilertraceview.h" #include "perfprofilertraceview.h"
#include "perftimelinemodelmanager.h" #include "perftimelinemodelmanager.h"
@@ -78,7 +79,7 @@ private:
void finalize(); void finalize();
Utils::Perspective m_perspective{Constants::PerfProfilerPerspectiveId, Utils::Perspective m_perspective{Constants::PerfProfilerPerspectiveId,
tr("Performance Analyzer")}; Tr::tr("Performance Analyzer")};
QAction *m_startAction = nullptr; QAction *m_startAction = nullptr;
QAction *m_stopAction = nullptr; QAction *m_stopAction = nullptr;

View File

@@ -3,6 +3,7 @@
#include "perfprofilerconstants.h" #include "perfprofilerconstants.h"
#include "perfprofilerplugin.h" #include "perfprofilerplugin.h"
#include "perfprofilertr.h"
#include "perfprofilertracefile.h" #include "perfprofilertracefile.h"
#include <app/app_version.h> #include <app/app_version.h>
@@ -246,12 +247,12 @@ void PerfProfilerTraceFile::readFromDevice()
} else if (strncmp(magic.data(), Constants::PerfZqfileMagic, magicSize) == 0) { } else if (strncmp(magic.data(), Constants::PerfZqfileMagic, magicSize) == 0) {
m_compressed = true; m_compressed = true;
} else { } else {
fail(tr("Invalid data format. The trace file's identification string is \"%1\"." fail(Tr::tr("Invalid data format. The trace file's identification string is \"%1\"."
"An acceptable trace file should have \"%2\". You cannot read trace files " "An acceptable trace file should have \"%2\". You cannot read trace files "
"generated with older versions of %3.") "generated with older versions of %3.")
.arg(QString::fromLatin1(magic)) .arg(QString::fromLatin1(magic))
.arg(QString::fromLatin1(Constants::PerfZqfileMagic) .arg(QString::fromLatin1(Constants::PerfZqfileMagic))
.arg(Core::Constants::IDE_DISPLAY_NAME))); .arg(Core::Constants::IDE_DISPLAY_NAME));
return; return;
} }
@@ -260,10 +261,10 @@ void PerfProfilerTraceFile::readFromDevice()
if (m_dataStreamVersion < 0 if (m_dataStreamVersion < 0
|| m_dataStreamVersion > QDataStream::Qt_DefaultCompiledVersion) { || m_dataStreamVersion > QDataStream::Qt_DefaultCompiledVersion) {
fail(tr("Invalid data format. The trace file was written with data stream version %1. " fail(Tr::tr("Invalid data format. The trace file was written with data stream version %1. "
"We can read at most version %2. Please use a newer version of Qt.") "We can read at most version %2. Please use a newer version of Qt.")
.arg(m_dataStreamVersion) .arg(m_dataStreamVersion)
.arg(qint32(QDataStream::Qt_DefaultCompiledVersion))); .arg(qint32(QDataStream::Qt_DefaultCompiledVersion)));
return; return;
} }
} }

View File

@@ -1,10 +1,11 @@
// Copyright (C) 2018 The Qt Company Ltd. // Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfprofilertracemanager.h"
#include "perfprofilertracefile.h"
#include "perfprofilerconstants.h"
#include "perfdatareader.h" #include "perfdatareader.h"
#include "perfprofilerconstants.h"
#include "perfprofilertr.h"
#include "perfprofilertracefile.h"
#include "perfprofilertracemanager.h"
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h> #include <coreplugin/progressmanager/futureprogress.h>
@@ -72,13 +73,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::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::tr("Failed to flush temporary trace file."));
} }
bool PerfProfilerEventStorage::replay( bool PerfProfilerEventStorage::replay(
@@ -88,13 +89,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::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::tr("Read past end from temporary trace file."));
break; break;
} }
return false; return false;
@@ -190,15 +191,15 @@ void PerfProfilerTraceManager::resetAttributes()
{ {
// The "meta" types are useful and also have to be reported to TimelineTraceManager. // The "meta" types are useful and also have to be reported to TimelineTraceManager.
setEventType(PerfEvent::ThreadStartTypeId, PerfEventType(PerfEventType::ThreadStart, setEventType(PerfEvent::ThreadStartTypeId, PerfEventType(PerfEventType::ThreadStart,
tr("Thread started"))); Tr::tr("Thread started")));
setEventType(PerfEvent::ThreadEndTypeId, PerfEventType(PerfEventType::ThreadEnd, setEventType(PerfEvent::ThreadEndTypeId, PerfEventType(PerfEventType::ThreadEnd,
tr("Thread ended"))); Tr::tr("Thread ended")));
setEventType(PerfEvent::LostTypeId, PerfEventType(PerfEventType::LostDefinition, setEventType(PerfEvent::LostTypeId, PerfEventType(PerfEventType::LostDefinition,
tr("Samples lost"))); Tr::tr("Samples lost")));
setEventType(PerfEvent::ContextSwitchTypeId, setEventType(PerfEvent::ContextSwitchTypeId,
PerfEventType(PerfEventType::ContextSwitchDefinition, tr("Context switch"))); PerfEventType(PerfEventType::ContextSwitchDefinition, Tr::tr("Context switch")));
setEventType(PerfEvent::LastSpecialTypeId, setEventType(PerfEvent::LastSpecialTypeId,
PerfEventType(PerfEventType::InvalidFeature, tr("Invalid"))); PerfEventType(PerfEventType::InvalidFeature, Tr::tr("Invalid")));
} }
void PerfProfilerTraceManager::finalize() void PerfProfilerTraceManager::finalize()
@@ -267,7 +268,7 @@ void PerfProfilerTraceManager::replayPerfEvents(PerfEventLoader loader, Initiali
if (!result && errorHandler) { if (!result && errorHandler) {
errorHandler(future.isCanceled() ? QString() errorHandler(future.isCanceled() ? QString()
: tr("Failed to replay Perf events from stash file.")); : Tr::tr("Failed to replay Perf events from stash file."));
} else if (result && finalizer) { } else if (result && finalizer) {
finalizer(); finalizer();
} }
@@ -576,13 +577,13 @@ qint32 PerfProfilerTraceManager::symbolLocation(qint32 locationId) const
void PerfProfilerTraceManager::loadFromTraceFile(const QString &filePath) void PerfProfilerTraceManager::loadFromTraceFile(const QString &filePath)
{ {
Core::ProgressManager::addTask(load(filePath), tr("Loading Trace Data"), Core::ProgressManager::addTask(load(filePath), Tr::tr("Loading Trace Data"),
Constants::PerfProfilerTaskLoadTrace); Constants::PerfProfilerTaskLoadTrace);
} }
void PerfProfilerTraceManager::saveToTraceFile(const QString &filePath) void PerfProfilerTraceManager::saveToTraceFile(const QString &filePath)
{ {
Core::ProgressManager::addTask(save(filePath), tr("Saving Trace Data"), Core::ProgressManager::addTask(save(filePath), Tr::tr("Saving Trace Data"),
Constants::PerfProfilerTaskSaveTrace); Constants::PerfProfilerTaskSaveTrace);
} }
@@ -606,7 +607,7 @@ void PerfProfilerTraceManager::loadFromPerfData(const QString &filePath,
qMin(QFileInfo(filePath).size() >> 20, qMin(QFileInfo(filePath).size() >> 20,
static_cast<qint64>(std::numeric_limits<int>::max()))); static_cast<qint64>(std::numeric_limits<int>::max())));
Core::FutureProgress *fp = Core::ProgressManager::addTimedTask( Core::FutureProgress *fp = Core::ProgressManager::addTimedTask(
reader->future(), tr("Loading Trace Data"), Constants::PerfProfilerTaskLoadPerf, reader->future(), Tr::tr("Loading Trace Data"), Constants::PerfProfilerTaskLoadPerf,
fileMegabytes); fileMegabytes);
connect(fp, &Core::FutureProgress::canceled, reader, [reader]() { connect(fp, &Core::FutureProgress::canceled, reader, [reader]() {

View File

@@ -18,7 +18,6 @@ namespace Internal {
class PerfProfilerEventStorage : public Timeline::TraceEventStorage class PerfProfilerEventStorage : public Timeline::TraceEventStorage
{ {
Q_DECLARE_TR_FUNCTIONS(QmlProfilerEventStorage)
public: public:
using StashFile = Timeline::TraceStashFile<PerfEvent>; using StashFile = Timeline::TraceStashFile<PerfEvent>;

View File

@@ -3,6 +3,7 @@
#include "perfprofilerconstants.h" #include "perfprofilerconstants.h"
#include "perfprofilerplugin.h" #include "perfprofilerplugin.h"
#include "perfprofilertr.h"
#include "perfrunconfigurationaspect.h" #include "perfrunconfigurationaspect.h"
#include "perfsettings.h" #include "perfsettings.h"
@@ -15,8 +16,7 @@ PerfRunConfigurationAspect::PerfRunConfigurationAspect(ProjectExplorer::Target *
setProjectSettings(new PerfSettings(target)); setProjectSettings(new PerfSettings(target));
setGlobalSettings(Internal::PerfProfilerPlugin::globalSettings()); setGlobalSettings(Internal::PerfProfilerPlugin::globalSettings());
setId(Constants::PerfSettingsId); setId(Constants::PerfSettingsId);
setDisplayName(QCoreApplication::translate("PerfProfiler::PerfRunConfigurationAspect", setDisplayName(Tr::tr("Performance Analyzer Settings"));
"Performance Analyzer Settings"));
setUsingGlobalSettings(true); setUsingGlobalSettings(true);
resetProjectToGlobalSettings(); resetProjectToGlobalSettings();
setConfigWidgetCreator([this] { return new Debugger::AnalyzerRunConfigWidget(this); }); setConfigWidgetCreator([this] { return new Debugger::AnalyzerRunConfigWidget(this); });

View File

@@ -3,6 +3,7 @@
#include "perfconfigwidget.h" #include "perfconfigwidget.h"
#include "perfprofilerconstants.h" #include "perfprofilerconstants.h"
#include "perfprofilertr.h"
#include "perfsettings.h" #include "perfsettings.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -28,29 +29,29 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target)
period.setSettingsKey("Analyzer.Perf.Frequency"); period.setSettingsKey("Analyzer.Perf.Frequency");
period.setRange(250, 2147483647); period.setRange(250, 2147483647);
period.setDefaultValue(250); period.setDefaultValue(250);
period.setLabelText(tr("Sample period:")); period.setLabelText(Tr::tr("Sample period:"));
registerAspect(&stackSize); registerAspect(&stackSize);
stackSize.setSettingsKey("Analyzer.Perf.StackSize"); stackSize.setSettingsKey("Analyzer.Perf.StackSize");
stackSize.setRange(4096, 65536); stackSize.setRange(4096, 65536);
stackSize.setDefaultValue(4096); stackSize.setDefaultValue(4096);
stackSize.setLabelText(tr("Stack snapshot size (kB):")); stackSize.setLabelText(Tr::tr("Stack snapshot size (kB):"));
registerAspect(&sampleMode); registerAspect(&sampleMode);
sampleMode.setSettingsKey("Analyzer.Perf.SampleMode"); sampleMode.setSettingsKey("Analyzer.Perf.SampleMode");
sampleMode.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); sampleMode.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
sampleMode.setLabelText(tr("Sample mode:")); sampleMode.setLabelText(Tr::tr("Sample mode:"));
sampleMode.addOption({tr("frequency (Hz)"), {}, QString("-F")}); sampleMode.addOption({Tr::tr("frequency (Hz)"), {}, QString("-F")});
sampleMode.addOption({tr("event count"), {}, QString("-c")}); sampleMode.addOption({Tr::tr("event count"), {}, QString("-c")});
sampleMode.setDefaultValue(0); sampleMode.setDefaultValue(0);
registerAspect(&callgraphMode); registerAspect(&callgraphMode);
callgraphMode.setSettingsKey("Analyzer.Perf.CallgraphMode"); callgraphMode.setSettingsKey("Analyzer.Perf.CallgraphMode");
callgraphMode.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); callgraphMode.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
callgraphMode.setLabelText(tr("Call graph mode:")); callgraphMode.setLabelText(Tr::tr("Call graph mode:"));
callgraphMode.addOption({tr("dwarf"), {}, QString(Constants::PerfCallgraphDwarf)}); callgraphMode.addOption({Tr::tr("dwarf"), {}, QString(Constants::PerfCallgraphDwarf)});
callgraphMode.addOption({tr("frame pointer"), {}, QString("fp")}); callgraphMode.addOption({Tr::tr("frame pointer"), {}, QString("fp")});
callgraphMode.addOption({tr("last branch record"), {}, QString("lbr")}); callgraphMode.addOption({Tr::tr("last branch record"), {}, QString("lbr")});
callgraphMode.setDefaultValue(0); callgraphMode.setDefaultValue(0);
registerAspect(&events); registerAspect(&events);
@@ -60,7 +61,7 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target)
registerAspect(&extraArguments); registerAspect(&extraArguments);
extraArguments.setSettingsKey("Analyzer.Perf.ExtraArguments"); extraArguments.setSettingsKey("Analyzer.Perf.ExtraArguments");
extraArguments.setDisplayStyle(StringAspect::DisplayStyle::LineEditDisplay); extraArguments.setDisplayStyle(StringAspect::DisplayStyle::LineEditDisplay);
extraArguments.setLabelText(tr("Additional arguments:")); extraArguments.setLabelText(Tr::tr("Additional arguments:"));
extraArguments.setSpan(4); extraArguments.setSpan(4);
connect(&callgraphMode, &SelectionAspect::volatileValueChanged, this, [this](int index) { connect(&callgraphMode, &SelectionAspect::volatileValueChanged, this, [this](int index) {

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfdatareader.h" #include "perfdatareader.h"
#include "perfprofilertr.h"
#include "perftimelinemodel.h" #include "perftimelinemodel.h"
#include "perftimelinemodelmanager.h" #include "perftimelinemodelmanager.h"
#include "perftimelineresourcesrenderpass.h" #include "perftimelineresourcesrenderpass.h"
@@ -56,7 +57,7 @@ QVariantList PerfTimelineModel::labels() const
QVariantList result; QVariantList result;
QVariantMap sample; QVariantMap sample;
sample.insert(QLatin1String("description"), tr("sample collected")); sample.insert(QLatin1String("description"), Tr::tr("sample collected"));
sample.insert(QLatin1String("id"), PerfEvent::LastSpecialTypeId); sample.insert(QLatin1String("id"), PerfEvent::LastSpecialTypeId);
result << sample; result << sample;
@@ -124,7 +125,7 @@ QString prettyPrintMemory(qint64 amount)
static const QByteArray &orUnknown(const QByteArray &string) static const QByteArray &orUnknown(const QByteArray &string)
{ {
static const QByteArray unknown = PerfTimelineModel::tr("[unknown]").toUtf8(); static const QByteArray unknown = Tr::tr("[unknown]").toUtf8();
return string.isEmpty() ? unknown : string; return string.isEmpty() ? unknown : string;
} }
@@ -139,12 +140,12 @@ QVariantMap PerfTimelineModel::details(int index) const
int typeId = selectionId(index); int typeId = selectionId(index);
if (isSample(index)) { if (isSample(index)) {
const PerfEventType::Attribute &attribute = manager->attribute(typeId); const PerfEventType::Attribute &attribute = manager->attribute(typeId);
result.insert(tr("Details"), orUnknown(manager->string(attribute.name))); result.insert(Tr::tr("Details"), orUnknown(manager->string(attribute.name)));
result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index), result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
manager->traceDuration())); manager->traceDuration()));
const int guessedFrames = -frame.numSamples; const int guessedFrames = -frame.numSamples;
if (guessedFrames > 0) if (guessedFrames > 0)
result.insert(tr("Guessed"), tr("%n frames", nullptr, guessedFrames)); result.insert(Tr::tr("Guessed"), Tr::tr("%n frames", nullptr, guessedFrames));
for (int i = 0, end = numAttributes(index); i < end; ++i) { for (int i = 0, end = numAttributes(index); i < end; ++i) {
const auto &name = orUnknown(manager->string( const auto &name = orUnknown(manager->string(
manager->attribute(attributeId(index, i)).name)); manager->attribute(attributeId(index, i)).name));
@@ -153,8 +154,8 @@ QVariantMap PerfTimelineModel::details(int index) const
if (attribute.type == PerfEventType::TypeTracepoint) { if (attribute.type == PerfEventType::TypeTracepoint) {
const PerfProfilerTraceManager::TracePoint &tracePoint const PerfProfilerTraceManager::TracePoint &tracePoint
= manager->tracePoint(static_cast<int>(attribute.config)); = manager->tracePoint(static_cast<int>(attribute.config));
result.insert(tr("System"), orUnknown(manager->string(tracePoint.system))); result.insert(Tr::tr("System"), orUnknown(manager->string(tracePoint.system)));
result.insert(tr("Name"), orUnknown(manager->string(tracePoint.name))); result.insert(Tr::tr("Name"), orUnknown(manager->string(tracePoint.name)));
const QHash<qint32, QVariant> &extraData = m_extraData[index]; const QHash<qint32, QVariant> &extraData = m_extraData[index];
for (auto it = extraData.constBegin(), end = extraData.constEnd(); it != end; ++it) { for (auto it = extraData.constBegin(), end = extraData.constEnd(); it != end; ++it) {
result.insert(QString::fromUtf8(manager->string(it.key())), result.insert(QString::fromUtf8(manager->string(it.key())),
@@ -162,58 +163,58 @@ QVariantMap PerfTimelineModel::details(int index) const
} }
} }
if (!m_resourceBlocks.isEmpty()) { if (!m_resourceBlocks.isEmpty()) {
result.insert(tr("Resource Usage"), prettyPrintMemory(frame.resourcePeak)); result.insert(Tr::tr("Resource Usage"), prettyPrintMemory(frame.resourcePeak));
result.insert(tr("Resource Change"), prettyPrintMemory(frame.resourceDelta)); result.insert(Tr::tr("Resource Change"), prettyPrintMemory(frame.resourceDelta));
} }
} else if (typeId == PerfEvent::ThreadStartTypeId) { } else if (typeId == PerfEvent::ThreadStartTypeId) {
result.insert(tr("Details"), tr("thread started")); result.insert(Tr::tr("Details"), Tr::tr("thread started"));
result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index), result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
manager->traceDuration())); manager->traceDuration()));
} else if (typeId == PerfEvent::ThreadEndTypeId) { } else if (typeId == PerfEvent::ThreadEndTypeId) {
result.insert(tr("Details"), tr("thread ended")); result.insert(Tr::tr("Details"), Tr::tr("thread ended"));
result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index), result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
manager->traceDuration())); manager->traceDuration()));
} else if (typeId == PerfEvent::LostTypeId) { } else if (typeId == PerfEvent::LostTypeId) {
result.insert(tr("Details"), tr("lost sample")); result.insert(Tr::tr("Details"), Tr::tr("lost sample"));
result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index), result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
manager->traceDuration())); manager->traceDuration()));
} else if (typeId == PerfEvent::ContextSwitchTypeId) { } else if (typeId == PerfEvent::ContextSwitchTypeId) {
result.insert(tr("Details"), tr("context switch")); result.insert(Tr::tr("Details"), Tr::tr("context switch"));
result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index), result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
manager->traceDuration())); manager->traceDuration()));
} else { } else {
const PerfProfilerTraceManager::Symbol &symbol const PerfProfilerTraceManager::Symbol &symbol
= manager->symbol(manager->aggregateAddresses() = manager->symbol(manager->aggregateAddresses()
? typeId : manager->symbolLocation(typeId)); ? typeId : manager->symbolLocation(typeId));
result.insert(tr("Duration"), Timeline::formatTime(duration(index))); result.insert(Tr::tr("Duration"), Timeline::formatTime(duration(index)));
result.insert(tr("Samples"), qAbs(frame.numSamples)); result.insert(Tr::tr("Samples"), qAbs(frame.numSamples));
result.insert(tr("Details"), orUnknown(manager->string(symbol.name))); result.insert(Tr::tr("Details"), orUnknown(manager->string(symbol.name)));
result.insert(tr("Binary"), orUnknown(manager->string(symbol.binary))); result.insert(Tr::tr("Binary"), orUnknown(manager->string(symbol.binary)));
const PerfEventType::Location &location = manager->location(typeId); const PerfEventType::Location &location = manager->location(typeId);
QString address = QString::fromLatin1("0x%1").arg(location.address, 1, 16); QString address = QString::fromLatin1("0x%1").arg(location.address, 1, 16);
if (frame.numSamples < 0) if (frame.numSamples < 0)
address += tr(" (guessed from context)"); address += Tr::tr(" (guessed from context)");
result.insert(tr("Address"), address); result.insert(Tr::tr("Address"), address);
const QByteArray &file = manager->string(location.file); const QByteArray &file = manager->string(location.file);
if (!file.isEmpty()) { if (!file.isEmpty()) {
result.insert(tr("Source"), QString::fromLatin1("%1:%2") result.insert(Tr::tr("Source"), QString::fromLatin1("%1:%2")
.arg(QFileInfo(QLatin1String(file)).fileName()).arg(location.line)); .arg(QFileInfo(QLatin1String(file)).fileName()).arg(location.line));
} else { } else {
result.insert(tr("Source"), tr("[unknown]")); result.insert(Tr::tr("Source"), Tr::tr("[unknown]"));
} }
const LocationStats &stats = locationStats(typeId); const LocationStats &stats = locationStats(typeId);
result.insert(tr("Total Samples"), stats.numSamples); result.insert(Tr::tr("Total Samples"), stats.numSamples);
result.insert(tr("Total Unique Samples"), stats.numUniqueSamples); result.insert(Tr::tr("Total Unique Samples"), stats.numUniqueSamples);
if (!m_resourceBlocks.isEmpty()) { if (!m_resourceBlocks.isEmpty()) {
result.insert(tr("Resource Peak"), prettyPrintMemory(frame.resourcePeak)); result.insert(Tr::tr("Resource Peak"), prettyPrintMemory(frame.resourcePeak));
result.insert(tr("Resource Change"), prettyPrintMemory(frame.resourceDelta)); result.insert(Tr::tr("Resource Change"), prettyPrintMemory(frame.resourceDelta));
} }
} }
if (frame.resourceGuesses > 0) if (frame.resourceGuesses > 0)
result.insert(tr("Resource Guesses"), prettyPrintMemory(frame.resourceGuesses)); result.insert(Tr::tr("Resource Guesses"), prettyPrintMemory(frame.resourceGuesses));
return result; return result;
} }

View File

@@ -1,6 +1,7 @@
// Copyright (C) 2018 The Qt Company Ltd. // Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfprofilertr.h"
#include "perftracepointdialog.h" #include "perftracepointdialog.h"
#include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/devicemanager.h>
@@ -35,7 +36,7 @@ namespace Internal {
PerfTracePointDialog::PerfTracePointDialog() PerfTracePointDialog::PerfTracePointDialog()
{ {
resize(400, 300); resize(400, 300);
m_label = new QLabel(tr("Run the following script as root to create trace points?")); m_label = new QLabel(Tr::tr("Run the following script as root to create trace points?"));
m_textEdit = new QTextEdit; m_textEdit = new QTextEdit;
m_privilegesChooser = new QComboBox; m_privilegesChooser = new QComboBox;
m_privilegesChooser->addItems({ELEVATE_METHOD_NA, ELEVATE_METHOD_PKEXEC, ELEVATE_METHOD_SUDO}); m_privilegesChooser->addItems({ELEVATE_METHOD_NA, ELEVATE_METHOD_PKEXEC, ELEVATE_METHOD_SUDO});
@@ -46,7 +47,7 @@ PerfTracePointDialog::PerfTracePointDialog()
m_label, m_label,
m_textEdit, m_textEdit,
Form { Form {
tr("Elevate privileges using:"), m_privilegesChooser, br, Tr::tr("Elevate privileges using:"), m_privilegesChooser, br,
}, },
m_buttonBox, m_buttonBox,
}.attachTo(this); }.attachTo(this);
@@ -57,7 +58,7 @@ PerfTracePointDialog::PerfTracePointDialog()
m_device = DeviceKitAspect::device(kit); m_device = DeviceKitAspect::device(kit);
if (!m_device) { if (!m_device) {
m_textEdit->setPlainText(tr("Error: No device available for active target.")); m_textEdit->setPlainText(Tr::tr("Error: No device available for active target."));
return; return;
} }
} }
@@ -72,8 +73,8 @@ PerfTracePointDialog::PerfTracePointDialog()
if (file.open(QIODevice::ReadOnly)) { if (file.open(QIODevice::ReadOnly)) {
m_textEdit->setPlainText(QString::fromUtf8(file.readAll())); m_textEdit->setPlainText(QString::fromUtf8(file.readAll()));
} else { } else {
m_textEdit->setPlainText(tr("Error: Failed to load trace point script %1: %2.") m_textEdit->setPlainText(Tr::tr("Error: Failed to load trace point script %1: %2.")
.arg(file.fileName()).arg(file.errorString())); .arg(file.fileName()).arg(file.errorString()));
} }
m_privilegesChooser->setCurrentText( m_privilegesChooser->setCurrentText(
@@ -88,7 +89,7 @@ PerfTracePointDialog::~PerfTracePointDialog() = default;
void PerfTracePointDialog::runScript() void PerfTracePointDialog::runScript()
{ {
m_label->setText(tr("Executing script...")); m_label->setText(Tr::tr("Executing script..."));
m_textEdit->setReadOnly(true); m_textEdit->setReadOnly(true);
m_privilegesChooser->setEnabled(false); m_privilegesChooser->setEnabled(false);
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
@@ -112,11 +113,11 @@ void PerfTracePointDialog::handleProcessDone()
const QProcess::ProcessError error = m_process->error(); const QProcess::ProcessError error = m_process->error();
QString message; QString message;
if (error == QProcess::FailedToStart) { if (error == QProcess::FailedToStart) {
message = tr("Failed to run trace point script: %1").arg(error); message = Tr::tr("Failed to run trace point script: %1").arg(error);
} else if ((m_process->exitStatus() == QProcess::CrashExit) || (m_process->exitCode() != 0)) { } else if ((m_process->exitStatus() == QProcess::CrashExit) || (m_process->exitCode() != 0)) {
message = tr("Failed to create trace points."); message = Tr::tr("Failed to create trace points.");
} else { } else {
message = tr("Created trace points for: %1").arg(QString::fromUtf8( message = Tr::tr("Created trace points for: %1").arg(QString::fromUtf8(
m_process->readAllStandardOutput().trimmed().replace('\n', ", "))); m_process->readAllStandardOutput().trimmed().replace('\n', ", ")));
} }
m_label->setText(message); m_label->setText(message);