Commit Graph

44 Commits

Author SHA1 Message Date
Ulf Hermann cc761e9c5a qmlprofiler: Fix data sorting
When analyzing a range with multiple child ranges, qmlprofiler would
create a rather random association between the start and end events.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I564d2c74656dda1cb0963c75cd7b947a7f86d05e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-01-25 18:35:05 +01:00
Marc Mutz c2d490a238 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-10-07 23:38:56 +02:00
Marc Mutz 958cd3ee10 Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:

  auto QtContainerClass = anyOf(
      expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
      expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.

Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-07 23:38:48 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Karsten Heimrich 1b10ce6a08 Port QtDeclarative from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-16 22:46:16 +02:00
Simon Hausmann da4069a96b Fix interactive mode of qmlprofiler
Use the correct commands for toggling the recording status and flushing.
Also don't clear the event types when clearing the profiler data after a
flush, as those remain valid and are needed for processing in the
future.

Change-Id: I5a3cd5aa33e43a3e81c53cbbaa0c5b8fb407c5bb
Fixes: QTBUG-78044
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-09 10:13:10 +02:00
Ulf Hermann 03739f2150 Make QtQmlDebug independent of QtQml
This means QtQmlDebug needs its own qqmlprofilerdefintions.h. This is a
good thing because this way we notice if we change the definitions in an
incompatible way. The test uses QtQmlDebug after all. Also,
qqmldebugserviceinterfaces_p.h is not available anymore, which means the
service names have to be spelled out. This, also, is beneficial as it
prevents us from accidentally changing the names.

In the context of QmlDebug we don't need to namespace the profiler
definitions, either. This simplifies some code.

Task-number: QTBUG-60996
Change-Id: Ibb39e48c9b758687d68b8ce4431f45eb26939a09
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-24 08:44:41 +00:00
Ulf Hermann b82296f825 Use better QmlProfiler client from Qt Creator
This client can track locations itself, and thus doesn't require the
server to send the event types over and over with each message. Once all
our client implementations have this feature we can drop a lot of code.

Furthermore, this way we can write regression tests for bugs that only
occur when client side location tracking is active.

Change-Id: I3735392452e20a7be98e92b900fadef04701d85f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-02 09:38:46 +00:00
Lars Knoll c3e1e6390e Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I71275a2076c3d32ee2896571be882067320a2e9e
2017-05-02 08:40:48 +02:00
Thiago Macieira 80dc036882 Run includemocs in qtdeclarative
Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-26 13:19:13 +00:00
Samuel Gaist 70a5d7bd87 Migrate to QRegularExpression
This patch updates the code base to use QRegularExpression in the place
of the deprecated QRegExp class.

Change-Id: I3231ac9f7902a1cd16cd4ef5f26e6cdc05e2fa4b
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-04-09 22:17:20 +00:00
Samuel Gaist 4b445c487d QRegExp include cleanup
This patch adds missing include statement where the QRegExp class is
used.

Change-Id: I02d2995dd380f1e4db3777ae9759098c0e7757bd
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-03-17 08:00:17 +00:00
Anton Kudryavtsev 457bb7a465 tools: use const (and const APIs) more
For CoW types, prefer const methods to avoid needless detach()ing.

Change-Id: If9018391c001eba3b4b2061d06c4caa8136811ab
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-22 16:44:33 +00:00
Anton Kudryavtsev 3ef4fac9ff tools: replace 'foreach' with 'range for'
Mark some local variables or parameters as const
to prevent detach()'ing.
Use qAsConst where is not possible mark as const.

Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 06:52:34 +00:00
Anton Kudryavtsev 829c8faee2 tools: use QStringRef more
Change-Id: I4fccbfb2b965daf3a31846d1d51d39eb74ad944d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-12 12:09:35 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Anton Kudryavtsev 201f84f204 Tools: fix expensive iteration over QHash::keys()
Change-Id: I902bafdbc2ddfceeacfc9ef274513a2b0a23aed7
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-01-15 14:11:38 +00:00
Anton Kudryavtsev ebc76aeea2 QtDeclarative: use prefix ++/-- for iterator types
... because it's useful for non-primitive types.
These were the only two remaining instances in QtDeclarative.

Change-Id: I52eba66313e953762d87313ccbd7ee0be9039be1
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2016-01-09 08:59:25 +00:00
Ulf Hermann a773d36467 QmlProfiler: Remove "Source code not available"
A missing tag is much better to express that piece of information. The
original message would have to be parsed in order to figure out that
it's actually not source code.

Change-Id: I3cc7cad26c4fad84f5d1aa63c59a84523109dd2e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-05 08:42:50 +00:00
Ulf Hermann 57430b2bda Move QML profiler client to qmldebug
Change-Id: I506909b68be6cbad631d1645673c2d38460aed33
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 20:07:53 +00:00
Ulf Hermann cdb0ddeffd QmlProfiler: Collect useful input events
Just "Key" or "Mouse" as only attributes of input events are not very
useful. This change adds some additional information and also collects
input events from QQuickWindow.

Change-Id: I062bbffeef3fa87776bc8be33f2321edf793faa2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 20:07:45 +00:00
Ulf Hermann 3a9bfeb5ef QmlProfiler: Fix lookup of type strings
sizeof(QString) == sizeof(char *), but only incidentally.

Change-Id: I1d39825746f5c6a74b540be7f254afbf0fb375d0
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-28 16:50:08 +00:00
Liang Qi 7063fefe4b Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I11ea57222ba5aa683b7bfd7735fbc1d2cf86e875
2015-10-14 15:48:12 +02:00
Friedemann Kleint 16154fba86 Tools: Fix single-character string literals.
Use character literals where applicable.

Change-Id: I55679dcc13c4c79567712c0dfaaabc2b84fee010
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-10-13 13:40:44 +00:00
Ulf Hermann 28f6459933 qmlprofiler: Improve output of event location and optional descriptions
Line and column information can be useful even without a file name. The
file name can sometimes be inferred from the function being run and
doesn't have to be stated again.

Empty displayName and details tags are pretty useless, though.

Change-Id: I0a65696d391e00d56f04acf646e3179dca163883
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-15 10:20:46 +00:00
Ulf Hermann 9713146cbc qmlprofiler: Remove V8 profiler client
It's been a long time since the last Qt version with V8.

Change-Id: Iae36dd1c5bb6275254c6a64a8e6b843454139e2b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-28 08:59:30 +00:00
Ulf Hermann eb30e3d7ee Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	src/qml/debugger/qv4debugservice.cpp
	src/qml/jsruntime/qv4value_inl_p.h
	src/qml/jsruntime/qv4value_p.h
	src/qml/memory/qv4mm.cpp
	src/qml/memory/qv4mm_p.h
	src/qml/qml/qqmlnotifier_p.h
	src/qml/qml/qqmlproperty.cpp
	src/quick/items/qquickflickable.cpp
	src/quick/items/qquicktextedit.cpp
	tests/auto/quick/qquickwindow/BLACKLIST

The extra changes in qqmlbinding.cpp are ported from changes to
qqmlproperty.cpp that occurred in parallel with writeBinding() being
moved to qqmlbinding.cpp.

Change-Id: I16d1920abf448c29a01822256f52153651a56356
2015-08-18 10:29:47 +02:00
Friedemann Kleint 65ff4e1e88 qmlprofiler: Add missing #include <limits>.
Fixes the build with VS 2008 (Desktop).

Change-Id: I8c9682526754586ea6f597f540a4d5b42363f052
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-07-28 14:11:33 +00:00
Ulf Hermann 30ead66c62 qmlprofiler: Use QQmlProfilerDefinitions for accessing definitions
Change-Id: I6def7dd8a0ce0db22ad4829029d8510f5869c813
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-23 08:26:04 +00:00
Sérgio Martins 138f24d2b3 Fix inefficient usages of qDeleteAll()
No reason to iterate through all items to create a temporary
QList we don't need.

Change-Id: I3c5388f026ded0290afb9dd35fc7934011c4998d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-26 16:50:38 +00:00
Ulf Hermann 08533d2659 qmlprofiler: Record input events
Change-Id: Ib6413d97638b192377d7dbeb19ed0c2f733a06a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-09 18:31:47 +00:00
Ulf Hermann cd0b001ec8 qmlprofiler: Improve options for trace output
* Remove the auto-generation of file names.
* Accept file names as parameters or from interactive commands
* Output to stdout by default for better scripting and quick preview
* Decouple output from clearing of data so that you can write the same
  data multiple times.

Task-number: QTBUG-43066
Change-Id: Ia4cc3701cbac7c6f8948b11307130a5d6a2ff44c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-06 21:13:25 +00:00
Ulf Hermann ca378099d9 qmlprofiler: Allow aggregation of multiple traces into one file.
Change-Id: Ifc9f9adafa3178e68212fb97914a6f4cae9a4c83
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-21 15:19:49 +00:00
Jani Heikkinen c5796292ad Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-25 11:28:46 +02:00
Ulf Hermann 74f483f231 Write memory events into tracefiles generated by qmlprofiler
Change-Id: Ic01505194f29967ed1aad16fe36e14dc5532ae25
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-12 10:16:40 +02:00
Ulf Hermann ac56e7cda7 Javascript heap profiler
This profiler tracks every memory allocation and deallocation, by the
MemoryManager as well as the V4 VM, and exposes them as a stream of
events to the profiler service.

Change-Id: I85297d498f0a7eb55df5d7829c4b7307de980519
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-06-06 18:18:35 +02:00
Ulf Hermann 2371ec96da Properly support all events in trace files and clean up a bit.
In particular, use both message and range type to identify events so
that we can get rid of the messy type aliasing.

Task-number: QTBUG-36953
Change-Id: I691a7501aa285f78f7ce5b7017ef50628f44fcf7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-06-06 09:51:33 +02:00
Ulf Hermann d7ea461fde Save painting events in Qt5 style with thread ID from qmlprofiler
This is necessary to support https://codereview.qt-project.org/80391
and to make the trace files consistent with Qt Creator's.

Change-Id: I45490c33ae9bd8fbbb6bace08bdc2f44c76bf966
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-03-18 12:02:48 +01:00
Giuseppe D'Angelo 4df73e62a7 Remove qSort usages from declarative
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I8fa7d0186cc8f0ba562695974829e37f1eb87f2f
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 01:10:37 +02:00
Sergio Ahumada 83deab8d1b Update copyright year in Digia's license headers
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-10 19:52:37 +01:00
Iikka Eklund 46010aa7a2 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-23 08:22:24 +02:00
Christiaan Janssen 3b66a38e58 QmlProfiler: storing binding type
Change-Id: If1f02e1e6f6ce6aba9874a63d01a08d57571f991
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-05-04 15:19:25 +02:00
Christiaan Janssen 1f76525c5f QmlProfiler: updated standalone app
Using a stripped-down version of the profiler data structure.

Change-Id: I93a0b12462edea0ca8a1d0db42aa892aa2afc919
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-13 09:39:03 +01:00