diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/guest-diag/nvkmstrace.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/guest-diag/nvkmstrace.c b/tools/guest-diag/nvkmstrace.c index 411de6b..ca72e46 100644 --- a/tools/guest-diag/nvkmstrace.c +++ b/tools/guest-diag/nvkmstrace.c @@ -3,6 +3,7 @@ #include <stdio.h> #include <stdarg.h> #include <stdint.h> +#include <string.h> #include <dlfcn.h> #include <sys/ioctl.h> @@ -36,10 +37,24 @@ int ioctl(int fd, unsigned long req, ...) if (p->address && p->size) { unsigned char *q = (unsigned char *)(uintptr_t)p->address; unsigned n = p->size < 64 ? p->size : 64, i; + fprintf(stderr, " data:"); for (i = 0; i < n; i++) fprintf(stderr, " %02x", q[i]); fprintf(stderr, "\n"); + if (p->size >= 700) { + /* reply.status candidates: request = 32 + 4 + + * 4*1 (NvBool=NvU8) + 16*(32+4) = 616 bytes */ + unsigned o; + + for (o = 600; o <= 700; o += 4) { + unsigned v; + memcpy(&v, q + o, 4); + if (v <= 16) + fprintf(stderr, " small@%u=%u\n", + o, v); + } + } } return rc; } |
