diff options
author | Sean Harmer <sean.harmer.qnx@kdab.com> | 2012-08-30 16:59:09 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-17 15:00:39 (GMT) |
commit | 25213a335e7e66db6923a4849e7f83cdbd87783f (patch) | |
tree | e3f8e4c99e8f49e6432d89eac7cc3e3ecf77756c | |
parent | 370a8f0c2678e5a5a688eaa22e27d98ca8f1d82d (diff) | |
download | Qt-25213a335e7e66db6923a4849e7f83cdbd87783f.zip Qt-25213a335e7e66db6923a4849e7f83cdbd87783f.tar.gz Qt-25213a335e7e66db6923a4849e7f83cdbd87783f.tar.bz2 |
QNX: Add some optional debug output to event dispatcher
Backport of 6998c4b2ad5fdf5f525bd77ec0fd3c6667b102b7
Change-Id: I32ceb7cc8e000c8fd00bf9e5ed6d6f8b796c73ad
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_blackberry.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp index 6cb2785..97b9371 100644 --- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp +++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp @@ -43,10 +43,19 @@ #include "qsocketnotifier.h" #include "qdebug.h" #include "qelapsedtimer.h" +#include "qthread.h" #include <bps/bps.h> #include <bps/event.h> +//#define QEVENTDISPATCHERBLACKBERRY_DEBUG + +#ifdef QEVENTDISPATCHERBLACKBERRY_DEBUG +#define qEventDispatcherDebug qDebug() << QThread::currentThread() +#else +#define qEventDispatcherDebug QT_NO_QDEBUG_MACRO() +#endif + struct bpsIOHandlerData { bpsIOHandlerData() : count(0), readfds(0), writefds(0), exceptfds(0) @@ -63,6 +72,7 @@ static int bpsIOReadyDomain = -1; static int bpsIOHandler(int fd, int io_events, void *data) { + qEventDispatcherDebug << Q_FUNC_INFO; // decode callback payload bpsIOHandlerData *ioData = static_cast<bpsIOHandlerData*>(data); @@ -71,16 +81,19 @@ static int bpsIOHandler(int fd, int io_events, void *data) // update ready state of file if (io_events & BPS_IO_INPUT) { + qEventDispatcherDebug << fd << "ready for Read"; FD_SET(fd, ioData->readfds); ioData->count++; } if (io_events & BPS_IO_OUTPUT) { + qEventDispatcherDebug << fd << "ready for Write"; FD_SET(fd, ioData->writefds); ioData->count++; } if (io_events & BPS_IO_EXCEPT) { + qEventDispatcherDebug << fd << "ready for Exception"; FD_SET(fd, ioData->exceptfds); ioData->count++; } @@ -88,6 +101,7 @@ static int bpsIOHandler(int fd, int io_events, void *data) // force bps_get_event() to return immediately by posting an event to ourselves; // but this only needs to happen once if multiple files become ready at the same time if (firstReady) { + qEventDispatcherDebug << "Sending bpsIOReadyDomain event"; // create IO ready event bps_event_t *event; int result = bps_event_create(&event, bpsIOReadyDomain, 0, NULL, NULL); @@ -162,6 +176,7 @@ void QEventDispatcherBlackberry::registerSocketNotifier(QSocketNotifier *notifie // Register the fd with bps int sockfd = notifier->socket(); int type = notifier->type(); + qEventDispatcherDebug << Q_FUNC_INFO << "fd =" << sockfd; int io_events = ioEvents(sockfd); @@ -173,13 +188,16 @@ void QEventDispatcherBlackberry::registerSocketNotifier(QSocketNotifier *notifie switch (type) { case QSocketNotifier::Read: + qEventDispatcherDebug << "Registering" << sockfd << "for Reads"; io_events |= BPS_IO_INPUT; break; case QSocketNotifier::Write: + qEventDispatcherDebug << "Registering" << sockfd << "for Writes"; io_events |= BPS_IO_OUTPUT; break; case QSocketNotifier::Exception: default: + qEventDispatcherDebug << "Registering" << sockfd << "for Exceptions"; io_events |= BPS_IO_EXCEPT; break; } @@ -200,6 +218,7 @@ void QEventDispatcherBlackberry::unregisterSocketNotifier(QSocketNotifier *notif // Unregister the fd with bps int sockfd = notifier->socket(); + qEventDispatcherDebug << Q_FUNC_INFO << "fd =" << sockfd; const int io_events = ioEvents(sockfd); |