diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-12-14 20:04:47 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-01-04 08:44:23 +0000 |
commit | 529b4484e558376598b5bf12a3cfae6fd3969827 (patch) | |
tree | 13e736d73b83b6d018aaa9d2f36659668befc50e /src/qml/debugger | |
parent | 8836896dff45fe1d21736835845e36d03763117f (diff) |
Qml Profiling: Track signals globally
Previously they were tracked per object sending them. This is not only
too much overhead, but also confusing.
Task-number: QTBUG-65190
Change-Id: I4c374f2c3794a19cd825e8681d189107cef23813
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/debugger')
-rw-r--r-- | src/qml/debugger/qqmlprofiler_p.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h index 88f8e94f25..b69a6e7a59 100644 --- a/src/qml/debugger/qqmlprofiler_p.h +++ b/src/qml/debugger/qqmlprofiler_p.h @@ -234,9 +234,10 @@ public: { // Use the QV4::Function as ID, as that is common among different instances of the same // component. QQmlBinding is per instance. - // Add 1 to the ID, to make it different from the IDs the V4 profiler produces. The +1 makes - // the pointer point into the middle of the QV4::Function. Thus it still points to valid - // memory but we cannot accidentally create a duplicate key from another object. + // Add 1 to the ID, to make it different from the IDs the V4 and signal handling profilers + // produce. The +1 makes the pointer point into the middle of the QV4::Function. Thus it + // still points to valid memory but we cannot accidentally create a duplicate key from + // another object. quintptr locationId(id(function) + 1); m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), (1 << RangeStart | 1 << RangeLocation), Binding, @@ -263,7 +264,12 @@ public: void startHandlingSignal(QQmlBoundSignalExpression *expression) { - quintptr locationId(id(expression)); + // Use the QV4::Function as ID, as that is common among different instances of the same + // component. QQmlBoundSignalExpression is per instance. + // Add 2 to the ID, to make it different from the IDs the V4 and binding profilers produce. + // The +2 makes the pointer point into the middle of the QV4::Function. Thus it still points + // to valid memory but we cannot accidentally create a duplicate key from another object. + quintptr locationId(id(expression->function()) + 2); m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), (1 << RangeStart | 1 << RangeLocation), HandlingSignal, locationId)); |