summaryrefslogtreecommitdiffstats
path: root/src/intel/tools/aubinator.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2016-10-05 23:52:51 +0100
committerLionel Landwerlin <[email protected]>2016-10-08 02:17:35 +0100
commit619c8de522251e0ab9477b475c22c084180877d4 (patch)
tree2a5735306e7659eec38b9a08a50c24c579a7ebde /src/intel/tools/aubinator.c
parent63a366a8813fec3836213cfd5ab006add332ec84 (diff)
intel: aubinator: enable loading xml files from a given directory
This might be useful for people who debug with out of tree descriptions. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Sirisha Gandikota <[email protected]>
Diffstat (limited to 'src/intel/tools/aubinator.c')
-rw-r--r--src/intel/tools/aubinator.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 8be7580c2b1..7f6655acbbe 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -1037,7 +1037,8 @@ print_help(const char *progname, FILE *file)
" --color[=WHEN] colorize the output; WHEN can be 'auto' (default\n"
" if omitted), 'always', or 'never'\n"
" --no-pager don't launch pager\n"
- " --no-offsets don't print instruction offsets\n",
+ " --no-offsets don't print instruction offsets\n"
+ " --xml=DIR load hardware xml description from directory DIR\n",
progname);
}
@@ -1047,7 +1048,7 @@ int main(int argc, char *argv[])
struct aub_file *file;
int c, i;
bool help = false, pager = true;
- const char *input_file = NULL;
+ char *input_file = NULL, *xml_path = NULL;
char gen_val[24];
const struct {
const char *name;
@@ -1069,6 +1070,7 @@ int main(int argc, char *argv[])
{ "gen", required_argument, NULL, 'g' },
{ "headers", no_argument, (int *) &option_full_decode, false },
{ "color", required_argument, NULL, 'c' },
+ { "xml", required_argument, NULL, 'x' },
{ NULL, 0, NULL, 0 }
};
struct gen_device_info devinfo;
@@ -1091,6 +1093,9 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
break;
+ case 'x':
+ xml_path = strdup(optarg);
+ break;
default:
break;
}
@@ -1131,9 +1136,15 @@ int main(int argc, char *argv[])
if (isatty(1) && pager)
setup_pager();
- spec = gen_spec_load(&devinfo);
+ if (xml_path == NULL)
+ spec = gen_spec_load(&devinfo);
+ else
+ spec = gen_spec_load_from_path(&devinfo, xml_path);
disasm = gen_disasm_create(gen->pci_id);
+ if (spec == NULL || disasm == NULL)
+ exit(EXIT_FAILURE);
+
if (input_file == NULL) {
print_help(input_file, stderr);
exit(EXIT_FAILURE);
@@ -1147,6 +1158,7 @@ int main(int argc, char *argv[])
fflush(stdout);
/* close the stdout which is opened to write the output */
close(1);
+ free(xml_path);
wait(NULL);