OSDN Git Service

intel: error_decode: add an option to decode all buffers
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 27 Mar 2018 17:10:45 +0000 (18:10 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 3 Apr 2018 15:55:53 +0000 (16:55 +0100)
The kernel reports workaround batch buffers, but we're not presenting
them currently. Also they might not be useful for debugging purely
userspace driver issues, when problems arise because of interactions
between kernel & userspace drivers, it's nice to be able to decode
them.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
src/intel/tools/aubinator_error_decode.c

index 9abd05f..0234c59 100644 (file)
@@ -51,6 +51,7 @@
 /* options */
 
 static bool option_full_decode = true;
+static bool option_print_all_bb = false;
 static bool option_print_offsets = true;
 static enum { COLOR_AUTO, COLOR_ALWAYS, COLOR_NEVER } option_color;
 static char *xml_path = NULL;
@@ -446,6 +447,7 @@ read_data_file(FILE *file)
             { "hw status", "HW status" },
             { "wa context", "WA context" },
             { "wa batchbuffer", "WA batch" },
+            { "NULL context", "Kernel context" },
             { "user", "user" },
             { "semaphores", "semaphores", },
             { "guc log buffer", "GuC log", },
@@ -602,7 +604,8 @@ read_data_file(FILE *file)
              (unsigned) (sections[s].gtt_offset >> 32),
              (unsigned) sections[s].gtt_offset);
 
-      if (strcmp(sections[s].buffer_name, "batch buffer") == 0 ||
+      if (option_print_all_bb ||
+          strcmp(sections[s].buffer_name, "batch buffer") == 0 ||
           strcmp(sections[s].buffer_name, "ring buffer") == 0 ||
           strcmp(sections[s].buffer_name, "HW Context") == 0) {
          gen_print_batch(&batch_ctx, sections[s].data, sections[s].count,
@@ -660,7 +663,8 @@ print_help(const char *progname, FILE *file)
            "                        if omitted), 'always', or 'never'\n"
            "      --no-pager      don't launch pager\n"
            "      --no-offsets    don't print instruction offsets\n"
-           "      --xml=DIR       load hardware xml description from directory DIR\n",
+           "      --xml=DIR       load hardware xml description from directory DIR\n"
+           "      --all-bb        print out all batchbuffers\n",
            progname);
 }
 
@@ -679,6 +683,7 @@ main(int argc, char *argv[])
       { "headers",    no_argument,       (int *) &option_full_decode,   false },
       { "color",      required_argument, NULL,                          'c' },
       { "xml",        required_argument, NULL,                          'x' },
+      { "all-bb",     no_argument,       (int *) &option_print_all_bb,  true },
       { NULL,         0,                 NULL,                          0 }
    };