[ubuntu-x] Xorg.0.log timestamps

Tormod Volden lists.tormod at gmail.com
Fri Feb 6 18:11:53 GMT 2009


On Fri, Feb 6, 2009 at 3:43 PM, Bryce Harrington <bryce at canonical.com> wrote:
> I've added a patch to add timestamping support to X (LP: #285787).
> I'm hoping this will be helpful for boottime optimization.  Might also
> be handy for post-startup debugging.
>
> If it causes too much log cruft we can consider dropping it for the
> actual release.
>
> Bryce

Great! This is something I have been missing a lot, but it was so
obvious that I though upstream had good reasons for not doing it.
Would be nice to get it upstream so that we don't have to carry our
own log format.

For automatic parsing of log files (I guess I am not the only one
playing with such things) it makes things a bit more complicated - for
backwards compatibility at least. I looked at your patch (did not test
yet):
 sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec);

Wouldn't it be better to have a fixed width for the seconds part as well:
 sprintf(tmpBuffer, "[%5d sec: %06d usec]", diff_sec , diff_usec);

or even adopt the format which the kernel is using, e.g. [   40.417275]:
 sprintf(tmpBuffer, "[%5d.%06d]", diff_sec , diff_usec);

Tormod



More information about the Ubuntu-x mailing list