summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/sdl_cap.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/guest-diag/sdl_cap.c')
-rw-r--r--tools/guest-diag/sdl_cap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/guest-diag/sdl_cap.c b/tools/guest-diag/sdl_cap.c
index 23c83ab..5b9c096 100644
--- a/tools/guest-diag/sdl_cap.c
+++ b/tools/guest-diag/sdl_cap.c
@@ -87,10 +87,12 @@ __attribute__((constructor)) static void cap_init(void)
if (h)
real_glReadPixels = dlsym(h, "glReadPixels");
}
- fprintf(stderr, "[gzcap] init path=%s present=%p updwin=%p swap=%p read=%p gros=%p\n",
- p, (void *)real_RenderPresent, (void *)real_UpdateWindowSurface,
+ fprintf(stderr, "[gzcap] init pid=%d path=%s present=%p updwin=%p swap=%p read=%p gros=%p\n",
+ (int)getpid(), p, (void *)real_RenderPresent, (void *)real_UpdateWindowSurface,
(void *)real_GL_SwapWindow, (void *)real_RenderReadPixels,
(void *)real_GetRendererOutputSize, (void *)real_glReadPixels);
+ if (!real_glReadPixels && !real_RenderReadPixels)
+ return;
cap_fp = fopen(p, "wb");
if (!cap_fp)
return;
@@ -192,7 +194,9 @@ void SDL_GL_SwapWindow(SDL_Window *win)
static size_t gbufsz;
if (!hit++)
- fprintf(stderr, "[gzcap] hook GLSwapWindow\n");
+ fprintf(stderr, "[gzcap] hook GLSwapWindow pid=%d fp=%p read=%p gros=%p\n",
+ (int)getpid(), (void *)cap_fp, (void *)real_glReadPixels,
+ (void *)real_GL_GetDrawableSize);
if (cap_fp && !cap_stop && real_glReadPixels && real_GL_GetDrawableSize) {
int w = 0, h = 0;