Bug 98898 - dbus-monitor: optionally print monotonic timestamps in Linux kernel style
Summary: dbus-monitor: optionally print monotonic timestamps in Linux kernel style
Status: RESOLVED MOVED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: low enhancement
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-29 11:12 UTC by Mikhail Durnev
Modified: 2018-10-12 21:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Add timestamps to dbus-monitor logs (1.72 KB, patch)
2016-11-29 11:12 UTC, Mikhail Durnev
Details | Splinter Review

Description Mikhail Durnev 2016-11-29 11:12:48 UTC
Created attachment 128263 [details] [review]
Add timestamps to dbus-monitor logs

Dbus logs from IVI (In-Vehicle Infotainment) are difficult or impossible to fully analyse because they do not have timestamps.
Comment 1 Simon McVittie 2016-11-29 12:17:14 UTC
Your patch is not going to apply to dbus-monitor in git master (1.11.x), because that version already has timestamps in monitor mode (added during debugging on Bug #88896). The timestamps shown are currently wall-clock time (_dbus_get_real_time()). If you want to contribute a --monotonic-time option that switched them to use _dbus_get_monotonic_time(), I'd be happy to review that.

We do not add new features to the stable branch (1.10.x) because if we did, there would be no point in having a stable branch. If a particular feature is important to you, but the rest of the changes in the development branch are not, please backport the changes you want locally (or perhaps build a statically-linked copy of dbus-monitor 1.11.x and deploy it to the system under test).

dbus-monitor 1.11.x is also able to dump the D-Bus messages as a raw binary stream (using the D-Bus message framing), or with pcap framing (the same as tcpdump and Wireshark), if those are of interest to you. There is currently no standard tool (that I know of!) to read D-Bus messages from a raw or pcap stream and dump them in human-readable format, but if you wanted to contribute one (perhaps as a new "subcommand" in dbus-test-tool) I'd be happy to review patches.

print_message() in 1.11.x takes seconds and microseconds as parameters rather than fetching the real time itself, which means it could be used to print the message timings recorded in the pcap framing. I don't think pcap has the ability to record monotonic times, unfortunately.
Comment 2 Mikhail Durnev 2016-11-30 09:17:29 UTC
Thank you very much for your response, Simon. We are still using 1.8. Our timestamps format is recognized by the internal tool which we use for tracking. We will discuss internally whether we need any additional changes in 1.11.x for our future applications.
Comment 3 Simon McVittie 2017-02-24 20:03:30 UTC
(In reply to Mikhail Durnev from comment #2)
> Our
> timestamps format is recognized by the internal tool which we use for
> tracking.

Monotonic timestamps printed as seconds.microseconds in square brackets seem to be fairly common (for instance in Linux dmesg), so if we had the feature of printing monotonic time, that would seem a sensible way to print them. I'd be happy to review a patch against master for this.

We don't add features to stable-branches, and there are some nearby changes in master already that would cause a dependency, so it would have to be master; if you're using stable-branches in production (which is a good idea of course!) and you want a more featureful dbus-monitor to debug them with, then I'd suggest using a statically linked dbus-monitor 1.11.x.

Retitling the bug on the assumption that this is the relevant difference between what's in 1.11 and what you proposed.
Comment 4 GitLab Migration User 2018-10-12 21:29:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/161.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.