[Mesa-dev] [PATCH 17/20] intel/error2aub: add a verbose option

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Sep 25 08:23:56 UTC 2018


Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/intel/tools/error2aub.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/intel/tools/error2aub.c b/src/intel/tools/error2aub.c
index 354e4e00924..2ad47010bdf 100644
--- a/src/intel/tools/error2aub.c
+++ b/src/intel/tools/error2aub.c
@@ -230,16 +230,17 @@ int
 main(int argc, char *argv[])
 {
    int i, c;
-   bool help = false;
+   bool help = false, verbose;
    char *out_filename = NULL, *in_filename = NULL;
    const struct option aubinator_opts[] = {
       { "help",       no_argument,       NULL,     'h' },
       { "output",     required_argument, NULL,     'o' },
+      { "verbose",    no_argument,       NULL,     'v' },
       { NULL,         0,                 NULL,     0 }
    };
 
    i = 0;
-   while ((c = getopt_long(argc, argv, "ho:", aubinator_opts, &i)) != -1) {
+   while ((c = getopt_long(argc, argv, "ho:v", aubinator_opts, &i)) != -1) {
       switch (c) {
       case 'h':
          help = true;
@@ -247,6 +248,9 @@ main(int argc, char *argv[])
       case 'o':
          out_filename = strdup(optarg);
          break;
+      case 'v':
+         verbose = true;
+         break;
       default:
          break;
       }
@@ -305,6 +309,8 @@ main(int argc, char *argv[])
 
          aub_file_init(&aub, aub_file,
                        NULL, pci_id, "error_state");
+         if (verbose)
+            aub.verbose_log_file = stdout;
          fail_if(!aub_use_execlists(&aub),
                  "%s currently only works on gen8+\n", argv[0]);
          continue;
@@ -422,6 +428,14 @@ main(int argc, char *argv[])
       }
    }
 
+   if (verbose) {
+      fprintf(stdout, "BOs found:\n");
+      list_for_each_entry(struct bo, bo_entry, &bo_list, link) {
+         fprintf(stdout, "\t type=%i addr=0x%016" PRIx64 " size=%" PRIu64 "\n",
+                 bo_entry->type, bo_entry->addr, bo_entry->size);
+      }
+   }
+
    /* Find the batch that trigger the hang */
    struct bo *batch_bo = NULL;
    list_for_each_entry(struct bo, bo_entry, &bo_list, link) {
-- 
2.19.0



More information about the mesa-dev mailing list