diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2014-12-18 10:37:22 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-01-09 10:46:03 +0100 |
commit | a7c183b1afbace47cd7bf7df46a8e689a01044de (patch) | |
tree | 7a418e683c979fae2d25c08c040d914ae0fe1c32 /src | |
parent | ca977a0c8fa25d5df4dbddba08bc2fb022df7c1c (diff) |
Remove QQmlTrace. We have a real profiler.
Change-Id: I50d981b277187327c2c63f8372f64db1300ed9ef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/ftw/ftw.pri | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmltrace.cpp | 147 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmltrace_p.h | 286 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 8 | ||||
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 13 | ||||
-rw-r--r-- | src/qml/qml/qqmlvme_p.h | 1 |
6 files changed, 0 insertions, 457 deletions
diff --git a/src/qml/qml/ftw/ftw.pri b/src/qml/qml/ftw/ftw.pri index 00d56263c6..74a922dc5e 100644 --- a/src/qml/qml/ftw/ftw.pri +++ b/src/qml/qml/ftw/ftw.pri @@ -13,7 +13,6 @@ HEADERS += \ $$PWD/qdeletewatcher_p.h \ $$PWD/qrecyclepool_p.h \ $$PWD/qflagpointer_p.h \ - $$PWD/qqmltrace_p.h \ $$PWD/qpointervaluepair_p.h \ $$PWD/qlazilyallocated_p.h \ @@ -22,7 +21,6 @@ SOURCES += \ $$PWD/qhashedstring.cpp \ $$PWD/qqmlpool.cpp \ $$PWD/qqmlthread.cpp \ - $$PWD/qqmltrace.cpp \ # mirrors logic in $$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri # clock_gettime() is implemented in librt on these systems diff --git a/src/qml/qml/ftw/qqmltrace.cpp b/src/qml/qml/ftw/qqmltrace.cpp deleted file mode 100644 index 104ff2e117..0000000000 --- a/src/qml/qml/ftw/qqmltrace.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qqmltrace_p.h" - -#ifdef QML_ENABLE_TRACE -#include <stdio.h> -#include <unistd.h> -#endif - -QT_BEGIN_NAMESPACE - -#ifdef QML_ENABLE_TRACE - -QQmlTrace::Pool QQmlTrace::logPool; -QQmlTrace::Entry *QQmlTrace::first = 0; -QQmlTrace::Entry *QQmlTrace::last = 0; - -static qint64 toNsecs(QQmlTrace::TimeType time) -{ -#ifdef Q_OS_MAC - static mach_timebase_info_data_t info = {0,0}; - if (info.denom == 0) - mach_timebase_info(&info); - return time * info.numer / info.denom; -#else - qint64 rv = time.tv_sec * 1000000000 + time.tv_nsec; - return rv; -#endif -} - -QQmlTrace::Pool::Pool() -{ - first = New<Entry>(); - last = first; -} - -QQmlTrace::Pool::~Pool() -{ - char buffer[128]; - sprintf(buffer, "qml.%d.log", ::getpid()); - FILE *out = fopen(buffer, "w"); - if (!out) { - fprintf (stderr, "QML Log: Could not open %s\n", buffer); - return; - } else { - fprintf (stderr, "QML Log: Writing log to %s\n", buffer); - } - - QQmlTrace::Entry *cur = QQmlTrace::first; - QByteArray indent; - int depth = -1; - - qint64 firstTime = -1; - - while (cur) { - - switch (cur->type) { - case QQmlTrace::Entry::RangeStart: { - RangeStart *rs = static_cast<QQmlTrace::RangeStart *>(cur); - - qint64 nsecs = toNsecs(rs->time); - - if (firstTime == -1) - firstTime = nsecs; - - nsecs -= firstTime; - - depth++; - indent = QByteArray(depth * 4, ' '); - fprintf(out, "%s%s @%lld (%lld ns)\n", indent.constData(), - rs->description, nsecs, toNsecs(rs->end->time) - nsecs - firstTime); - } break; - case QQmlTrace::Entry::RangeEnd: - depth--; - indent = QByteArray(depth * 4, ' '); - break; - case QQmlTrace::Entry::Detail: - fprintf(out, "%s %s\n", indent.constData(), - static_cast<QQmlTrace::Detail *>(cur)->description); - break; - case QQmlTrace::Entry::IntDetail: - fprintf(out, "%s %s: %d\n", indent.constData(), - static_cast<QQmlTrace::Detail *>(cur)->description, - static_cast<QQmlTrace::IntDetail *>(cur)->value); - break; - case QQmlTrace::Entry::StringDetail: { - QByteArray vLatin1 = static_cast<QQmlTrace::StringDetail *>(cur)->value->toLatin1(); - fprintf(out, "%s %s: %s\n", indent.constData(), - static_cast<QQmlTrace::Detail *>(cur)->description, - vLatin1.constData()); - } break; - case QQmlTrace::Entry::UrlDetail: { - QByteArray vLatin1 = static_cast<QQmlTrace::UrlDetail *>(cur)->value->toString().toLatin1(); - fprintf(out, "%s %s: %s\n", indent.constData(), - static_cast<QQmlTrace::Detail *>(cur)->description, - vLatin1.constData()); - } break; - case QQmlTrace::Entry::Event: { - Event *ev = static_cast<QQmlTrace::Event *>(cur); - qint64 nsecs = toNsecs(ev->time) - firstTime; - fprintf(out, "%s + %s @%lld +%lld ns\n", indent.constData(), - ev->description, nsecs, nsecs - (toNsecs(ev->start->time) - firstTime)); - } break; - case QQmlTrace::Entry::Null: - default: - break; - } - cur = cur->next; - } - fclose(out); -} - -#endif - -QT_END_NAMESPACE - diff --git a/src/qml/qml/ftw/qqmltrace_p.h b/src/qml/qml/ftw/qqmltrace_p.h deleted file mode 100644 index 19e81965dd..0000000000 --- a/src/qml/qml/ftw/qqmltrace_p.h +++ /dev/null @@ -1,286 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQMLTRACE_P_H -#define QQMLTRACE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qglobal.h> -#include <private/qqmlpool_p.h> - -// #define QML_ENABLE_TRACE - -#if defined(QML_ENABLE_TRACE) && defined(Q_OS_MAC) -#include <mach/mach_time.h> -#endif - -QT_BEGIN_NAMESPACE - -class QUrl; -class QQmlTrace -{ -public: - inline QQmlTrace(const char *desc); - inline ~QQmlTrace(); - - inline void addDetail(const char *); - inline void addDetail(const char *, int); - inline void addDetail(const char *, const QString &); - inline void addDetail(const char *, const QUrl &); - - inline void event(const char *desc); - -#ifdef QML_ENABLE_TRACE - -#ifdef Q_OS_MAC - typedef uint64_t TimeType; -#else - typedef timespec TimeType; -#endif - - struct Entry : public QQmlPool::POD { - enum Type { Null, RangeStart, RangeEnd, Detail, IntDetail, StringDetail, UrlDetail, Event }; - inline Entry(); - inline Entry(Type); - Type type; - Entry *next; - }; - struct RangeEnd : public Entry { - inline RangeEnd(); - TimeType time; - }; - struct RangeStart : public Entry { - inline RangeStart(); - const char *description; - TimeType time; - QQmlTrace::RangeEnd *end; - }; - struct Detail : public Entry { - inline Detail(); - inline Detail(Type t); - const char *description; - }; - struct IntDetail : public Detail { - inline IntDetail(); - int value; - }; - struct StringDetail : public Detail { - inline StringDetail(); - QString *value; - }; - struct UrlDetail : public Detail { - inline UrlDetail(); - QUrl *value; - }; - struct Event : public Entry { - inline Event(); - const char *description; - TimeType time; - QQmlTrace::RangeStart *start; - }; - - struct Pool : public QQmlPool { - Pool(); - ~Pool(); - }; - - static Pool logPool; - static Entry *first; - static Entry *last; - -private: - RangeStart *start; - - static TimeType gettime() { -#ifdef Q_OS_MAC - return mach_absolute_time(); -#else - TimeType ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return ts; -#endif - } -#endif -}; - -#ifdef QML_ENABLE_TRACE -QQmlTrace::Entry::Entry() -: type(Null), next(0) -{ -} - -QQmlTrace::Entry::Entry(Type type) -: type(type), next(0) -{ - QQmlTrace::last->next = this; - QQmlTrace::last = this; -} - -QQmlTrace::RangeEnd::RangeEnd() -: QQmlTrace::Entry(QQmlTrace::Entry::RangeEnd), - time(gettime()) -{ -} - -QQmlTrace::RangeStart::RangeStart() -: QQmlTrace::Entry(QQmlTrace::Entry::RangeStart), - description(0), time(gettime()) -{ -} - -QQmlTrace::Detail::Detail() -: QQmlTrace::Entry(QQmlTrace::Entry::Detail), - description(0) -{ -} - -QQmlTrace::Detail::Detail(Type type) -: QQmlTrace::Entry(type), description(0) -{ -} - -QQmlTrace::IntDetail::IntDetail() -: QQmlTrace::Detail(QQmlTrace::Entry::IntDetail), - value(0) -{ -} - -QQmlTrace::StringDetail::StringDetail() -: QQmlTrace::Detail(QQmlTrace::Entry::StringDetail), - value(0) -{ -} - -QQmlTrace::UrlDetail::UrlDetail() -: QQmlTrace::Detail(QQmlTrace::Entry::UrlDetail), - value(0) -{ -} - -QQmlTrace::Event::Event() -: QQmlTrace::Entry(QQmlTrace::Entry::Event), - description(0), time(gettime()), start(0) -{ -} -#endif - -QQmlTrace::QQmlTrace(const char *desc) -{ -#ifdef QML_ENABLE_TRACE - RangeStart *e = logPool.New<RangeStart>(); - e->description = desc; - e->end = 0; - start = e; -#else - Q_UNUSED(desc); -#endif -} - -QQmlTrace::~QQmlTrace() -{ -#ifdef QML_ENABLE_TRACE - RangeEnd *e = logPool.New<RangeEnd>(); - start->end = e; -#endif -} - -void QQmlTrace::addDetail(const char *desc) -{ -#ifdef QML_ENABLE_TRACE - Detail *e = logPool.New<Detail>(); - e->description = desc; -#else - Q_UNUSED(desc); -#endif -} - -void QQmlTrace::addDetail(const char *desc, int v) -{ -#ifdef QML_ENABLE_TRACE - IntDetail *e = logPool.New<IntDetail>(); - e->description = desc; - e->value = v; -#else - Q_UNUSED(desc); - Q_UNUSED(v); -#endif -} - -void QQmlTrace::addDetail(const char *desc, const QString &v) -{ -#ifdef QML_ENABLE_TRACE - StringDetail *e = logPool.New<StringDetail>(); - e->description = desc; - e->value = logPool.NewString(v); -#else - Q_UNUSED(desc); - Q_UNUSED(v); -#endif -} - -void QQmlTrace::addDetail(const char *desc, const QUrl &v) -{ -#ifdef QML_ENABLE_TRACE - UrlDetail *e = logPool.New<UrlDetail>(); - e->description = desc; - e->value = logPool.NewUrl(v); -#else - Q_UNUSED(desc); - Q_UNUSED(v); -#endif -} - -void QQmlTrace::event(const char *desc) -{ -#ifdef QML_ENABLE_TRACE - Event *e = logPool.New<Event>(); - e->start = start; - e->description = desc; -#else - Q_UNUSED(desc); -#endif -} - -QT_END_NAMESPACE - -#endif // QQMLTRACE_P_H diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 61bcb260f7..3eb3870b96 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -39,7 +39,6 @@ #include "qqmlcompiler_p.h" #include "qqmldata_p.h" #include <private/qqmlprofiler_p.h> -#include <private/qqmltrace_p.h> #include <private/qqmlexpression_p.h> #include <private/qqmlscriptstring_p.h> #include <private/qqmlcontextwrapper_p.h> @@ -188,11 +187,6 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) int lineNo = qmlSourceCoordinate(lineNumber); int columnNo = qmlSourceCoordinate(columnNumber); - QQmlTrace trace("General Binding Update"); - trace.addDetail("URL", url); - trace.addDetail("Line", lineNo); - trace.addDetail("Column", columnNo); - if (!updatingFlag()) { QQmlBindingProfiler prof(ep->profiler, url, lineNo, columnNo); setUpdatingFlag(true); @@ -216,8 +210,6 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) QV4::ScopedValue result(scope, QQmlJavaScriptExpression::evaluate(context(), f, &isUndefined)); - trace.event("writing binding result"); - bool needsErrorLocationData = false; if (!watcher.wasDeleted() && !hasError()) needsErrorLocationData = !QQmlPropertyPrivate::writeBinding(*m_coreObject, m_core, context(), diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 883d9f7fda..f564cd235e 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -41,7 +41,6 @@ #include <private/qqmlbinding_p.h> #include <private/qqmlstringconverters_p.h> #include <private/qqmlboundsignal_p.h> -#include <private/qqmltrace_p.h> #include <private/qqmlcomponentattached_p.h> #include <private/qqmlcomponent_p.h> #include <private/qqmlcustomparser_p.h> @@ -1200,10 +1199,6 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru QQmlObjectCreatorRecursionWatcher watcher(this); ActiveOCRestorer ocRestorer(this, QQmlEnginePrivate::get(engine)); - { - QQmlTrace trace("VME Binding Enable"); - trace.event("begin binding eval"); - while (!sharedState->allCreatedBindings.isEmpty()) { QQmlAbstractBinding *b = sharedState->allCreatedBindings.pop(); if (!b) @@ -1218,10 +1213,8 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru if (watcher.hasRecursed() || interrupt.shouldInterrupt()) return 0; } - } if (QQmlVME::componentCompleteEnabled()) { // the qml designer does the component complete later - QQmlTrace trace("VME Component Complete"); while (!sharedState->allParserStatusCallbacks.isEmpty()) { QQmlObjectCompletionProfiler profiler(&sharedState->profiler); QQmlParserStatus *status = sharedState->allParserStatusCallbacks.pop(); @@ -1236,8 +1229,6 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru } } - { - QQmlTrace trace("VME Finalize Callbacks"); for (int ii = 0; ii < sharedState->finalizeCallbacks.count(); ++ii) { QQmlEnginePrivate::FinalizeCallback callback = sharedState->finalizeCallbacks.at(ii); QObject *obj = callback.first; @@ -1249,10 +1240,7 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru return 0; } sharedState->finalizeCallbacks.clear(); - } - { - QQmlTrace trace("VME Component.onCompleted Callbacks"); while (sharedState->componentAttached) { QQmlComponentAttached *a = sharedState->componentAttached; a->rem(); @@ -1266,7 +1254,6 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru if (watcher.hasRecursed() || interrupt.shouldInterrupt()) return 0; } - } phase = Done; diff --git a/src/qml/qml/qqmlvme_p.h b/src/qml/qml/qqmlvme_p.h index e819a19ebf..bd84a2b8a3 100644 --- a/src/qml/qml/qqmlvme_p.h +++ b/src/qml/qml/qqmlvme_p.h @@ -58,7 +58,6 @@ #include <private/qqmlengine_p.h> #include <private/qfinitestack_p.h> -#include <private/qqmltrace_p.h> #include <private/qqmlprofiler_p.h> QT_BEGIN_NAMESPACE |