https://bugs.kde.org/show_bug.cgi?id=433785

            Bug ID: 433785
           Summary: greeter constantly getting date time
           Product: kscreenlocker
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: greeter
          Assignee: plasma-b...@kde.org
          Reporter: sit...@kde.org
                CC: bhus...@gmail.com
  Target Milestone: ---

SUMMARY
The greeter (through the time dataengine) constantly polls the currentdatetime
even when that cannot possibly have changed because only a second passed but
the greeter only displays minute precision. On a desktop system that's not
really causing much. On the pinephone with plasma mobile it constantly consumes
almost 1% CPU with the associated power draw of that.

STEPS TO REPRODUCE
1. gdb or strace the greeter
2. watch QDateTime::currentDateTime

OBSERVED RESULT
time gets polled constantly

EXPECTED RESULT
time ought to only get polled once a minute +-

ADDITIONAL INFORMATION
Seeing as data engines are on their way out anyway it may be prudent to port
away from the engine and instead use a QTimer+QTime::currentTime directly.
Adjusting the interval after every timeout for the current delay. That way we'd
get to exactly one wake up per minute directly related to the then necessary
redraw of the time.

auto c = QTime::currentTime();
timer.setInterval(60000 - c.msec());

or something like that

Tracey from plamo for the record
#0  0x0000ffff8c948618 in __kernel_gettimeofday ()
#1  0x0000ffff8a4b2c94 in QDateTime::currentMSecsSinceEpoch() () at
/usr/lib/libQt5Core.so.5
#2  0x0000ffff8a4b32f0 in QDateTime::currentDateTime() () at
/usr/lib/libQt5Core.so.5
#3  0x0000ffff74ec8f90 in  () at
/usr/lib/qt/plugins/plasma/dataengine/plasma_engine_time.so
#4  0x0000ffff74ec7098 in  () at
/usr/lib/qt/plugins/plasma/dataengine/plasma_engine_time.so
#5  0x0000ffff7c127390 in  () at /usr/lib/libKF5Plasma.so.5
#6  0x0000ffff8a63cccc in  () at /usr/lib/libQt5Core.so.5
#7  0x0000ffff7c1230f8 in
Plasma::DataContainer::updateRequested(Plasma::DataContainer*) () at
/usr/lib/libKF5Plasma.so.5
#8  0x0000ffff7c130a9c in  () at /usr/lib/libKF5Plasma.so.5
#9  0x0000ffff8a630868 in QObject::event(QEvent*) () at
/usr/lib/libQt5Core.so.5
#10 0x0000ffff8a5f807c in QCoreApplication::notifyInternal2(QObject*, QEvent*)
() at /usr/lib/libQt5Core.so.5
#11 0x0000ffff8a664ad8 in QTimerInfoList::activateTimers() () at
/usr/lib/libQt5Core.so.5
#12 0x0000ffff8a665654 in  () at /usr/lib/libQt5Core.so.5
#13 0x0000ffff88731ce0 in g_main_context_dispatch () at
/usr/lib/libglib-2.0.so.0
#14 0x0000ffff887322c0 in  () at /usr/lib/libglib-2.0.so.0
c#15 0x0000ffff887323c4 in g_main_context_iteration () at
/usr/lib/libglib-2.0.so.0
#16 0x0000ffff8a665a08 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /usr/lib/libQt5Core.so.5
#17 0x0000ffff8a5f61d4 in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at
/usr/lib/libQt5Core.so.5
#18 0x0000ffff8a600900 in QCoreApplication::exec() () at
/usr/lib/libQt5Core.so.5
#19 0x0000aaaac94bb1d4 in  ()
#20 0x0000ffff89fba538 in __libc_start_main () at /usr/lib/libc.so.6
#21 0x0000aaaac94bb574 in _start (

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to