debug: Print debug message when client wakes up
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 20 Oct 2011 19:05:11 +0000 (15:05 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 20 Oct 2011 19:05:11 +0000 (15:05 -0400)
This helps spot and remove extraneous round trips and context switches.

src/wayland-client.c

index de84698..efb7fe6 100644 (file)
@@ -450,6 +450,11 @@ wl_display_iterate(struct wl_display *display, uint32_t mask)
        }
 
        len = wl_connection_data(display->connection, mask);
+
+       if (wl_debug && (mask & WL_DISPLAY_READABLE))
+               fprintf(stderr,
+                       "[-----------] wakeup, read %d bytes\n", len);
+
        while (len > 0) {
                if (len < sizeof p)
                        break;