[Xcb] Can't find source code for a function

Peter Harris pharris at opentext.com
Tue Nov 5 16:34:23 CET 2013

On 2013-11-04 22:03, Jiergir Ogoerg wrote:
> The xcb function xcb_randr_get_screen_info_reply(...)
> takes about 40% of a warm startup of a Qt5 app, I wanted to check
> out what exactly it does but I can't find it in the xcb source code.
> Can anyone please paste it or tell me where to find it?

After installing xcb/proto, download xcb/libxcb and run "make" to
generate src/randr.c which will contain this function.

There's no real need, though, since all the xcb_*_reply() functions do
the same thing: "return (cast to correct pointer) xcb_wait_for_reply()".

If xcb_randr_get_screen_info_reply is taking 40% of the time, there are
one (or more) of two things going on:

1) Qt has issued all of its requests, and this is the first one it waits
for the reply to. Your profiler isn't correctly attributing the network
round-trip time to xcb_wait_for_reply (and probably mostly select/poll,
although there's some bookkeeping in there too). The rest of the replies
appear fast because they arrive at the same time as the
xcb_randr_get_screen_info_reply does. If you delete the call to
xcb_randr_get_screen_info_reply, the round-trip time will be attributed
to the next xcb_*_reply call.


2) Qt is calling xcb_randr_get_screen_info(_reply) more than once, and
it really shouldn't (modulo subsequent RandR events).

Peter Harris
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866

More information about the Xcb mailing list