forked from MentorEmbedded/meta-tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
foo
602 lines (556 loc) · 20.8 KB
/
foo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
Index: qtbase-opensource-src-5.4.0/configure
===================================================================
--- qtbase-opensource-src-5.4.0.orig/configure 2014-12-05 09:24:14.000000000 -0700
+++ qtbase-opensource-src-5.4.0/configure 2014-12-30 11:31:06.992603962 -0700
@@ -727,6 +727,7 @@
COMMERCIAL_USER=ask
LICENSE_FILE=
CFG_DEV=no
+CFG_SOURCERYANALYZER=no
# initalize variables used for installation
QT_INSTALL_PREFIX=
@@ -2170,6 +2171,13 @@
UNKNOWN_OPT=yes
fi
;;
+ sa-trace)
+ if [ "$VAL" = "yes" ]; then
+ CFG_SOURCERYANALYZER="yes"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
*)
UNKNOWN_OPT=yes
;;
@@ -5752,7 +5760,9 @@
QT_CONFIG="$QT_CONFIG no-widgets"
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WIDGETS"
fi
-
+if [ "$CFG_SOURCERYANALYZER" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG tracesupport"
+fi
if [ "$XPLATFORM_MAC" = "yes" ]; then
#On Mac we implicitly link against libz, so we
#never use the 3rdparty stuff.
@@ -6640,6 +6650,7 @@
report_support " udev ..................." "$CFG_LIBUDEV"
report_support " xkbcommon .............." "$CFG_XKBCOMMON" system "system library" qt "bundled copy, XKB config root: $CFG_XKB_CONFIG_ROOT"
report_support " zlib ..................." "$CFG_ZLIB" system "system library" yes "bundled copy"
+report_support " Sourcery Analyzer ......" "$CFG_SOURCERYANALYZER"
echo
Index: qtbase-opensource-src-5.4.0/mkspecs/features/tracesupport.prf
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ qtbase-opensource-src-5.4.0/mkspecs/features/tracesupport.prf 2014-12-30 11:31:06.992603962 -0700
@@ -0,0 +1,3 @@
+DEFINES += ENABLE_SA_TRACE
+CFLAGS += -g3 -O1
+LIBS += -L$$[QT_INSTALL_LIBS] -lQt5TraceSupport -ldl -llttng-ust -lurcu-bp
Index: qtbase-opensource-src-5.4.0/src/corelib/animation/qabstractanimation.cpp
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/corelib/animation/qabstractanimation.cpp 2014-12-05 09:24:37.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/corelib/animation/qabstractanimation.cpp 2014-12-30 11:31:07.004603962 -0700
@@ -147,6 +147,10 @@
#include <QtCore/qcoreevent.h>
#include <QtCore/qpointer.h>
+#ifdef ENABLE_SA_TRACE
+ #include <QtTraceSupport/qt_tracepoints.h>
+#endif // ENABLE_SA_TRACE
+
#ifndef QT_NO_ANIMATION
#define DEFAULT_TIMER_INTERVAL 16
@@ -217,6 +221,10 @@
slowdownFactor(5.0f), profilerCallback(0),
driverStartTime(0), temporalDrift(0)
{
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtAnimTimingInterval, DEFAULT_TIMER_INTERVAL);
+#endif // ENABLE_SA_TRACE
+
time.invalidate();
driver = &defaultDriver;
}
@@ -315,6 +323,10 @@
//* it might happen in some cases that the delta is negative because the animation driver
// advances faster than time.elapsed()
if (delta > 0) {
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtAnimTick, 1);
+#endif // ENABLE_SA_TRACE
+
insideTick = true;
if (profilerCallback)
profilerCallback(delta);
@@ -324,6 +336,10 @@
}
insideTick = false;
currentAnimationIdx = 0;
+
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtAnimTick, 0);
+#endif // ENABLE_SA_TRACE
}
}
@@ -371,6 +387,10 @@
void QUnifiedTimer::setTimingInterval(int interval)
{
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtAnimTimingInterval, interval);
+#endif // ENABLE_SA_TRACE
+
timingInterval = interval;
if (driver->isRunning() && !pauseTimer.isActive()) {
@@ -866,6 +886,10 @@
void QAnimationDriver::start()
{
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtAnimDriver, 1);
+#endif // ENABLE_SA_TRACE
+
Q_D(QAnimationDriver);
if (!d->running) {
d->running = true;
@@ -882,6 +906,10 @@
d->running = false;
emit stopped();
}
+
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtAnimDriver, 0);
+#endif // ENABLE_SA_TRACE
}
Index: qtbase-opensource-src-5.4.0/src/corelib/corelib.pro
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/corelib/corelib.pro 2014-12-05 09:24:36.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/corelib/corelib.pro 2014-12-30 11:31:07.012603962 -0700
@@ -33,6 +33,9 @@
load(qt_module)
load(qfeatures)
+contains(QT_CONFIG,tracesupport):CONFIG += tracesupport
+contains(QT_CONFIG,tracesupport):LIBS += -L$$DESTDIR
+
include(animation/animation.pri)
include(arch/arch.pri)
include(global/global.pri)
Index: qtbase-opensource-src-5.4.0/src/corelib/kernel/qcoreapplication.cpp
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/corelib/kernel/qcoreapplication.cpp 2014-12-05 09:24:37.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/corelib/kernel/qcoreapplication.cpp 2014-12-30 11:31:07.020603962 -0700
@@ -105,6 +105,11 @@
#include <algorithm>
+#ifdef ENABLE_SA_TRACE
+ #define QT_TRACEPOINT_PER_LIBRARY_DEFINITION
+ #include <QtTraceSupport/qt_tracepoints.h>
+#endif // ENABLE_SA_TRACE
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_QOBJECT
@@ -399,6 +404,10 @@
, q_ptr(0)
#endif
{
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtApplicationCreated, 1);
+#endif // ENABLE_SA_TRACE
+
app_compile_version = flags & 0xffffff;
static const char *const empty = "";
if (argc == 0 || argv == 0) {
@@ -436,6 +445,10 @@
delete [] origArgv;
#endif
QCoreApplicationPrivate::clearApplicationFilePath();
+
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtApplicationCreated, 0);
+#endif // ENABLE_SA_TRACE
}
#ifndef QT_NO_QOBJECT
@@ -914,6 +927,11 @@
*/
bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
{
+#ifdef ENABLE_SA_TRACE
+ if (event)
+ qt_tracepoint(Qt, qtCoreEvents, event->type());
+#endif // ENABLE_SA_TRACE
+
// Make it possible for Qt Script to hook into events even
// though QApplication is subclassed...
bool result = false;
Index: qtbase-opensource-src-5.4.0/src/gui/gui.pro
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/gui/gui.pro 2014-12-05 09:24:35.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/gui/gui.pro 2014-12-30 11:31:07.028603962 -0700
@@ -46,6 +46,8 @@
include(animation/animation.pri)
include(itemmodels/itemmodels.pri)
+contains(QT_CONFIG,tracesupport):CONFIG += tracesupport
+
QMAKE_LIBS += $$QMAKE_LIBS_GUI
load(cmake_functions)
Index: qtbase-opensource-src-5.4.0/src/gui/image/qimagereader.cpp
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/gui/image/qimagereader.cpp 2014-12-05 09:24:36.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/gui/image/qimagereader.cpp 2014-12-30 11:32:00.808603449 -0700
@@ -158,6 +158,11 @@
#include <algorithm>
+#ifdef ENABLE_SA_TRACE
+ #include <QThread>
+ #include <QtTraceSupport/qt_tracepoints.h>
+#endif // ENABLE_SA_TRACE
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_IMAGEFORMATPLUGIN
@@ -1215,6 +1220,11 @@
if (!d->handler && !d->initHandler())
return false;
+#ifdef ENABLE_SA_TRACE
+ long threadId = (long)(QThread::currentThread());
+ qt_tracepoint(Qt, qtImageReader, threadId, 1, fileName().toLatin1().constData());
+#endif // ENABLE_SA_TRACE
+
// set the handler specific options.
if (d->handler->supportsOption(QImageIOHandler::ScaledSize) && d->scaledSize.isValid()) {
if ((d->handler->supportsOption(QImageIOHandler::ClipRect) && !d->clipRect.isNull())
@@ -1235,6 +1245,9 @@
if (!d->handler->read(image)) {
d->imageReaderError = InvalidDataError;
d->errorString = QImageReader::tr("Unable to read image data");
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtImageReader, threadId, 0, fileName().toLatin1().constData());
+#endif // ENABLE_SA_TRACE
return false;
}
@@ -1295,6 +1308,10 @@
image->setDevicePixelRatio(2.0);
}
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtImageReader, threadId, 0, fileName().toLatin1().constData());
+#endif // ENABLE_SA_TRACE
+
return true;
}
Index: qtbase-opensource-src-5.4.0/src/gui/kernel/qguiapplication.cpp
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/gui/kernel/qguiapplication.cpp 2014-12-05 09:24:36.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/gui/kernel/qguiapplication.cpp 2014-12-30 11:31:07.040603962 -0700
@@ -102,6 +102,11 @@
#include <ctype.h>
+#ifdef ENABLE_SA_TRACE
+ #define QT_TRACEPOINT_PER_LIBRARY_DEFINITION
+ #include <QtTraceSupport/qt_tracepoints.h>
+#endif // ENABLE_SA_TRACE
+
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT bool qt_is_gui_used = true;
@@ -1536,6 +1541,35 @@
*/
bool QGuiApplication::notify(QObject *object, QEvent *event)
{
+#ifdef ENABLE_SA_TRACE
+ if (event) {
+ switch (event->type())
+ {
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ {
+ QKeyEvent* key = static_cast<QKeyEvent*>(event);
+ qt_tracepoint(Qt, qtNotifyKeyEvent, key->type(), key->key(), key->modifiers());
+ }
+ break;
+
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseMove:
+ {
+ QMouseEvent* mouse = static_cast<QMouseEvent*>(event);
+ qt_tracepoint(Qt, qtSendMouseEvent, mouse->buttons());
+ }
+ break;
+
+ default:
+ // Ignore
+ break;
+ }
+ }
+#endif // ENABLE_SA_TRACE
+
if (object->isWindowType())
QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event);
return QCoreApplication::notify(object, event);
Index: qtbase-opensource-src-5.4.0/src/src.pro
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/src.pro 2014-12-05 09:24:31.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/src.pro 2014-12-30 11:31:07.056603962 -0700
@@ -120,7 +120,11 @@
src_android.subdir = $$PWD/android
+src_tracesupport.subdir = $$PWD/tracesupport
+src_tracesupport.target = sub-tracesupport
+
# this order is important
+contains(QT_CONFIG, tracesupport): SUBDIRS += src_tracesupport
SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc
!contains(QT_DISABLED_FEATURES, regularexpression):pcre {
SUBDIRS += src_3rdparty_pcre
Index: qtbase-opensource-src-5.4.0/src/tracesupport/qt_tracepoints.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ qtbase-opensource-src-5.4.0/src/tracesupport/qt_tracepoints.c 2014-12-30 11:31:07.056603962 -0700
@@ -0,0 +1,2 @@
+#define TRACEPOINT_CREATE_PROBES
+#include "qt_tracepoints.h"
Index: qtbase-opensource-src-5.4.0/src/tracesupport/qt_tracepoints.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ qtbase-opensource-src-5.4.0/src/tracesupport/qt_tracepoints.h 2014-12-30 11:31:07.064603962 -0700
@@ -0,0 +1,85 @@
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER Qt
+
+#undef TRACEPOINT_INCLUDE_FILE
+#define TRACEPOINT_INCLUDE_FILE ./qt_tracepoints.h
+
+#if !defined(_QT_TRACEPOINTS_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define _QT_TRACEPOINTS_H
+
+/* This define will be present exactly once per output library */
+#ifdef QT_TRACEPOINT_PER_LIBRARY_DEFINITION
+ #define TRACEPOINT_DEFINE
+ #define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
+#endif
+
+#include <lttng/tracepoint.h>
+#include <stdint.h>
+
+/* Map qt_tracepont to the tracepoint implementation used: */
+#define qt_tracepoint tracepoint
+
+/* Startup Agent, app start stop. */
+TRACEPOINT_EVENT(Qt, qtApplicationCreated,
+ TP_ARGS(int, isAlive),
+ TP_FIELDS(ctf_integer(int, isAlive, isAlive)))
+
+/* Qt event processed by Qt core event loop (event types & name) */
+TRACEPOINT_EVENT(Qt, qtQmlResourceLoad,
+ TP_ARGS(int, isLoading, const char *, qmlFileName),
+ TP_FIELDS(ctf_integer(int, isLoading, isLoading)
+ ctf_string(qmlFileName, qmlFileName)))
+
+/* To show the start & end of Qt QML processing events (1=> Start, 0=> Stop) */
+TRACEPOINT_EVENT(Qt, qtQmlFrameCompile,
+ TP_ARGS(int, isCompiling, const char *, qmlFileName),
+ TP_FIELDS(ctf_integer(int, isCompiling, isCompiling) ctf_string(qmlFileName, qmlFileName)))
+TRACEPOINT_EVENT(Qt, qtQmlFrameCreate,
+ TP_ARGS(int, isCreating, const char *, qmlFileName),
+ TP_FIELDS(ctf_integer(int, isCreating, isCreating) ctf_string(qmlFileName, qmlFileName)))
+TRACEPOINT_EVENT(Qt, qtQmlFrameBind,
+ TP_ARGS(int, isBinding, const char *, qmlFileName),
+ TP_FIELDS(ctf_integer(int, isBinding, isBinding) ctf_string(qmlFileName, qmlFileName)))
+
+/* Qt Frame Sync (OpenGL or Raster) */
+TRACEPOINT_EVENT(Qt, qtFrameSync, TP_ARGS(int, isRendering), TP_FIELDS(ctf_integer(int, isRendering, isRendering)))
+
+/* Qt animation framework timer activity */
+TRACEPOINT_EVENT(Qt, qtAnimDriver, TP_ARGS(int, isActive), TP_FIELDS(ctf_integer(int, isActive, isActive)))
+TRACEPOINT_EVENT(Qt, qtAnimTick, TP_ARGS(int, isUpdating), TP_FIELDS(ctf_integer(int, isUpdating, isUpdating)))
+TRACEPOINT_EVENT(Qt, qtAnimTimingInterval, TP_ARGS(int, interval), TP_FIELDS(ctf_integer(int, interval, interval)))
+
+/* Qt event processed by Qt core event loop (event types & name) */
+TRACEPOINT_EVENT(Qt, qtCoreEvents,
+ TP_ARGS(int, eventType),
+ TP_FIELDS(ctf_integer(int, eventType, eventType)))
+
+/* Qt event processed by Qt core event loop (event types & name) */
+TRACEPOINT_EVENT(Qt, qtGraphicsSceneEvents,
+ TP_ARGS(int, eventType),
+ TP_FIELDS(ctf_integer(int, eventType, eventType)))
+
+/* Qt QSendMouseEvent (event types & name) */
+TRACEPOINT_EVENT(Qt, qtSendMouseEvent, TP_ARGS(int, buttons), TP_FIELDS(ctf_integer(int, buttons, buttons)))
+TRACEPOINT_EVENT(Qt, qtMouseEventConsumed, TP_ARGS(int, buttons), TP_FIELDS(ctf_integer(int, buttons, buttons)))
+
+/* Qt NotifyKeyEvent (event types & name) */
+TRACEPOINT_EVENT(Qt, qtNotifyKeyEvent, TP_ARGS(int, type, int, key, int, modifiers),
+ TP_FIELDS(ctf_integer(int, type, type)
+ ctf_integer(int, key, key)
+ ctf_integer(int, modifiers, modifiers)))
+TRACEPOINT_EVENT(Qt, qtKeyEventConsumed, TP_ARGS(int, type, int, key, int, modifiers),
+ TP_FIELDS(ctf_integer(int, type, type)
+ ctf_integer(int, key, key)
+ ctf_integer(int, modifiers, modifiers)))
+
+/* Qt ImageReader Event (image filename) */
+TRACEPOINT_EVENT(Qt, qtImageReader,
+ TP_ARGS(int, threadPtr, int, isLoading, const char *, imageName),
+ TP_FIELDS(ctf_integer(int, threadPtr, threadPtr)
+ ctf_integer(int, isLoading, isLoading)
+ ctf_string(imageName, imageName)))
+
+#endif /* _QT_TRACEPOINTS_H */
+
+#include <lttng/tracepoint-event.h>
Index: qtbase-opensource-src-5.4.0/src/tracesupport/tracesupport.pro
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ qtbase-opensource-src-5.4.0/src/tracesupport/tracesupport.pro 2014-12-30 11:31:07.064603962 -0700
@@ -0,0 +1,22 @@
+TARGET = QtTraceSupport
+CONFIG += create_prl
+
+QT -= core gui
+
+load(qt_module)
+
+#################################
+
+DEFINES += ENABLE_SA_TRACE
+CFLAGS += -g3 -O1
+LIBS += -llttng-ust -lurcu-bp -ldl
+
+
+#################################
+
+SOURCES = qt_tracepoints.c
+
+HEADERS += qt_tracepoints.h
+
+
+
Index: qtbase-opensource-src-5.4.0/src/widgets/graphicsview/qgraphicsscene.cpp
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/widgets/graphicsview/qgraphicsscene.cpp 2014-12-05 09:24:33.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/widgets/graphicsview/qgraphicsscene.cpp 2014-12-30 11:31:07.068603962 -0700
@@ -243,6 +243,10 @@
#include <private/qgesturemanager_p.h>
#include <private/qpathclipper_p.h>
+#ifdef ENABLE_SA_TRACE
+ #include <QtTraceSupport/qt_tracepoints.h>
+#endif // ENABLE_SA_TRACE
+
// #define GESTURE_DEBUG
#ifndef GESTURE_DEBUG
# define DEBUG if (0) qDebug
@@ -3273,6 +3277,10 @@
*/
bool QGraphicsScene::event(QEvent *event)
{
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtGraphicsSceneEvents, event->type());
+#endif // ENABLE_SA_TRACE
+
Q_D(QGraphicsScene);
switch (event->type()) {
Index: qtbase-opensource-src-5.4.0/src/widgets/kernel/qapplication.cpp
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/widgets/kernel/qapplication.cpp 2014-12-05 09:24:33.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/widgets/kernel/qapplication.cpp 2014-12-30 11:31:07.096603963 -0700
@@ -101,6 +101,11 @@
#include <qpa/qplatformwindow.h>
+#ifdef ENABLE_SA_TRACE
+ #define QT_TRACEPOINT_PER_LIBRARY_DEFINITION
+ #include <QtTraceSupport/qt_tracepoints.h>
+#endif // ENABLE_SA_TRACE
+
//#define ALIEN_DEBUG
static void initResources()
@@ -2692,6 +2697,10 @@
Q_ASSERT(nativeWidget);
Q_ASSERT(buttonDown);
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtSendMouseEvent, event->buttons());
+#endif // ENABLE_SA_TRACE
+
if (alienWidget && !isAlien(alienWidget))
alienWidget = 0;
@@ -3167,6 +3176,13 @@
case QEvent::KeyPress:
case QEvent::KeyRelease:
{
+#ifdef ENABLE_SA_TRACE
+ {
+ QKeyEvent* key = static_cast<QKeyEvent*>(e);
+ qt_tracepoint(Qt, qtNotifyKeyEvent, key->type(), key->key(), key->modifiers());
+ }
+#endif // ENABLE_SA_TRACE
+
bool isWidget = receiver->isWidgetType();
bool isGraphicsWidget = false;
#ifndef QT_NO_GRAPHICSVIEW
@@ -3215,6 +3231,10 @@
#endif
}
qt_in_tab_key_event = false;
+
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtKeyEventConsumed, key->type(), key->key(), key->modifiers());
+#endif // ENABLE_SA_TRACE
}
break;
case QEvent::MouseButtonPress:
@@ -3291,6 +3311,10 @@
mouse->setAccepted(eventAccepted);
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtMouseEventConsumed, mouse->buttons());
+#endif // ENABLE_SA_TRACE
+
if (e->type() == QEvent::MouseMove) {
if (!pw)
break;
Index: qtbase-opensource-src-5.4.0/src/widgets/kernel/qwidgetbackingstore.cpp
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/widgets/kernel/qwidgetbackingstore.cpp 2014-12-05 09:24:33.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/widgets/kernel/qwidgetbackingstore.cpp 2014-12-30 11:31:07.104603963 -0700
@@ -57,6 +57,10 @@
# include <qpa/qplatformnativeinterface.h>
#endif
+#ifdef ENABLE_SA_TRACE
+ #include <QtTraceSupport/qt_tracepoints.h>
+#endif // ENABLE_SA_TRACE
+
QT_BEGIN_NAMESPACE
extern QRegion qt_dirtyRegion(QWidget *);
@@ -80,6 +84,10 @@
Q_ASSERT(backingStore);
Q_ASSERT(tlw);
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtFrameSync, 1);
+#endif // ENABLE_SA_TRACE
+
#if !defined(QT_NO_PAINT_DEBUG)
static int flushUpdate = qgetenv("QT_FLUSH_UPDATE").toInt();
if (flushUpdate > 0)
@@ -116,6 +124,10 @@
} else
#endif
backingStore->flush(region, widget->windowHandle(), offset);
+
+#ifdef ENABLE_SA_TRACE
+ qt_tracepoint(Qt, qtFrameSync, 0);
+#endif // ENABLE_SA_TRACE
}
#ifndef QT_NO_PAINT_DEBUG
Index: qtbase-opensource-src-5.4.0/src/widgets/widgets.pro
===================================================================
--- qtbase-opensource-src-5.4.0.orig/src/widgets/widgets.pro 2014-12-05 09:24:33.000000000 -0700
+++ qtbase-opensource-src-5.4.0/src/widgets/widgets.pro 2014-12-30 11:31:07.116603963 -0700
@@ -31,6 +31,7 @@
include(statemachine/statemachine.pri)
include(effects/effects.pri)
+contains(QT_CONFIG,tracesupport):CONFIG += tracesupport
QMAKE_LIBS += $$QMAKE_LIBS_GUI
Index: qtbase-opensource-src-5.4.0/sync.profile
===================================================================
--- qtbase-opensource-src-5.4.0.orig/sync.profile 2014-12-05 09:24:30.000000000 -0700
+++ qtbase-opensource-src-5.4.0/sync.profile 2014-12-30 11:31:07.120603963 -0700
@@ -18,6 +18,7 @@
"QtANGLE/EGL" => "!$basedir/src/3rdparty/angle/include/EGL",
"QtZlib" => "!$basedir/src/3rdparty/zlib",
"QtOpenGLExtensions" => "$basedir/src/openglextensions",
+ "QtTraceSupport" => "$basedir/src/tracesupport",
);
%moduleheaders = ( # restrict the module headers to those found in relative path
);