Commit Graph

23 Commits

Author SHA1 Message Date
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Jarek Kobus
564d2666c3 Fix build with GCC 11: include <limits>
Task-number: QTBUG-90395
Change-Id: Ic6d3fde59bd44d364ca1c1fe48b094bb9768b43c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-29 09:55:51 +00:00
Marc Mutz
2e556c96b6 QmlProfiler: avoid using Q_FOREACH over QVarLengthArray
The squeeze() function is called by clients for QVLA's, which means
it's copying 1-2KiB of data (depending on sizeof(value_type)) just
to iterate over a small part of it.

Use a C++11 ranged for loop.

Change-Id: I2c33ae0c5a3d9d941cd9e385fc6bbb4fb0fa3c2c
Reviewed-by: hjk <hjk@qt.io>
2019-07-25 14:40:11 +00:00
Alessandro Portale
d1df55d128 QmlProfiler: Modernize
modernize-*

Change-Id: Ibdf9c0ae91bf8a622facc7f323112b550f532f15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-12-02 14:27:29 +00:00
Ulf Hermann
37bcbf7575 Tracing: Make sure we don't cast between different kinds of events
Add a classId to TraceEvent and TraceEventType and add is() and as()
methods that check for it.

Change-Id: I76fe1df624516b36db90d57d4788b17e0b690726
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:03:59 +00:00
Orgad Shaneh
ef528e1801 QmlProfiler: Avoid memcpy for non-POD object
Replace with assignments/memcpy for members.

Detected by GCC8.

Change-Id: I9866ea0215cf5d43b55ed10d21e4efa371315365
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-11 09:21:04 +00:00
Ulf Hermann
734611131d Move Timeline and FlameGraph into a common "Tracing" library
This allows us to share code between the two, in particular the QML code
for the Details window, and the theme code. This way we can potentially
deduplicate some code.

Change-Id: I3a0d26b18488bd2a46b5b077b5b5d79ac2dfc5ce
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-04 14:08:47 +00:00
Ulf Hermann
507c2d6b5b Move parts of QmlEvent and QmlEventType to timeline
Timeline will become a generic trace handling library. It needs some
abstract concept of events and event types.

Move operator== and operator!= for QmlEvent into the test as we don't
use them anywhere else.

Move the operators for QmlEventType to QmlProfilerTraceClient. We want
to get rid of the hash there as soon as we can assume that no
application we want to profile doesn't support server type IDs.

Change-Id: Icde4e3e7634e387171dc1d8bef7bbe8e71684a1a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:15:38 +00:00
Ulf Hermann
32c54dfdac QmlProfiler: Fix some number conversion issues
Qt containers have int as size type, while std containers have size_t.
We can use auto and decltype to deal with this. Also, memcpy and malloc
expect size_t, not int.

Change-Id: Id2942d14978c8a15f72967962d551ddb20905471
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:24:08 +00:00
Ulf Hermann
bffbae47f1 QmlProfiler: Don't write past end in QmlEvent
If the external data is quint16_max long, we need to stop writing at
quint16_max - 1. So we cannot rely on unsigned integer overflow to
enforce the boundary.

Also, use for (...) rather than foreach (...). This should easily offset
the extra overhead introduced by the bounds check.

Change-Id: I51d1aef1040fbaa8396ca80ec7e30b2fe7b7dd0b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-11-22 11:46:29 +00:00
Ulf Hermann
85b5810f9c QmlProfiler: Add some missing bits to QmlEvent
We want move constructor, move assignment, ==, and !=. Also, drop some
unreachable code.

Change-Id: I65f24d7ba0f146ad37ec4b7c438b47d4abc3d688
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-06-08 08:54:37 +00:00
Ulf Hermann
8bdc612b3a QmlProfiler: Add default template param to QmlEvent::number
The number type used to transfer data from the internal to the external
list is an implementation detail, and qint64 will always work. Users
can optimize the casting by choosing the same type as the external list
uses to store the numbers, though.

Change-Id: I069c31b130960519e7d27ec79a456924f7777364
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-08 08:54:20 +00:00
Ulf Hermann
0023c87098 QmlProfiler: Don't add junk to the end of strings from QmlEvents
The UTF-8 data stored in the event is not necessarily null-terminated.

Change-Id: Id5d4f0b50f8c7c70aa6576121905072984f1c342
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-08 08:49:03 +00:00
Ulf Hermann
bc18fafffd QmlProfiler: Drop duration from QmlEvent
It isn't used anymore.

Change-Id: I432bebbd9ddde15baa22a17d339ac724ddb5fe59
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 12:31:06 +00:00
David Schulz
1c3e122d43 QmlProfiler: Fix compile warning on Windows.
c:\dev\insrc\devqc\src\plugins\qmlprofiler\qmlevent.h(274): warning
C4267: '=': conversion from 'size_t' to 'quint16', possible loss of data

Change-Id: I86ab7a9b2d01a3da70dd765cb64c6e58c1044cc1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-05-11 10:54:34 +00:00
Ulf Hermann
bb7925b4ef QmlProfiler: Add data stream operators for QmlEvent
We try to further compress the QML events when saving as we can use the
additional space in that case.

Change-Id: Ida308963685169d1daabd7936612628fd4d265ae
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-10 16:45:02 +00:00
Ulf Hermann
6aaa2aea35 QmlProfiler: Add some Q_DECLARE_METATYPE
Change-Id: If09ce20e997087ff73eb60bb16ef2e501280944d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-10 16:44:48 +00:00
Ulf Hermann
21caa59292 QmlProfiler: Make QmlEvent Q_MOVABLE_TYPE
Change-Id: I7a6e9909e537f1bb0bf8dcecb6c85012bac4d1e8
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-10 12:25:47 +00:00
Ulf Hermann
f63d64330e QmlProfiler: Avoid zero-sized arrays
Change-Id: Ia17d067ed677cd3a63d8a478ecb9abec91032771
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-09 11:25:29 +00:00
Ulf Hermann
8d15633a22 QmlProfiler: Add a QmlTypedEvent and extend QmlEvent
The QmlTypedEvent is mainly useful to read a generic QmlEvent and
QmlEventType from a QPacket. QmlEventType has a stream operator to do
exactly that. QmlEvent also gets further options to store 32-bit data
in addition to 64- and 8-bit data. Also, with the more generic storage
layout we can reduce the memory consumption of range events by 50%.
This comes at the cost of additional memory allocations for non-range
events, but as non-range events are significantly less frequent than
range events, this is a good tradeoff. Finally the new storage layout
lends itself to efficient serialization, which will help when
developing new storage and transfer formats for QML traces.

Change-Id: I420de68b0142f23c8fb2ca8b329d7ffe69c83fe0
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-09 08:20:22 +00:00
Ulf Hermann
215c0533d2 QmlProfiler: Rename QmlEvent::startTime to "timestamp"
As many events are instantaneous and we're going to drop the duration
property soon, this is more fitting.

Change-Id: I6e13dd076a5b9df16aed44bf9f631ea5760e9cbf
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-06 10:36:40 +00:00
Ulf Hermann
a955537132 QmlProfiler: Fix the naming scheme for events and event types
Move them out of the QmlProfilerDataModel class, drop the "Data"
suffix, and rename symbols that refer to them in order to call them by
their names.

Change-Id: I41151359921b325edb79111371083c4185bd148b
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-04 09:49:32 +00:00