diff options
author | Rafael Roquetto <rafael.roquetto@kdab.com> | 2017-02-01 17:32:13 -0200 |
---|---|---|
committer | Sérgio Martins <sergio.martins@kdab.com> | 2018-01-28 19:17:02 +0000 |
commit | 48bce2e8f0d787342f3e0f86335460fa25e8ac8f (patch) | |
tree | 038af77f6e112f6c9a348a386e9c1eaff3aeab47 /src/corelib/plugin | |
parent | 2b7de16fbe399daa00986f2d32d05cfe51966b66 (diff) |
Support for LTTNG and ETW tracing
This commit introduces minimal support for instrumentation within Qt.
Currently, only LTTNG/Linux and ETW/Windows are supported.
Change-Id: I59b48cf83acf5532a998bb493e6379e9177e14c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qfactoryloader.cpp | 5 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 6 | ||||
-rw-r--r-- | src/corelib/plugin/quuid.cpp | 4 | ||||
-rw-r--r-- | src/corelib/plugin/quuid.h | 4 |
4 files changed, 15 insertions, 4 deletions
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 0cc193c325..a4be18a67f 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -54,6 +54,8 @@ #include "qjsonobject.h" #include "qjsonarray.h" +#include <qtcore_tracepoints_p.h> + QT_BEGIN_NAMESPACE class QFactoryLoaderPrivate : public QObjectPrivate @@ -142,6 +144,9 @@ void QFactoryLoader::update() if (qt_debug_component()) { qDebug() << "QFactoryLoader::QFactoryLoader() looking at" << fileName; } + + Q_TRACE(qfactoryloader_update, fileName); + library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath()); if (!library->isPlugin()) { if (qt_debug_component()) { diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index ebad7f1751..bca6918b4a 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -64,6 +64,8 @@ #include "qelfparser_p.h" #include "qmachparser_p.h" +#include <qtcore_tracepoints_p.h> + QT_BEGIN_NAMESPACE #ifdef QT_NO_DEBUG @@ -535,6 +537,8 @@ bool QLibraryPrivate::load() if (fileName.isEmpty()) return false; + Q_TRACE(qlibraryprivate_load_entry, fileName); + bool ret = load_sys(); if (qt_debug_component()) { if (ret) { @@ -551,6 +555,8 @@ bool QLibraryPrivate::load() installCoverageTool(this); } + Q_TRACE(qlibraryprivate_load_exit, ret); + return ret; } diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index 3a1c0495fe..5dfbf23c33 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -143,7 +143,6 @@ static QUuid _q_uuidFromHex(const char *src) return QUuid(); } -#ifndef QT_BOOTSTRAPPED static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCryptographicHash::Algorithm algorithm, int version) { QByteArray hashResult; @@ -166,7 +165,6 @@ static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCrypto return result; } -#endif /*! \class QUuid @@ -488,12 +486,12 @@ QUuid QUuid::createUuidV3(const QUuid &ns, const QByteArray &baseData) { return createFromName(ns, baseData, QCryptographicHash::Md5, 3); } +#endif QUuid QUuid::createUuidV5(const QUuid &ns, const QByteArray &baseData) { return createFromName(ns, baseData, QCryptographicHash::Sha1, 5); } -#endif /*! Creates a QUuid object from the binary representation of the UUID, as diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h index ee0a9f9dac..014b69831e 100644 --- a/src/corelib/plugin/quuid.h +++ b/src/corelib/plugin/quuid.h @@ -192,18 +192,20 @@ public: static QUuid createUuid(); #ifndef QT_BOOTSTRAPPED static QUuid createUuidV3(const QUuid &ns, const QByteArray &baseData); +#endif static QUuid createUuidV5(const QUuid &ns, const QByteArray &baseData); +#ifndef QT_BOOTSTRAPPED static inline QUuid createUuidV3(const QUuid &ns, const QString &baseData) { return QUuid::createUuidV3(ns, baseData.toUtf8()); } +#endif static inline QUuid createUuidV5(const QUuid &ns, const QString &baseData) { return QUuid::createUuidV5(ns, baseData.toUtf8()); } -#endif QUuid::Variant variant() const Q_DECL_NOTHROW; QUuid::Version version() const Q_DECL_NOTHROW; |