chiark / gitweb /
sd-event: instrument sd_event_run() for profiling delays
authorVito Caputo <vcaputo@gnugeneration.com>
Mon, 7 Dec 2015 19:28:18 +0000 (11:28 -0800)
committerSven Eden <yamakuzure@gmx.net>
Wed, 17 May 2017 13:22:14 +0000 (15:22 +0200)
commit9570dec98aff9489c9323683061cec93bb92d654
tree8228295829aaf4088a387c37641e84bbbcfff963
parent5f6ccb514798532d84fa6164d4358d066ccdfdd0
sd-event: instrument sd_event_run() for profiling delays

Set SD_EVENT_PROFILE_DELAYS to activate accounting and periodic logging
of the distribution of delays between sd_event_run() calls.

Time spent in dispatching as well as time spent outside of
sd_event_run() is measured and accounted for.  Every 5 seconds a
logarithmic histogram loop iteration delays since 5 seconds previous is
logged.

This is useful in identifying the frequency and magnitude of latencies
affecting the event loop, which should be kept to a minimum.
src/libelogind/sd-event/sd-event.c