[RFC weston 0/9] weston-debug protocol, API, and tool

Pekka Paalanen ppaalanen at gmail.com
Sat Jun 3 11:57:02 UTC 2017


From: Pekka Paalanen <pq at iki.fi>

Hi,

this is a little something I wrote while being stuck off-line in a hot place
and not having to care about anyone's priorities one bit.

Debug printing has usually been ad hoc weston_log() or even fprintf() calls,
often guarded by #ifdefs which require recompiling if you want to enable them.
Once enabled, you needed to recompile again to disable them. That works for
developers somewhat, but becomes a PITA when you need a user to get you that
debug information. I have experienced that particularly with XWM debugs.

Here's an alternative proposal: let a Wayland client give Weston an open file
descriptor, and Weston will write the debug prints into it on demand. Of
course, this is a risky move, and should not usually be allowed - I added a
command line option to control it.

As we have different things to debug, and just enabling everything would be a
massive flood, let's introduce "debug scopes" to, well, give some scope to the
prints. A client can subsribe to any number of scopes, and only those it is
interested in.

This patch series adds the protocol extension, the libweston implementation,
Weston command line option to enable it all, and a command line tool to
subscribe to the debug messages.

This patch series also adds debug scopes for XWM, Weston logs, and Wayland
protocol dumps. We could add a lot more, too: window manager actions, input
events, KMS debugging, timeline/wesgr, etc.

This is an RFC because it is still missing some bits I noted in the commit
messages, but I wanted to send it out now because I have no idea when I might
be able to finish it. If someone else wants to take over, that would be cool.


Thanks,
pq

Pekka Paalanen (9):
  protocol: add weston-debug.xml
  libweston: add weston_debug API and implementation
  compositor: add option to enable weston_debug
  clients: add weston-debug WIP
  compositor: offer logs via weston-debug
  xwm: dump_property() to use FILE internally
  xwm: move FILE to the callers of dump_property()
  xwm: convert WM_DEBUG into a weston-debug scope
  compositor: protocol logger WIP

 Makefile.am               |  18 +-
 clients/weston-debug.c    | 378 +++++++++++++++++++++++
 compositor/main.c         |  77 +++++
 libweston/compositor.c    |   5 +
 libweston/compositor.h    |   8 +
 libweston/weston-debug.c  | 750 ++++++++++++++++++++++++++++++++++++++++++++++
 libweston/weston-debug.h  | 106 +++++++
 man/weston.man            |  15 +-
 protocol/weston-debug.xml | 128 ++++++++
 xwayland/launcher.c       |   7 +
 xwayland/selection.c      |  39 ++-
 xwayland/window-manager.c | 230 +++++++-------
 xwayland/xwayland.h       |   6 +-
 13 files changed, 1650 insertions(+), 117 deletions(-)
 create mode 100644 clients/weston-debug.c
 create mode 100644 libweston/weston-debug.c
 create mode 100644 libweston/weston-debug.h
 create mode 100644 protocol/weston-debug.xml

-- 
2.10.2



More information about the wayland-devel mailing list