aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorAndreas Baierl <[email protected]>2019-10-17 12:21:13 +0200
committerVasily Khoruzhick <[email protected]>2019-11-17 05:39:17 +0000
commitc76eb7ea8490e630451beb056b4294fd846902d2 (patch)
tree1098ae465dc6a216f2e1faf707dd6ad12e57b1a2 /src/gallium
parent3b3494174daffabfdf90306652622e6fbba0c94e (diff)
lima: Beautify stream dumps
Change the dump, that the output looks more like the output of mali-syscall-tracker [1]. This is a preparation for a more detailed stream analysis. Reviewed-by: Qiang Yu <[email protected]> Signed-off-by: Andreas Baierl <[email protected]> [1]: https://gitlab.freedesktop.org/lima/mali-syscall-tracker
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/lima/lima_util.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/drivers/lima/lima_util.c b/src/gallium/drivers/lima/lima_util.c
index 9e1cdf646b9..579eba7ec3d 100644
--- a/src/gallium/drivers/lima/lima_util.c
+++ b/src/gallium/drivers/lima/lima_util.c
@@ -51,18 +51,22 @@ bool lima_get_absolute_timeout(uint64_t *timeout)
void lima_dump_blob(FILE *fp, void *data, int size, bool is_float)
{
+ fprintf(fp, "{\n");
for (int i = 0; i * 4 < size; i++) {
- if (i % 4 == 0) {
- if (i) fprintf(fp, "\n");
- fprintf(fp, "%04x:", i * 4);
- }
+ if (i % 4 == 0)
+ fprintf(fp, "\t");
if (is_float)
- fprintf(fp, " %f", ((float *)data)[i]);
+ fprintf(fp, "%f, ", ((float *)data)[i]);
else
- fprintf(fp, " 0x%08x", ((uint32_t *)data)[i]);
+ fprintf(fp, "0x%08x, ", ((uint32_t *)data)[i]);
+
+ if ((i % 4 == 3) || (i == size / 4 - 1)) {
+ fprintf(fp, "/* 0x%08x */", (i - 3) * 4);
+ if (i) fprintf(fp, "\n");
+ }
}
- fprintf(fp, "\n");
+ fprintf(fp, "}\n");
}
void