} \
}
+FILE *pandecode_dump_stream;
+
/* Semantic logging type.
*
* Raw: for raw messages to be printed as is.
pandecode_make_indent(void)
{
for (unsigned i = 0; i < pandecode_indent; ++i)
- printf(" ");
+ fprintf(pandecode_dump_stream, " ");
}
static void
pandecode_make_indent();
if (type == PANDECODE_MESSAGE)
- printf("// ");
+ fprintf(pandecode_dump_stream, "// ");
else if (type == PANDECODE_PROPERTY)
- printf(".");
+ fprintf(pandecode_dump_stream, ".");
va_start(ap, format);
- vprintf(format, ap);
+ vfprintf(pandecode_dump_stream, format, ap);
va_end(ap);
if (type == PANDECODE_PROPERTY)
- printf(",\n");
+ fprintf(pandecode_dump_stream, ",\n");
}
static void
va_list ap;
va_start(ap, format);
- vprintf(format, ap);
+ vfprintf(pandecode_dump_stream, format, ap);
va_end(ap);
}
pandecode_prop("zero4 = 0x%" PRIx32, s->zero4);
pandecode_prop("zero5 = 0x%" PRIx32, s->zero5);
- printf(".zero3 = {");
+ pandecode_log_cont(".zero3 = {");
for (int i = 0; i < sizeof(s->zero3) / sizeof(s->zero3[0]); ++i)
- printf("%X, ", s->zero3[i]);
+ pandecode_log_cont("%X, ", s->zero3[i]);
- printf("},\n");
+ pandecode_log_cont("},\n");
- printf(".zero6 = {");
+ pandecode_log_cont(".zero6 = {");
for (int i = 0; i < sizeof(s->zero6) / sizeof(s->zero6[0]); ++i)
- printf("%X, ", s->zero6[i]);
+ pandecode_log_cont("%X, ", s->zero6[i]);
- printf("},\n");
+ pandecode_log_cont("},\n");
return info;
}
pandecode_log(".unknown%d = {", name);
for (int i = 0; i < count; ++i)
- printf("%X, ", slide[i]);
+ pandecode_log_cont("%X, ", slide[i]);
pandecode_log("},\n");
}
SHORT_SLIDE(1);
pandecode_indent--;
- printf("},\n");
+ pandecode_log_cont("},\n");
}
/* Extracts the number of components associated with a Mali format */
/* Print some boilerplate to clearly denote the assembly (which doesn't
* obey indentation rules), and actually do the disassembly! */
- printf("\n\n");
+ pandecode_log_cont("\n\n");
struct midgard_disasm_stats stats;
if (is_bifrost) {
- disassemble_bifrost(stdout, code, sz, false);
+ disassemble_bifrost(pandecode_dump_stream, code, sz, false);
/* TODO: Extend stats to Bifrost */
stats.texture_count = -128;
stats.quadword_count = 0;
stats.helper_invocations = false;
} else {
- stats = disassemble_midgard(stdout, code, sz, gpu_id,
+ stats = disassemble_midgard(pandecode_dump_stream,
+ code, sz, gpu_id,
type == JOB_TYPE_TILER ?
MESA_SHADER_FRAGMENT : MESA_SHADER_VERTEX);
}
(stats.work_count <= 8) ? 2 :
1;
- printf("shader%d - MESA_SHADER_%s shader: "
+ pandecode_log_cont("shader%d - MESA_SHADER_%s shader: "
"%u inst, %u bundles, %u quadwords, "
"%u registers, %u threads, 0 loops, 0:0 spills:fills\n\n\n",
shader_id++,