ANN: Wayland protocol dumper (wayland-tracker)

Puustinen, Ismo ismo.puustinen at intel.com
Tue Aug 5 07:28:07 PDT 2014


Hello List,

I wrote an application for dumping Wayland protocol messages as
suggested in [1], too. The protocol dumper is named wayland-tracker and
it's available here:

  https://github.com/01org/wayland-tracker

Wayland-tracker has capability to use XML files to understand and parse
the message content. The logging backend system is made to be flexible,
and at the moment there are three output modes: json, json_pretty and
binary.  Wayland-tracker has some small features which make the usage
easier, such as directing the application output to stderr and log data
to stdout by default. The log can also be printed directly to a file.

I think the differentiating feature in wayland-tracker is the JSON
output mode. The machine-readable JSON output can be fed to external
tools for automated analysis. The data can be used to count messages of
different types, search for warnings, do performance profiling, show it
in a GUI, etc. Also, I think that pretty-printed JSON does a nice (if
quite verbose) human-readable logging format.

For example, giving this command:

  wayland-tracker json_pretty -x wayland.xml -x xdg-shell.xml --
weston-terminal

will produce (many) JSON messages like this:

{
    "message": {
        "type": "Request",
        "name": "set_window_geometry",
        "interface": "xdg_surface",
        "arguments": [
            {
                "name": "x",
                "value": {
                    "type": "Int",
                    "value": 32
                }
            },
            {
                "name": "y",
                "value": {
                    "type": "Int",
                    "value": 32
                }
            },
            {
                "name": "width",
                "value": {
                    "type": "Int",
                    "value": 742
                }
            },
            {
                "name": "height",
                "value": {
                    "type": "Int",
                    "value": 427
                }
            }
        ]
    },
    "timestamp": "0.157951s"
}

Wayland-tracker is written in Haskell and C. The low-level message
sending/receiving code is adapted from Wayland library, but there is no
compilation or runtime dependency on the library. Wayland-tracker is
licensed with Wayland MIT license.

In the future I would like to have more logging backends. A "simple"
backend would be for logging of messages in one-line format (like
WAYLAND_DEBUG environment variable does). A "pcap" backend could maybe
use text2pcap tool to output log data in pcap format. Patches are more
than welcome!

I realize that wayland-tracker's name is unfortunately very close to
Boyan Ding's wayland-tracer, but I had settled on the name and done some
related paperwork before wayland-tracer was released. At least the names
are not the same, and I hope there isn't too much confusion. :-)

[1]
http://lists.freedesktop.org/archives/wayland-devel/2014-April/014121.html

-- 
Ismo Puustinen <ismo.puustinen at intel.com>



More information about the wayland-devel mailing list