intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <ben@bwidawsk.net>,
	vincent.beng.keat.cheah@intel.com,
	alan.previn.teres.alexis@intel.com
Subject: [PATCH 10/10] quick_dump: Use the register access library
Date: Sat,  2 Feb 2013 16:08:02 -0800	[thread overview]
Message-ID: <1359850082-14793-11-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <1359850082-14793-1-git-send-email-ben@bwidawsk.net>

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 tools/quick_dump/quick_dump.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/quick_dump/quick_dump.py b/tools/quick_dump/quick_dump.py
index 44aa2ba..5c88ef1 100755
--- a/tools/quick_dump/quick_dump.py
+++ b/tools/quick_dump/quick_dump.py
@@ -6,15 +6,13 @@ import sys
 import ast
 import subprocess
 import chipset
+import reg_access as reg
 
 def parse_file(file):
 	for line in file:
 		register = ast.literal_eval(line)
-		value = subprocess.check_output(["../intel_reg_read", register[1]])
-		value = value.decode('UTF-8') # convert the byte array to string
-		value = value.rstrip() #dump the newline
-		value = value.split(':') #output is 'addr : offset'
-		print(value[0], "(", register[0], ")", value[1])
+		val = reg.read(register[1])
+		print(register[1], "(", register[0], ")", hex(val))
 
 
 parser = argparse.ArgumentParser(description='Dumb register dumper.')
@@ -23,6 +21,9 @@ parser.add_argument('-a', '--autodetect', action='store_true', default=False, he
 parser.add_argument('profile', nargs='?', type=argparse.FileType('r'), default=None)
 args = parser.parse_args()
 
+if reg.init() == False:
+	sys.exit()
+
 #parse anything named base_ these are assumed to apply for all gens.
 if args.baseless == False:
 	for root, dirs, files in os.walk('.'):
-- 
1.8.1.2

  parent reply	other threads:[~2013-02-03  0:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-03  0:07 [PATCH 00/10] [RFC v2] quick dump Ben Widawsky
2013-02-03  0:07 ` [PATCH 01/10] configure.ac: Fix spacing Ben Widawsky
2013-02-03  0:07 ` [PATCH 02/10] configure.ac: Add vim magic modeline Ben Widawsky
2013-02-03  0:07 ` [PATCH 03/10] quick_dump: A dump utility different than reg_dumper Ben Widawsky
2013-02-03  0:07 ` [PATCH 04/10] quick_dump: gen6 support Ben Widawsky
2013-02-03  0:07 ` [PATCH 05/10] quick_dump: gen7 support Ben Widawsky
2013-02-03  0:07 ` [PATCH 06/10] quick_dump: vlv support Ben Widawsky
2013-02-03  0:07 ` [PATCH 07/10] configure.ac: Add swig dependency Ben Widawsky
2013-02-03  0:08 ` [PATCH 08/10] quick_dump: SWIG chipset interface Ben Widawsky
2013-02-04 18:21   ` Matt Turner
2013-02-03  0:08 ` [PATCH 09/10] quick_dump: Connect libpciaccess and other utils Ben Widawsky
2013-02-03 18:15   ` Ben Widawsky
2013-02-03  0:08 ` Ben Widawsky [this message]
2013-02-03  9:29 ` [PATCH 00/10] [RFC v2] quick dump Jesse Barnes
2013-02-03 12:22   ` Chris Wilson
2013-02-03 18:13     ` Ben Widawsky
2013-02-04 15:10       ` Daniel Vetter
2013-02-04 18:19         ` Ben Widawsky
2013-02-05 11:59       ` Damien Lespiau
2013-02-05 16:48         ` Ben Widawsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359850082-14793-11-git-send-email-ben@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=alan.previn.teres.alexis@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vincent.beng.keat.cheah@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).