forked from qt-creator/qt-creator
Use Nanotrace to generate startup performance report
Add various trace points to the code, including the plugin initialization methods (centrally in plugin manager), code that is scheduled on the event loop with QTimer::singleShot or QMetaObject::invokeMethod during initialization, and code that is triggered from ICore::coreOpened Can be turned on by configuring with `BUILD_LIBRARY_NANOTRACE=ON` Run with `-trace <file>` to write trace file. If Nanotrace is not built, the added code expands to nothing. Changes in Nanotrace: - turned generated data to microseconds instead of nanoseconds, because that is what Chrome tracing expects - fixed serialization of duration (needs to be an item of the event, not in a "arg" subitem) - fixed shutdown() to reset the initEvent Change-Id: I994de82023b820d771e1be0a859ebd8da0b73d4d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -61,6 +61,8 @@
|
||||
#include <vcsbase/vcscommand.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <nanotrace/nanotrace.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
@@ -680,6 +682,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
|
||||
auto cmdContext = new QObject(this);
|
||||
connect(ICore::instance(), &ICore::coreOpened, cmdContext, [this, cmdContext, arguments] {
|
||||
NANOTRACE_SCOPE("Git", "GitPlugin::initialize::coreOpened");
|
||||
remoteCommand(arguments, QDir::currentPath(), {});
|
||||
cmdContext->deleteLater();
|
||||
});
|
||||
|
Reference in New Issue
Block a user