diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-09-03 19:28:35 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@digia.com> | 2014-09-11 11:41:27 +0200 |
commit | 1de6e7b8e0ee465f642e1b2f5a14611e52a7e8c2 (patch) | |
tree | 3ac952d6e7539c0fda1fe3c9cd7f16ace849c91a /src/qml/jsruntime/qv4profiling_p.h | |
parent | 85627c26afb087975fe2e57f91837c9314d54ba7 (diff) |
Select specific features to be recorded when profiling QML
Some features, like the memory profiler, create huge amounts of data.
Often enough, we're not actually interested in all the data available
from the profiler and collecting it all can lead to excessive memory
consumption. This change enables us to optionally turn various aspects
of QML profiling off.
Task-number: QTBUG-41118
Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/qml/jsruntime/qv4profiling_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4profiling_p.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h index f115137c86..8224f8a851 100644 --- a/src/qml/jsruntime/qv4profiling_p.h +++ b/src/qml/jsruntime/qv4profiling_p.h @@ -46,6 +46,11 @@ namespace QV4 { namespace Profiling { +enum Features { + FeatureFunctionCall, + FeatureMemoryAllocation +}; + enum MemoryType { HeapPage, LargeItem, @@ -106,15 +111,18 @@ private: }; #define Q_V4_PROFILE_ALLOC(engine, size, type)\ - (engine->profiler && engine->profiler->enabled ?\ + (engine->profiler &&\ + (engine->profiler->featuresEnabled & (1 << Profiling::FeatureMemoryAllocation)) ?\ engine->profiler->trackAlloc(size, type) : size) #define Q_V4_PROFILE_DEALLOC(engine, pointer, size, type) \ - (engine->profiler && engine->profiler->enabled ?\ + (engine->profiler &&\ + (engine->profiler->featuresEnabled & (1 << Profiling::FeatureMemoryAllocation)) ?\ engine->profiler->trackDealloc(pointer, size, type) : pointer) #define Q_V4_PROFILE(engine, ctx, function)\ - ((engine->profiler && engine->profiler->enabled) ?\ + (engine->profiler &&\ + (engine->profiler->featuresEnabled & (1 << Profiling::FeatureFunctionCall)) ?\ Profiling::FunctionCallProfiler::profileCall(engine->profiler, ctx, function) :\ function->code(ctx, function->codeData)) @@ -138,11 +146,11 @@ public: return pointer; } - bool enabled; + quint64 featuresEnabled; public slots: void stopProfiling(); - void startProfiling(); + void startProfiling(quint64 features); void reportData(); void setTimer(const QElapsedTimer &timer) { m_timer = timer; } |