Commit Graph

126 Commits

Author SHA1 Message Date
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
Fawzi Mohamed
fd89043de2 qmljs: (QString -> Utils::FilePath)++
convert more QString containing paths to Utils::FilePath

Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-13 17:13:23 +00:00
Janne Koskinen
e37f1d3d6b Add Quick3d profiler support
Add support for quick3d profiling

Task-number: QTBUG-98146
Change-Id: Ida84537df685e8bddc536158519600d722a23d2e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-24 06:21:54 +00:00
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Eike Ziller
8add61b216 Merge remote-tracking branch 'origin/4.13' into 4.14
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ia779a511d73d86d79dbcecd8cc3763cf3d605a87
2020-10-09 16:35:27 +02:00
Dominik Holland
db4b3641f5 qmlprofiler: Fix a crash in the rangeFilter
Always check the stack before popping an element.

Fixes: QTCREATORBUG-24730
Change-Id: I7dc6363137ef002219fbc49b7343cff8112a58c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-10-09 11:38:28 +00:00
Christian Stenger
ddc5afc4ec QmlProfiler: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: I98bc7a6561c8e19da984d2efbf36d890b1f48ebf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-07-14 11:30:54 +00:00
hjk
edcd955aad QmlProfiler: Remove some dead code
Change-Id: I5f13797044e2c80d4a651bb91bf6e722552566f6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-30 15:50:21 +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
517e954ff1 QmlProfiler: Avoid some compiler warnings
If size_t is 32bit wide, any comparison to qint64Max is pointless. And
in order to compare a size_t to intMax, we need to cast intMax to
size_t.

Change-Id: Ida1945ca0cd8865b8d8620c8b23b7e21a20dc43c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-09-18 13:47:37 +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
Leena Miettinen
0f2febd784 QML Profiler: Fix punctuation in messages
Change-Id: Iebe1bb75a47d2aff7b5e92a6d6890ebe758c771b
Reviewed-by: hjk <hjk@qt.io>
2018-06-13 07:13:19 +00:00
Ulf Hermann
cb70c38ca2 QmlProfiler: Actually update the details when rewriter tells us to
Before, only the signal was sent. While we're at it, also disambiguate
the method and signal names.

Change-Id: Iafce9b06841d7faedfefdb0638d0fa1f60c061c1
Task-number: QTCREATORBUG-20500
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-31 07:13:56 +00:00
Ulf Hermann
5e66f834e3 QmlProfiler: Keep text marks when replaying events
The text marks are conceptually part of the type storage, not the event
storage. We need to hide them on initialize and show them again on
finalize, though, so that they get updated.

Task-number: QTCREATORBUG-20506
Change-Id: I5fe50110b99ea81b9a7585758a30fcad98bfcaa3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-30 07:49:38 +00:00
Ulf Hermann
6b9ff15ad5 QmlProfiler: Move action registration out of QmlProfilerTool
This enables us to have multiple QmlProfilerTool instances without
conflicting action registrations. Ultimately there should be a way to
unregister actions, or to add some extra description on which tool
instance they refer to, but this is a minimal first step.

The main problem this fixes for now is the warnings generated by the
tests.

Change-Id: I2193fc48a5a68c52f46e5567919f3035bc93df36
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-29 12:14:58 +00:00
Ulf Hermann
916883e70f Tracing: Move event storage out of trace manager
This is a step toward making the trace manager non-virtual. It should
just juggle the storages for types and events, and manage the threads to
access them. It doesn't need to know what exactly it stores.

Change-Id: I45093c60d8ae921e68aeb09bd48d24d5877ce306
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 16:26:55 +00:00
Ulf Hermann
6e0373adb3 Tracing: Move the type storage out of the trace manager
When we replay events we want to keep this constant and pass it to the
event receivers as separate entity. This way we can move the replaying
to a separate thread.

When loading we will have a similar situation, but then the loading
thread will create a new type storage and later assign that to the trace
manager.

Change-Id: I11402ed1e0663da6da5b61b15bba40e1a62adc4b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 16:11:25 +00:00
Ulf Hermann
95d7be1b28 Tracing: Generalize event filtering
This allows us to not only filter by ranges, but potentially also by
other criteria.

Change-Id: I7349ceeabbb2781473a3a4c803dab1006b7b8e50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 14:13:43 +00:00
Ulf Hermann
7e9b6f62c6 Tracing: Drop restricted start/end times from trace manager
The only thing we need is a flag for QML profiler to decide if it should
show the "full range" option.

Change-Id: I2437c44c2443d9389239e9af79d0672ee1cadbd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 14:04:39 +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
1770c2ffe2 Remove TimelineTraceManager::State
This is redundant, now that we have registerFeatures().

Change-Id: Ia56c28b8892ab6da694570fe4b9ea5c96fe194f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-23 14:20:16 +00:00
Ulf Hermann
08ca10de81 QmlProfiler: Rename specific replayEvents to replayQmlEvents
Some compilers cannot discern the two replayEvents methods.

Change-Id: Ide4a893ff3976cb081fbbceefacafb6226f0a73f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 11:21:59 +00:00
Ulf Hermann
1c2e0f387f QmlProfiler: Move parts of model manager and trace file to Timeline
This way we can use the trace file loading and saving mechanism for
other profilers.

Change-Id: I98ec1cdde6f7abcea152cabf72e64d4e696dfa59
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-19 08:09:07 +00:00
Ulf Hermann
780d4c6a43 Timeline: Move modelId generation into aggregator
The way the notes model works requires every timeline model to have a
different ID. Conversely no other kind of model actually needs an ID.
Therefore it makes sense to have the TimelineModelAggregator manage the
IDs as every timeline model will sooner or later be associated with an
aggregator.

Change-Id: Ib8b2c88ed883351d4e3e156dd13e1dd113c21808
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 14:11:51 +00:00
Ulf Hermann
dcd8d37f35 QmlProfiler: Don't expose the vector of event types
We always want either the total number of event types or one specific
type. There is no need to expose the fact that we keep them as a vector.

Also, use int as the type of the "number" methods as that aligns better
with Qt containers, and rename the methods. We don't need to state the
fact that we've loaded the events and types at some point.

Change-Id: Iaf680ec9fa10e1070ddee6bcc079800e401775f0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:20:57 +00:00
Ulf Hermann
7ca958fa85 QmlProfiler: Integrate TraceTime into ModelManager
We never use it independently and only a subset of its interface needs
to be public.

Change-Id: I97bbc638270bcbb8fb1a4097fcfeacf37e96c048
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:17:23 +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
e0ba6f91ce Timeline: Add stash() and restore() methods to notes model
Those are needed when manipulating the model in a way that may change
the indices, like restricting to a range or filtering by categories.

Change-Id: I9f218d269cf23104c306960ef77c0fc41591daa1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:14:09 +00:00
Ulf Hermann
1ccd058bdf QmlProfiler: Get rid of processing step
The child models are made aware of possible changes in the details
strings, and in turn, we can do the finalization immediately after
acquiring is done.

Change-Id: Ibe57f158e64e5d01d4c97aa617c9b2bcc8e4e96e
Task-number: QTCREATORBUG-20106
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:13:04 +00:00
Marco Benelli
b9d72a5737 qmljs: remove remaining references to QtQuick1
This patch removes all references to QtQuick1 in qml library,
plugin, designer, profiler and tests.

Change-Id: Ie286fad96060299caae3ef328330597cf53e90d3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-03 14:40:30 +00:00
Eike Ziller
cff2cc90e2 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.h
	src/plugins/cpptools/compileroptionsbuilder.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.h
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.h
	src/shared/qbs

Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
2018-01-09 13:13:00 +01:00
Ulf Hermann
4a5bd323a9 QmlProfiler: Retain event types between sessions on same connection
The server won't re-send the event types. We need to keep them until the
connection goes away. Otherwise we get invalid event types and soft
asserts when trying to look up event types for new events. Also, when
clearing the event types, also clear the server type IDs. Not clearing
those constitutes a memory leak.

Change-Id: I564b0c4cf0ed754549d2b8ede63c97fa01affcec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-03 13:51:47 +00:00
Ulf Hermann
38d00cc8b6 QmlProfiler: Use a Target for populateFileFinder()
The RunConfiguration we were using previously only served to retrieve a
target.

Change-Id: I30628197de3025511a03a53d3119083b980762c8
Reviewed-by: hjk <hjk@qt.io>
2017-09-27 14:22:49 +00:00
Ulf Hermann
9cdb0ec22e QmlProfiler: Don't trust in externally provided timestamps
We might get timestamps that are outside the trace time, negative
timestamps, ranges that go backwards, and other insane things.

In order to deal with this, we clamp all negative timestamps to 0, and
treat the specified trace time as minimum range, that can be overridden
by events.

Change-Id: Iba661f2a4346077871fc62a46759e169b2aad49d
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2017-09-12 14:25:01 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Ulf Hermann
6a626595dc QmlProfiler: Rename QmlProfilerDetailsRewriter::clearRequests to clear
It also clears the lookup cache.

Change-Id: I9fdd9136084a17f427336d6ce2d37d724b9b20d2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-15 13:37:59 +00:00
hjk
76185b3b09 QmlProfiler: Convert to a RunWorker based setup
This also re-enables the remote linux case and enables
the recording of a single run of events.

Change-Id: I9ea55017c8e5f2f17e6f32c5453df48093e41931
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-30 08:57:08 +00:00
Ulf Hermann
6e5d7e54db QmlProfiler: Use a ranged for loop in QmlProfilerModelManager::dispatch
Change-Id: I852bb4935b529953e677791d32d17c886f22bffd
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2017-03-31 08:32:30 +00:00
Ulf Hermann
0683281b7b QmlProfiler: Load notes data only after models are available
Change-Id: I1ee13c842a07962d9aec93aaab6959614d7d8a08
Task-number: QTCREATORBUG-17936
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-03-29 15:05:59 +00:00
Orgad Shaneh
da7cb91446 Merge remote-tracking branch 'origin/4.2' into 4.3
Change-Id: I4931dcc81be872d7712e67123e94d15ee696459f
2017-03-14 16:20:14 +02:00
Samuel Gaist
4033471aa9 QRegExp include cleanup
This patch adds the missing include statements for QRegExp.

Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-13 22:05:30 +00:00
Robert Loehning
e6fd203b76 QmlProfiler: Initialize members inside class
Change-Id: I8154dad0eef9e11650e257b46840c295cf5e0624
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-28 12:57:20 +00:00
Ulf Hermann
c84f650fb2 QmlProfiler: Integrate QmlProfilerDataModel into model manager
There is no need to keep them separate as the data model is not
accessed from the outside anymore. This removes a lot of indirection.

Change-Id: I91da4dfa816295300c8cfcca22430d5c5b3298c0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-24 11:55:53 +00:00
Ulf Hermann
78daf47a25 QmlProfiler: Remove references to QmlProfilerDataModel
We keep it private to QmlProfilerModelManager and proxy the last few
methods that were directly called on the model. This enables us to
remove the QmlProfilerDataModel class by integrating what is left of it
into QmlProfilerModelManagerPrivate in a next step.

Change-Id: Ie9b4e03fb286e5a0040374d00b7b26f810426278
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-24 11:55:45 +00:00
Ulf Hermann
bf69eb9467 QmlProfiler: Guard against the temporary trace file going away
If we cannot open a temporary file to cache a trace or retrieve a
previously cached trace, the QML profiler won't work correctly. Show
an error in this case.

Change-Id: I468d74d9c33033b9ad19501bccbd69a9fe164fed
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-24 11:55:16 +00:00
Ulf Hermann
1ee8d0fb64 QmlProfiler: Improve error and progress handling for loading and saving
* Clear the trace and send the loadingFinished() signal when loading
  fails or is canceled. loadingFinished() re-enables the UI, which is
  in fact important.

* Check more consistently for whether the operation was canceled and
  add a separate signal for that.

* When saving fails or is canceled, remove the half-written file.

* Don't try to guess the number of events for progress reporting when
  saving. Use the event timestamps and start/end time instead.

* Properly initialize the progress range in all cases.

* Drop the bool return value from the load methods. Nobody uses that.

* Send loadFinished() only after loading a file, not every time we
  reach the Done state.

Change-Id: I507f11c667e20534ea335e84798de11aa06fb6f2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-24 11:55:10 +00:00
Ulf Hermann
548a86f577 QmlProfiler: Add text marks for QML/JS types into documents
The text marks are little labels next to the lines in the editor
that tell you how much of total run time was spent in the
respective QML/JS construct during the last profiling session.
This is similar to what the valgrind profiler does.

We add the text marks only when the documents are loaded into an
editor. This keeps the number of text marks manageable. Multiple
events on a single line are shown using a tooltip.

Task-number: QTCREATORBUG-17757
Change-Id: Ie38b8ab880a718a1ef72ef343d84070ab34bc5bc
Reviewed-by: hjk <hjk@qt.io>
2017-02-21 10:43:47 +00:00
Ulf Hermann
827d48db6e QmlProfiler: Move the file finder into the QML model
This is the place where we need it most. In addition, this allows us to
use the DetailsRewriter's cache also on gotoSourceLocation.

Change-Id: I14e0f11ba7c8a2a3888b2e8439a375068b36e29a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-15 12:38:30 +00:00
Ulf Hermann
5dd25c42cb QmlProfiler: Move event handling into model manager
This is the logical place to do it. Adding the event first to the QML
model and then passing it back to the manager in order to have it
dispatched to the other models is somewhat backwards.

Change-Id: I64b1cb38f97331b62d83fa5ae49b9b2690810d40
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-15 12:38:21 +00:00
Ulf Hermann
aaca50f705 QmlProfiler: Send loaded events in batches of about 1024
This significantly reduces the number of signals necessary when
loading traces. The overhead of queueing those signals across threads
was responsible for up to 80% of the time required to load a trace.

Change-Id: I461a2ef9944b0be102a29f8ed6b2b3f2f59f3c0f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-09 11:54:57 +00:00