diff options
author | László Németh <laszlo.nemeth@collabora.com> | 2017-03-28 16:32:25 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-06-15 16:10:09 +0200 |
commit | 81413799eb4f38d62710b295268249307364000a (patch) | |
tree | 6468fba4268090a7623b10cd655cd41d43188e3d /toolkit | |
parent | 9863be5254fcce6b74da30b821e9263002e9ac71 (diff) |
comphelper: add a profiling API
Using the guard style ProfileZone aZone("foo").
Test macro:
Sub TimeLog
toolkit = createUnoService("com.sun.star.awt.Toolkit")
toolkit.startRecording()
toolkit.processEventsToIdle()
toolkit.stopRecording()
a = toolkit.getRecordingAndClear()
s = ""
For Each i in a
s = s + i + ", "
Next i
Print s
End Sub
Change-Id: Iceaf9143d0387c87e7936dc67eecbbf71ee8d74a
Reviewed-on: https://gerrit.libreoffice.org/38786
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 380abb76af30..92f94250794b 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -121,6 +121,7 @@ #include <tools/debug.hxx> #include <comphelper/processfactory.hxx> #include <toolkit/awt/scrollabledialog.hxx> +#include <comphelper/profilezone.hxx> #include "helper/unowrapper.hxx" @@ -222,6 +223,12 @@ public: virtual void SAL_CALL pause(sal_Int32 nMilliseconds) override; + virtual void SAL_CALL startRecording() override; + + virtual void SAL_CALL stopRecording() override; + + css::uno::Sequence< OUString > SAL_CALL getRecordingAndClear() override; + // css::awt::XToolkit css::uno::Reference< css::awt::XWindowPeer > SAL_CALL getDesktopWindow( ) override; css::awt::Rectangle SAL_CALL getWorkArea( ) override; @@ -1887,6 +1894,7 @@ void SAL_CALL VCLXToolkit::reschedule() void SAL_CALL VCLXToolkit::processEventsToIdle() { SolarMutexGuard aSolarGuard; + ::comphelper::ProfileZone aZone("processEvents"); Scheduler::ProcessEventsToIdle(); } @@ -1910,6 +1918,21 @@ void SAL_CALL VCLXToolkit::pause(sal_Int32 nMilliseconds) new Pause(nMilliseconds); } +void SAL_CALL VCLXToolkit::startRecording() +{ + ::comphelper::ProfileRecording::startRecording(); +} + +void SAL_CALL VCLXToolkit::stopRecording() +{ + ::comphelper::ProfileRecording::startRecording( false ); +} + +css::uno::Sequence< OUString > VCLXToolkit::getRecordingAndClear() +{ + return ::comphelper::ProfileRecording::getRecordingAndClear(); +} + // css:awt:XToolkitRobot void SAL_CALL VCLXToolkit::keyPress( const css::awt::KeyEvent & aKeyEvent ) |