mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	quick_dump: Use the register access library
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
This commit is contained in:
		
							parent
							
								
									beb5de858d
								
							
						
					
					
						commit
						1f2e037e8f
					
				@ -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('.'):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user