Commit b5525a5b authored by Eskil Abrahamsen-Blomfeldt's avatar Eskil Abrahamsen-Blomfeldt
Browse files

Add some timing debug information

parent efbef14a
......@@ -13,7 +13,7 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcVncFPS)
Q_LOGGING_CATEGORY(lcVncFPS, "qt.vncserver.fps");
Q_LOGGING_CATEGORY(lcVncTiming, "qt.vncserver.time");
QVncItem::QVncItem()
: m_vncPort(QVncServer::DefaultPort)
......@@ -227,6 +227,10 @@ void QVncItem::setRemoteInputEnabled(bool newRemoteInputEnabled)
//Must be invoked on render thread:
void QVncItem::grabTexture()
{
QElapsedTimer timer;
if (lcVncTiming().isDebugEnabled())
timer.start();
auto *provider = textureProvider();
#ifdef EXTRA_EXTRA_DEBUG
qDebug() << "handle tex" << provider;
......@@ -310,6 +314,8 @@ void QVncItem::grabTexture()
m_grabCount++;
}
}
qCDebug(lcVncTiming) << "QVncItem::grabTexture: Took" << timer.elapsed() << "msecs";
}
QSGNode *QVncItem::updatePaintNode(QSGNode *node, UpdatePaintNodeData *data)
......
......@@ -33,6 +33,7 @@
#include <QtCore/qrect.h>
#include <QtCore/qthread.h>
#include <QtCore/qelapsedtimer.h>
#include <QtGui/qimage.h>
#include <QtNetwork/qtcpsocket.h>
......@@ -355,6 +356,10 @@ void QRfbRawEncoder::write()
{
Q_ASSERT(QThread::currentThread() == client->thread());
QElapsedTimer timer;
if (lcVncTiming().isDebugEnabled())
timer.start();
QTcpSocket *socket = client->clientSocket();
const int bytesPerPixel = client->clientBytesPerPixel();
......@@ -486,6 +491,8 @@ void QRfbRawEncoder::write()
break;
}
socket->flush();
qCDebug(lcVncTiming) << "QRfbRawEncoder::write: Took" << timer.elapsed() << "msec";
}
QT_END_NAMESPACE
......
......@@ -34,5 +34,6 @@
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcVnc, "qt.vncserver");
Q_LOGGING_CATEGORY(lcVncTiming, "qt.vncserver.time");
QT_END_NAMESPACE
......@@ -34,5 +34,6 @@
#include <QtCore/qloggingcategory.h>
Q_DECLARE_LOGGING_CATEGORY(lcVnc)
Q_DECLARE_LOGGING_CATEGORY(lcVncTiming)
#endif // QTVNCSERVERGLOBAL_H
......@@ -1116,6 +1116,10 @@ QRfbHextileEncoder<SRC>::QRfbHextileEncoder(QVncClient *client)
template <class SRC>
void QRfbHextileEncoder<SRC>::write()
{
QElapsedTimer timer;
if (lcVncTiming().isDebugEnabled())
timer.start();
QTcpSocket *socket = client->clientSocket();
const int bytesPerPixel = client->clientBytesPerPixel();
const QImage screenImage = client->currentImage();
......@@ -1237,6 +1241,8 @@ void QRfbHextileEncoder<SRC>::write()
#ifdef EXTRA_EXTRA_DEBUG
qDebug() << "Wrote" << countRaw << "raw," << countConvertRaw << "converted," << countSingle << "single," << countDual << "dual, and" << countMulti << "multi.";
#endif
qCDebug(lcVncTiming) << "QRfbHextileEncoder::write: Took" << timer.elapsed() << "msec";
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment