[Xcb] [PATCH:xdpyinfo] Use xcb for -queryExt instead of a round-trip per extension

jamey at minilop.net jamey at minilop.net
Sun Oct 3 12:52:42 PDT 2010


Nice!

Reviewed-by: Jamey Sharp <jamey at minilop.net>

I have a few observations to make. I don't know that changing any of
these things would be an *improvement* but I'll note them anyway. :-)

The xcb_flush call isn't necessary: each call to get a reply ensures
that the corresponding request has already been flushed. In the
current implementation, the first call to xcb_query_extension_reply
here will cause all the requests to be flushed.

Variable-length arrays are a C99 feature, as I recall. Is that OK for
xdpyinfo? I'd probably just use malloc, or perhaps queue up a fixed
number of requests at a time?

The number of recv syscalls may be artificially high on Xlib's side
right now, due to a known bug where we usually call recv at least
twice per call to _XReply. Ignoring recv syscalls that returned EAGAIN
might be more informative. Measuring number of packets on a TCP-based
X socket might be even better?

Jamey


More information about the xorg-devel mailing list