dbus-latency: make it work 53/265453/3
authorAdrian Szyndela <adrian.s@samsung.com>
Tue, 19 Oct 2021 14:25:56 +0000 (16:25 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Tue, 23 Nov 2021 16:12:19 +0000 (17:12 +0100)
commit0ad095bb0ed8b3b92c536cc5b1eb96296f6fde23
treeca4ba3aa001a310c74add48436a07f4c971e0289
parent6cabe42a9cb9e42819d85c9c03d1d1f68139aaf5
dbus-latency: make it work

Apparently, dbus-latency was measuring something, but it was definitely
NOT latency.

This commit fixes numerous bugs and misdesigned parts:
- enums are 32-bit also on 64-bit platforms;
- uprobes for gio were set on g_dbus_message_lock, which is called
  not only during sending and receiving messages, but also in other cases;
  now, there are two uprobes for glib: one for sending, one for receiving;
- uprobes for libdbus were set on _dbus_connection_message_sent_unlocked()
  which is called _after_ sending and dbus_connection_dispatch() which
  is not called for replies at all;
- intervals were mislabeled as "ms" instead of "us";
- dbus-daemon sends and receives messages with the same set of functions
  as libdbus clients; if measuring starts on sending and ends on receiving
  it was only a half of the job when we counted dbus-daemon; it is now excluded
- lots of messages were lost, for examples some signals could be never received;
  this clogged up the maps up to 10240 elements, and then measuring stopped;
  we only count method calls now;
- message about Ctrl-C was issued too soon, even before compiling; now, it is
  in the waiting loop.

This part still needs fixing:
- identifying messages by their serial number. It works quite well with
  randomized serial numbers in the libraries;
- sd_bus is not supported.

Change-Id: Ibc42375402c0d832e95c9b10742443839092171e
src/cc/export/host32.h
src/cc/export/host64.h
src/cc/hostcompat/dbus/gio.h
src/cc/hostcompat/dbus/libdbus.h
tools/dbus-latency.c
tools/dbus-latency.py