quick_dump: Add a file argument
authorBen Widawsky <benjamin.widawsky@intel.com>
Fri, 31 Jan 2014 04:46:06 +0000 (04:46 +0000)
committerBen Widawsky <benjamin.widawsky@intel.com>
Sun, 2 Feb 2014 09:48:54 +0000 (10:48 +0100)
-f, or --file will simply dump the file in the specified format. All
other options will be skipped. This is helpful when one wants to create
their own list for temporary debug, or if one requires a subset of
registers to work around things like fused off PCH.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
tools/quick_dump/quick_dump.py

index 9af4345..bace8c7 100755 (executable)
@@ -76,6 +76,8 @@ if __name__ == "__main__":
     parser.add_argument('-a', '--autodetect',
             action='store_true', default=False,
             help='autodetect chipset')
+    parser.add_argument('-f', '--file',
+            type=argparse.FileType('r'), default=None)
     parser.add_argument('profile', nargs='?',
             type=argparse.FileType('r'), default=None)
 
@@ -88,6 +90,11 @@ if __name__ == "__main__":
     # Put us where the script is
     os.chdir(os.path.dirname(sys.argv[0]))
 
+    # specifying a file trumps all other things
+    if args.file != None:
+        parse_file(args.file)
+        sys.exit()
+
     #parse anything named base_ these are assumed to apply for all gens.
     if args.baseless == False:
         walk_base_files()