Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

demmt: extract chipset id from file name

  • Loading branch information...
commit 1a3556ae18800691b2c68e267d0c495d6f88e431 1 parent 94c2345
@mslusarz mslusarz authored
Showing with 13 additions and 4 deletions.
  1. +13 −4 rnn/demmt.c
View
17 rnn/demmt.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
+#include <libgen.h>
#include "mmt_bin_decode.h"
#include "mmt_bin_decode_nvidia.h"
@@ -1235,15 +1236,17 @@ static void usage()
{
fprintf(stderr, "Usage: demmt [OPTION]\n"
"Decodes binary trace files generated by Valgrind MMT. Reads standard input or file passed by -l.\n\n"
- " -m 'chipset'\tset chipset version (required)\n"
+ " -l file\tuse \"file\" as input\n"
+ " \t- it can be compressed by gzip, bzip2 or xz\n"
+ " \t- demmt extracts chipset version from characters following \"nv\"\n"
+ " -m 'chipset'\tset chipset version (required, but see -l)\n"
+ " -q\t\t(quiet) print only the most important data (pushbufs from IB / USER, disassembled code, TSCs, TICs, etc)\n"
+ " -c\t\tenable colors\n"
" -f\t\tfind possible pushbuf pointers (IB / USER)\n"
" -n id\t\tset pushbuf pointer to \"id\"\n"
" -g\t\tprint gpu addresses\n"
" -o\t\tdump ioctl data\n"
- " -q\t\t(quiet) print only the most important data (pushbufs from IB / USER, disassembled code, TSCs, TICs, etc)\n"
" -a\t\tdisable decoding of object state (shader disassembly, TSCs, TICs, etc)\n"
- " -c\t\tenable colors\n"
- " -l file\tuse \"file\" as input (can be compressed by gzip / bzip2 / xz)\n"
" -t\t\tdeindent logs\n"
" -x\t\tforce pushbuf decoding even without pushbuf pointer\n"
"\n"
@@ -1304,6 +1307,12 @@ int main(int argc, char *argv[])
if (i + 1 >= argc)
usage();
filename = argv[++i];
+ const char *base = basename(argv[i]);
+ if (chipset == 0 && strncasecmp(base, "nv", 2) == 0)
+ {
+ chipset = strtoul(base + 2, NULL, 16);
+ fprintf(stdout, "Chipset: NV%02X\n", chipset);
+ }
}
else if (!strcmp(argv[i], "-t"))
indent_logs = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.