return f;
}
+static void
+dd_dump_dmesg(FILE *f)
+{
+ char line[2000];
+ FILE *p = popen("dmesg | tail -n60", "r");
+
+ if (!p)
+ return;
+
+ fprintf(f, "\nLast 60 lines of dmesg:\n\n");
+ while (fgets(line, sizeof(line), p))
+ fputs(line, f);
+
+ fclose(p);
+}
+
static void
dd_close_file_stream(FILE *f)
{
}
static void
-dd_dump_call(struct dd_context *dctx, struct dd_call *call, unsigned flags)
+dd_dump_call(struct dd_context *dctx, struct dd_call *call, unsigned flags,
+ bool dump_dmesg)
{
FILE *f = dd_get_file_stream(dd_screen(dctx->base.screen),
dctx->apitrace_call_number);
}
dd_dump_driver_state(dctx, f, flags);
+ if (dump_dmesg)
+ dd_dump_dmesg(f);
dd_close_file_stream(f);
}
PIPE_DUMP_CURRENT_STATES |
PIPE_DUMP_CURRENT_SHADERS |
PIPE_DUMP_LAST_COMMAND_BUFFER);
+ dd_dump_dmesg(f);
dd_close_file_stream(f);
}
PIPE_DUMP_DEVICE_STATUS_REGISTERS |
PIPE_DUMP_CURRENT_STATES |
PIPE_DUMP_CURRENT_SHADERS |
- PIPE_DUMP_LAST_COMMAND_BUFFER);
+ PIPE_DUMP_LAST_COMMAND_BUFFER,
+ true);
/* Terminate the process to prevent future hangs. */
dd_kill_process();
case DD_DUMP_ALL_CALLS:
if (!dscreen->no_flush)
pipe->flush(pipe, NULL, 0);
- dd_dump_call(dctx, call, 0);
+ dd_dump_call(dctx, call, 0, false);
break;
case DD_DUMP_APITRACE_CALL:
if (dscreen->apitrace_dump_call == dctx->apitrace_call_number) {
- dd_dump_call(dctx, call, 0);
+ dd_dump_call(dctx, call, 0, false);
/* No need to continue. */
exit(0);
}