categoried logging for xcb entries (#1497564, QTBUG-55167)

This commit is contained in:
Rex Dieter 2017-11-09 08:49:58 -06:00
parent ea12f0e1fa
commit 4c963be10c
3 changed files with 69 additions and 1 deletions

View File

@ -55,7 +55,7 @@ BuildRequires: pkgconfig(libsystemd)
Name: qt5-qtbase
Summary: Qt5 - QtBase components
Version: 5.9.2
Release: 4%{?dist}
Release: 5%{?dist}
# See LGPL_EXCEPTIONS.txt, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -110,6 +110,11 @@ Patch64: qt5-qtbase-5.9.1-firebird.patch
Patch65: qtbase-opensource-src-5.9.0-mysql.patch
Patch66: qtbase-mariadb.patch
# use categorized logging for xcb log entries
# https://bugreports.qt.io/browse/QTBUG-55167
# https://bugzilla.redhat.com/show_bug.cgi?id=1497564
Patch67: https://bugreports.qt.io/secure/attachment/66353/xcberror_filter.patch
## upstream patches (5.9 branch)
Patch106: 0106-Fix-dragging-inside-a-modal-window-when-a-QShapedPix.patch
@ -360,6 +365,7 @@ Qt5 libraries used for drawing widgets and OpenGL items.
%patch65 -p1 -b .mysql
%endif
%patch66 -p1 -b .mariadb
%patch67 -p1 -b .xcberror_filter
%if 0%{?inject_optflags}
## adjust $RPM_OPT_FLAGS
@ -977,6 +983,9 @@ fi
%changelog
* Thu Nov 09 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.9.2-5
- categoried logging for xcb entries (#1497564, QTBUG-55167)
* Mon Nov 06 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.9.2-4
- QListView upstream regression (#1509649, QTBUG-63846)

View File

@ -1,2 +1,3 @@
[Rules]
*.debug=false
qt.qpa.xcb.xcberror.warning=false

58
xcberror_filter.patch Normal file
View File

@ -0,0 +1,58 @@
--- qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbconnection.cpp 2016-12-01 02:17:04.000000000 -0600
+++ qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb.new/qxcbconnection.cpp 2017-09-20 15:41:47.057359162 -0500
@@ -109,6 +109,9 @@
Q_LOGGING_CATEGORY(lcQpaXInputDevices, "qt.qpa.input.devices")
Q_LOGGING_CATEGORY(lcQpaXInputEvents, "qt.qpa.input.events")
Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.screen")
+Q_LOGGING_CATEGORY(lcQpaXcb, "qt.qpa.xcb")
+Q_LOGGING_CATEGORY(lcQpaXcbError, "qt.qpa.xcb.xcberror")
+// TODO: How to categorize by xcberror type? (e.g. only BadWindow)
// this event type was added in libxcb 1.10,
// but we support also older version
@@ -996,7 +999,9 @@
uint clamped_error_code = qMin<uint>(error->error_code, (sizeof(xcb_errors) / sizeof(xcb_errors[0])) - 1);
uint clamped_major_code = qMin<uint>(error->major_code, (sizeof(xcb_protocol_request_codes) / sizeof(xcb_protocol_request_codes[0])) - 1);
- qWarning("QXcbConnection: XCB error: %d (%s), sequence: %d, resource id: %d, major code: %d (%s), minor code: %d",
+ //TODO: Make the category filterable based on the XCB Error
+ qCWarning(lcQpaXcbError,
+ "QXcbConnection: XCB error: %d (%s), sequence: %d, resource id: %d, major code: %d (%s), minor code: %d",
int(error->error_code), xcb_errors[clamped_error_code],
int(error->sequence), int(error->resource_id),
int(error->major_code), xcb_protocol_request_codes[clamped_major_code],
@@ -1006,19 +1011,19 @@
int i = 0;
for (; i < m_callLog.size(); ++i) {
if (m_callLog.at(i).sequence == error->sequence) {
- qDebug("Caused by: %s:%d", m_callLog.at(i).file.constData(), m_callLog.at(i).line);
+ qCDebug(lcQpaXcbError, "Caused by: %s:%d", m_callLog.at(i).file.constData(), m_callLog.at(i).line);
break;
} else if (m_callLog.at(i).sequence > error->sequence) {
- qDebug("Caused some time before: %s:%d", m_callLog.at(i).file.constData(),
+ qCDebug(lcQpaXcbError, "Caused some time before: %s:%d", m_callLog.at(i).file.constData(),
m_callLog.at(i).line);
if (i > 0)
- qDebug("and after: %s:%d", m_callLog.at(i-1).file.constData(),
+ qCDebug(lcQpaXcbError, "and after: %s:%d", m_callLog.at(i-1).file.constData(),
m_callLog.at(i-1).line);
break;
}
}
if (i == m_callLog.size() && !m_callLog.isEmpty())
- qDebug("Caused some time after: %s:%d", qAsConst(m_callLog).first().file.constData(),
+ qCDebug(lcQpaXcbError, "Caused some time after: %s:%d", qAsConst(m_callLog).first().file.constData(),
qAsConst(m_callLog).first().line);
#endif
}
--- qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbconnection.h 2016-12-01 02:17:04.000000000 -0600
+++ qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb.new/qxcbconnection.h 2017-09-20 15:35:55.655555316 -0500
@@ -87,6 +87,8 @@
Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices)
Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents)
Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaXcbError)
class QXcbVirtualDesktop;
class QXcbScreen;