Skip to contentSkip to conversation

quick dump

RFC PATCH In review Ben Widawsky 6 participants 20 messages Feb 3, 2013 – Feb 5, 2013

lore
Share & tools
lore
#0 lore raw

v2 cover quick dump

This is my second attempt at winning approval for the series. First one
was: https://patchwork.kernel.org/patch/1493131/

In spending the time to rework this tool, I've begun to lose my belief in some of the original motivations I had. Even if you don't want to review, but just like (or dislike) what you see, I'd appreciate such comments.

One very important note: I don't know or understand the legal implications of patch 6. I'd really appreciate anyone who's dealt with the m4 extensions on non-GPL projects to comment.

What's new
==========
The primary differences this time around is I've tried to add the proper autofoo things, as well as using SWIG to get python bindings. I've left the original incantation for the script in the first few patches so people can observe the progression. (Potentially we can also drop the real patches with the SWIG interface).

What it is
==========
The goal is simply to make a tool can get register state, and one that is easy to maintain and update across many generations. I've also long theorized that having python bindings to our gpu tools could really benefit certain types of debugging. reg_access.py is an example of a simple binding which could really be helpful.

Like intel_reg_dumper, supporting new generations isn't free. In order to make the tool nearly as useful as intel_reg_dumper I created the base_ files. These files were created directly from intel_reg_dumper. The idea of base_ files as well as the hackish implementation in quick_dump will likely need to change over time, for I feel that's not where the power of the tool lies.

How to use it
=============
reg_access.py provides register reading capabilities out of the box. You can either run it as an app:
sudo ./reg_access.py 0x20c0
0x8080

or directly from python interpreter:

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

import reg_access as reg
reg.init()

True

Quoted 1 line
Quoted 1 line
Quoted 1 line

hex(reg.read("0x20c0"))

'0x8080'

I'll leave all the options up to readers of the code, but here are some useful examples,
to dump all base registers, and your current platform registers:
sudo ./quick_dump.py -a

to just dump platform specific registers
sudo ./quick_dump.py -ab

profiles can be used for specific lists of reigsters. Profiles are simply text files containing a list of other text files with interesting registers. See sandybridge|ivybridge|valleyview as examples. sudo ./quick_dump.py -b valleyview

What is left
============
The valleyview profile isn't complete. Hopefully someone with such a platform can fix it up.

Jesse had given me a patch for dpio support on Valleyview. I haven't bothered to port that to the new SWIG stuff. Since his patch implied it wasn't complete anyway, I have decided not to bother putting it in this series.

I probably need to slap some copyright stuff on things.

There is talk that the future holds some magical XML register files, passed down to us by the omniscient designers. If that ever happens, the tool would simply change to XML parsing.

Signature · 56 lines
Ben Widawsky (10):
  configure.ac: Fix spacing
  configure.ac: Add vim magic modeline
  quick_dump: A dump utility different than reg_dumper
  quick_dump: gen6 support
  quick_dump: gen7 support
  quick_dump: vlv support
  configure.ac: Add swig dependency
  quick_dump: SWIG chipset interface
  quick_dump: Connect libpciaccess and other utils
  quick_dump: Use the register access library

 configure.ac                        | 102 +++++------
 m4/ax_pkg_swig.m4                   | 135 +++++++++++++++
 m4/ax_python_devel.m4               | 325 ++++++++++++++++++++++++++++++++++++
 m4/ax_swig_python.m4                |  64 +++++++
 tools/Makefile.am                   |   2 +
 tools/quick_dump/Makefile.am        |  26 +++
 tools/quick_dump/base_display.txt   | 197 ++++++++++++++++++++++
 tools/quick_dump/base_interrupt.txt |  20 +++
 tools/quick_dump/base_other.txt     |   6 +
 tools/quick_dump/base_power.txt     |  21 +++
 tools/quick_dump/base_rings.txt     |  27 +++
 tools/quick_dump/chipset.i          |  24 +++
 tools/quick_dump/gen6_other.txt     |   1 +
 tools/quick_dump/gen7_other.txt     |   1 +
 tools/quick_dump/intel_chipset.c    |  23 +++
 tools/quick_dump/ivybridge          |   1 +
 tools/quick_dump/quick_dump.py      |  52 ++++++
 tools/quick_dump/reg_access.py      |  25 +++
 tools/quick_dump/sandybridge        |   1 +
 tools/quick_dump/valleyview         |   6 +
 tools/quick_dump/vlv_display.txt    |  84 ++++++++++
 21 files changed, 1095 insertions(+), 48 deletions(-)
 create mode 100644 m4/ax_pkg_swig.m4
 create mode 100644 m4/ax_python_devel.m4
 create mode 100644 m4/ax_swig_python.m4
 create mode 100644 tools/quick_dump/Makefile.am
 create mode 100644 tools/quick_dump/base_display.txt
 create mode 100644 tools/quick_dump/base_interrupt.txt
 create mode 100644 tools/quick_dump/base_other.txt
 create mode 100644 tools/quick_dump/base_power.txt
 create mode 100644 tools/quick_dump/base_rings.txt
 create mode 100644 tools/quick_dump/chipset.i
 create mode 100644 tools/quick_dump/gen6_other.txt
 create mode 100644 tools/quick_dump/gen7_other.txt
 create mode 100644 tools/quick_dump/intel_chipset.c
 create mode 100644 tools/quick_dump/ivybridge
 create mode 100755 tools/quick_dump/quick_dump.py
 create mode 100755 tools/quick_dump/reg_access.py
 create mode 100644 tools/quick_dump/sandybridge
 create mode 100644 tools/quick_dump/valleyview
 create mode 100644 tools/quick_dump/vlv_display.txt

-- 
1.8.1.2
#1 lore raw

PATCH v2 1/10 configure.ac: Fix spacing

Almost all based on vim's config file type. It got it wrong in a few places which were fixed by hand.

---
 configure.ac | 94 +++++++++++++++++++++++++++++-------------------------------
 1 file changed, 46 insertions(+), 48 deletions(-)
configure.ac +46 -48
index 0ba7ce7..b75a9d4 100644
@@ -22,9 +22,9 @@
 
 AC_PREREQ([2.60])
 AC_INIT([intel-gpu-tools],
-        [1.3],
-        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
-        [intel-gpu-tools])
+	[1.3],
+	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
+	[intel-gpu-tools])
 
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
@@ -41,8 +41,8 @@ AM_MAINTAINER_MODE
 # Checks for functions, headers, structures, etc.
 AC_CHECK_HEADERS([termios.h])
 AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
-#include <sys/sysinfo.h>
-])
+		  #include <sys/sysinfo.h>
+		  ])
 AC_CHECK_FUNCS([swapctl])
 AC_CHECK_FUNCS([asprintf])
 
@@ -60,17 +60,15 @@ PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.38 libdrm])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 
 # for dma-buf tests
-AC_ARG_ENABLE(nouveau,
-              AS_HELP_STRING([--disable-nouveau],
-              [Enable use of nouveau API for prime tests (default: enabled)]),
-              [NOUVEAU=$enableval], [NOUVEAU=yes])
+AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
+	      [Enable use of nouveau API for prime tests (default: enabled)]),
+	      [NOUVEAU=$enableval], [NOUVEAU=yes])
 if test "x$NOUVEAU" = xyes; then
-   PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
-   AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])
+	PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
+	AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])
 fi
 AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
 
-
 # for testdisplay
 PKG_CHECK_MODULES(CAIRO, cairo)
 PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no])
@@ -84,37 +82,37 @@ PKG_CHECK_MODULES(GLIB, glib-2.0)
 # -----------------------------------------------------------------------------
 # Define a configure option for the shadder debugger
 AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
-    [Enable shader debugging support [autodetected]]),
-    [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto])
+	      [Enable shader debugging support [autodetected]]),
+	      [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto])
 
 # Shadder debugger depends on python3, intel-genasm and objcopy
 if test "x$BUILD_SHADER_DEBUGGER" != xno; then
-    # Check Python 3 is installed
-    if test "$PYTHON" = ":" ; then
-	if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
-	    AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
-	else
-	    BUILD_SHADER_DEBUGGER=no
+	# Check Python 3 is installed
+	if test "$PYTHON" = ":" ; then
+		if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
+			AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
+		else
+			BUILD_SHADER_DEBUGGER=no
+		fi
 	fi
-    fi
-    # Check for the Intel Chipset assembler compiler
-    AC_PATH_PROGS([GEN4ASM], intel-gen4asm)
-    if test -z "$GEN4ASM" ; then
-	if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
-	    AC_MSG_ERROR([Shader debugger requested, but intel-gen4asm not found.])
-	else
-	    BUILD_SHADER_DEBUGGER=no
+	# Check for the Intel Chipset assembler compiler
+	AC_PATH_PROGS([GEN4ASM], intel-gen4asm)
+	if test -z "$GEN4ASM" ; then
+		if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
+			AC_MSG_ERROR([Shader debugger requested, but intel-gen4asm not found.])
+		else
+			BUILD_SHADER_DEBUGGER=no
+		fi
 	fi
-    fi
-    # Check for the objcopy GNU binary utiliy command
-    AC_PATH_PROGS([OBJCOPY], objcopy)
-    if test -z "$OBJCOPY" ; then
-	if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
-	    AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
-	else
-	    BUILD_SHADER_DEBUGGER=no
+	# Check for the objcopy GNU binary utiliy command
+	AC_PATH_PROGS([OBJCOPY], objcopy)
+	if test -z "$OBJCOPY" ; then
+		if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
+			AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
+		else
+			BUILD_SHADER_DEBUGGER=no
+		fi
 	fi
-    fi
 fi
 
 AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
@@ -125,15 +123,15 @@ XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt])
 AC_SUBST([THREAD_CFLAGS])
 
 AC_CONFIG_FILES([
-	Makefile
-	benchmarks/Makefile
-	demos/Makefile
-	lib/Makefile
-	man/Makefile
-	scripts/Makefile
-	tests/Makefile
-	tools/Makefile
-	debugger/Makefile
-	debugger/system_routine/Makefile
-])
+		 Makefile
+		 benchmarks/Makefile
+		 demos/Makefile
+		 lib/Makefile
+		 man/Makefile
+		 scripts/Makefile
+		 tests/Makefile
+		 tools/Makefile
+		 debugger/Makefile
+		 debugger/system_routine/Makefile
+		 ])
 AC_OUTPUT
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH v2 2/10 configure.ac: Add vim magic modeline

In reply to Ben Widawsky
---
 configure.ac | 2 ++
 1 file changed, 2 insertions(+)
configure.ac +2 -0
index b75a9d4..1c56fa4 100644
@@ -135,3 +135,5 @@ AC_CONFIG_FILES([
 		 debugger/system_routine/Makefile
 		 ])
 AC_OUTPUT
+
+# vim: set ft=config ts=8 sw=8 tw=0 noet :
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH v2 3/10 quick_dump: A dump utility different than reg_dumper

In reply to Ben Widawsky

This is the base tool for quick dump. At it's heart, quick dump is simply a basic text parsing thingie which plugs into intel-gpu-tools to do something similar to intel_reg_dumper.

The format for the register definition files is very open, so it's just something simple for now.

---
 configure.ac                        |   1 +
 tools/Makefile.am                   |   2 +
 tools/quick_dump/Makefile.am        |   3 +
 tools/quick_dump/base_display.txt   | 197 ++++++++++++++++++++++++++++++++++++
 tools/quick_dump/base_interrupt.txt |  20 ++++
 tools/quick_dump/base_other.txt     |   6 ++
 tools/quick_dump/base_power.txt     |  21 ++++
 tools/quick_dump/base_rings.txt     |  27 +++++
 tools/quick_dump/quick_dump.py      |  37 +++++++
 9 files changed, 314 insertions(+)
 create mode 100644 tools/quick_dump/Makefile.am
 create mode 100644 tools/quick_dump/base_display.txt
 create mode 100644 tools/quick_dump/base_interrupt.txt
 create mode 100644 tools/quick_dump/base_other.txt
 create mode 100644 tools/quick_dump/base_power.txt
 create mode 100644 tools/quick_dump/base_rings.txt
 create mode 100755 tools/quick_dump/quick_dump.py
configure.ac +1 -0
index 1c56fa4..7f89ee6 100644
@@ -131,6 +131,7 @@ AC_CONFIG_FILES([
 		 scripts/Makefile
 		 tests/Makefile
 		 tools/Makefile
+		 tools/quick_dump/Makefile
 		 debugger/Makefile
 		 debugger/system_routine/Makefile
 		 ])
tools/Makefile.am +2 -0
index 71fb087..016fb89 100644
@@ -1,3 +1,5 @@
+DIST_SUBDIRS = quick_dump
+
 bin_PROGRAMS = 				\
 	intel_disable_clock_gating 	\
 	intel_audio_dump 		\
tools/quick_dump/Makefile.am new file +3 -0
new file mode 100644
index 0000000..34938c8
@@ -0,0 +1,3 @@
+EXTRA_DIST =  \
+	      base_display.txt base_interrupt.txt base_other.txt base_power.txt base_rings.txt \
+	      quick_dump.py
tools/quick_dump/base_display.txt new file +197 -0

197 lines not on this page · raw message

tools/quick_dump/base_interrupt.txt new file +20 -0
new file mode 100644
index 0000000..df4244b
@@ -0,0 +1,20 @@
+('GEN6_PMINTRMSK', '0x0000a168', '')
+('DEISR', '0x00044000', '')
+('DEIMR', '0x00044004', '')
+('DEIIR', '0x00044008', '')
+('DEIER', '0x0004400c', '')
+('GTISR', '0x00044010', '')
+('GTIMR', '0x00044014', '')
+('GTIIR', '0x00044018', '')
+('GTIER', '0x0004401c', '')
+('GEN6_PMISR', '0x00044020', '')
+('GEN6_PMIMR', '0x00044024', '')
+('GEN6_PMIIR', '0x00044028', '')
+('GEN6_PMIER', '0x0004402c', '')
+('SDEISR', '0x000c4000', '')
+('SDEIMR', '0x000c4004', '')
+('SDEIIR', '0x000c4008', '')
+('SDEIER', '0x000c400c', '')
+('RENDER_IMR', '0x000020a8', '')
+('BSD_IMR', '0x000120a8', '')
+('BLT_IMR', '0x000220a8', '')
tools/quick_dump/base_other.txt new file +6 -0
new file mode 100644
index 0000000..24fefdf
@@ -0,0 +1,6 @@
+('PGETBL_CTL', '0x00002020', '')
+('MI_MODE', '0x0000209c', '')
+('ERROR_GEN6', '0x000040a0', '')
+('RENDER_HWSTAM', '0x00002098', '')
+('GEN6_BSD_HWSTAM', '0x00012098', '')
+('GEN6_BLITTER_HWSTAM', '0x00022098', '')
tools/quick_dump/base_power.txt new file +21 -0
new file mode 100644
index 0000000..4a142e5
@@ -0,0 +1,21 @@
+('GEN6_RPNSWREQ', '0x0000a008', '')
+('GEN6_RC_VIDEO_FREQ', '0x0000a00c', '')
+('GEN6_RP_DOWN_TIMEOUT', '0x0000a010', '')
+('GEN6_RP_INTERRUPT_LIMITS', '0x0000a014', '')
+('GEN6_RP_CONTROL', '0x0000a024', '')
+('GEN6_RP_UP_THRESHOLD', '0x0000a02c', '')
+('GEN6_RP_UP_EI', '0x0000a068', '')
+('GEN6_RP_DOWN_EI', '0x0000a06c', '')
+('GEN6_RP_IDLE_HYSTERSIS', '0x0000a070', '')
+('GEN6_RC_CONTROL', '0x0000a090', '')
+('GEN6_RC_STATE', '0x0000a094', '')
+('GEN6_RC1_WAKE_RATE_LIMIT', '0x0000a098', '')
+('GEN6_RC6_WAKE_RATE_LIMIT', '0x0000a09c', '')
+('GEN6_RC_EVALUATION_INTERVAL', '0x0000a0a8', '')
+('GEN6_RC_IDLE_HYSTERSIS', '0x0000a0ac', '')
+('GEN6_RC_SLEEP', '0x0000a0b0', '')
+('GEN6_RC1e_THRESHOLD', '0x0000a0b4', '')
+('GEN6_RC6_THRESHOLD', '0x0000a0b8', '')
+('RC6_RESIDENCY_TIME', '0x00138108', '')
+('RC6p_RESIDENCY_TIME', '0x0013810c', '')
+('RC6pp_RESIDENCY_TIME', '0x00138110', '')
tools/quick_dump/base_rings.txt new file +27 -0
new file mode 100644
index 0000000..d791172
@@ -0,0 +1,27 @@
+('RENDER_INSTPM', '0x20c0', '')
+('BSD_INSTPM', '0x120c0', '')
+('BLT_INSTPM', '0x220c0', '')
+('RENDER_RING_HEAD', '0x2034', '')
+('BSD_RING_HEAD', '0x12034', '')
+('BLT_RING_HEAD', '0x22034', '')
+('RENDER_IPEIR', '0x2064', '')
+('BSD_IPEIR', '0x12064', '')
+('BLT_IPEIR', '0x22064', '')
+('RENDER_IPEHR', '0x2068', '')
+('BSD_IPEHR', '0x12068', '')
+('BLT_IPEHR', '0x22068', '')
+('RENDER_INSTDONE', '0x206c', '')
+('BSD_INSTDONE', '0x1206c', '')
+('BLT_INSTDONE', '0x2206c', '')
+('RENDER_INSTPS', '0x2070', '')
+('BSD_INSTPS', '0x12070', '')
+('BLT_INSTPS', '0x22070', '')
+('RENDER_RING_ACTHD', '0x2074', '')
+('BSD_RING_ACTHD', '0x12074', '')
+('BLT_RING_ACTHD', '0x22074', '')
+('RENDER_FADDR', '0x2078', '')
+('BSD_FADDR', '0x12078', '')
+('BLT_FADDR', '0x22078', '')
+('RENDER_RING_TAIL', '0x2030', '')
+('BSD_RING_TAIL', '0x12030', '')
+('BLT_RING_TAIL', '0x22030', '')
tools/quick_dump/quick_dump.py new file +37 -0
new file mode 100755
index 0000000..3fea7bb
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+
+import argparse
+import os
+import sys
+import ast
+import subprocess
+
+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])
+
+
+parser = argparse.ArgumentParser(description='Dumb register dumper.')
+parser.add_argument('-b', '--baseless', action='store_true', default=False, help='baseless mode, ignore files starting with base_')
+parser.add_argument('profile', nargs='?', type=argparse.FileType('r'), default=None)
+args = parser.parse_args()
+
+#parse anything named base_ these are assumed to apply for all gens.
+if args.baseless == False:
+	for root, dirs, files in os.walk('.'):
+		for name in files:
+			if name.startswith(("base_")):
+				file = open(name.rstrip(), 'r')
+				parse_file(file)
+
+if args.profile == None:
+	sys.exit()
+
+for extra in args.profile:
+	extra_file = open(extra.rstrip(), 'r')
+	parse_file(extra_file)
Signature · 1 line
1.8.1.2
#4 lore raw

PATCH v2 4/10 quick_dump: gen6 support

In reply to Ben Widawsky
---
 tools/quick_dump/Makefile.am    | 1 +
 tools/quick_dump/gen6_other.txt | 1 +
 tools/quick_dump/sandybridge    | 1 +
 3 files changed, 3 insertions(+)
 create mode 100644 tools/quick_dump/gen6_other.txt
 create mode 100644 tools/quick_dump/sandybridge
tools/quick_dump/Makefile.am +1 -0
index 34938c8..fbafdc5 100644
@@ -1,3 +1,4 @@
 EXTRA_DIST =  \
 	      base_display.txt base_interrupt.txt base_other.txt base_power.txt base_rings.txt \
+	      gen6_other.txt sandybridge \
 	      quick_dump.py
tools/quick_dump/gen6_other.txt new file +1 -0
new file mode 100644
index 0000000..9aa6539
@@ -0,0 +1 @@
+('GFX_MODE', '0x00002520', '')
tools/quick_dump/sandybridge new file +1 -0
new file mode 100644
index 0000000..6ece0fd
@@ -0,0 +1 @@
+gen6_other.txt
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH v2 5/10 quick_dump: gen7 support

In reply to Ben Widawsky
---
 tools/quick_dump/Makefile.am    | 1 +
 tools/quick_dump/gen7_other.txt | 1 +
 tools/quick_dump/ivybridge      | 1 +
 3 files changed, 3 insertions(+)
 create mode 100644 tools/quick_dump/gen7_other.txt
 create mode 100644 tools/quick_dump/ivybridge
tools/quick_dump/Makefile.am +1 -0
index fbafdc5..0ed28fb 100644
@@ -1,4 +1,5 @@
 EXTRA_DIST =  \
 	      base_display.txt base_interrupt.txt base_other.txt base_power.txt base_rings.txt \
 	      gen6_other.txt sandybridge \
+	      gen7_other.txt ivybridge \
 	      quick_dump.py
tools/quick_dump/gen7_other.txt new file +1 -0
new file mode 100644
index 0000000..b6313a4
@@ -0,0 +1 @@
+('GFX_MODE_GEN7', '0x0000229c', '')
tools/quick_dump/ivybridge new file +1 -0
new file mode 100644
index 0000000..4637b42
@@ -0,0 +1 @@
+gen7_other.txt
Signature · 1 line
1.8.1.2
#6 lore raw

PATCH v2 6/10 quick_dump: vlv support

In reply to Ben Widawsky

This patch includes a patch from Jesse which removed a bunch of VLV registers which were useless in my original RFC.

---
 tools/quick_dump/Makefile.am     |  1 +
 tools/quick_dump/valleyview      |  6 +++
 tools/quick_dump/vlv_display.txt | 84 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 91 insertions(+)
 create mode 100644 tools/quick_dump/valleyview
 create mode 100644 tools/quick_dump/vlv_display.txt
tools/quick_dump/Makefile.am +1 -0
index 0ed28fb..a0c7083 100644
@@ -2,4 +2,5 @@ EXTRA_DIST =  \
 	      base_display.txt base_interrupt.txt base_other.txt base_power.txt base_rings.txt \
 	      gen6_other.txt sandybridge \
 	      gen7_other.txt ivybridge \
+	      vlv_display.txt valleyview \
 	      quick_dump.py
tools/quick_dump/valleyview new file +6 -0
new file mode 100644
index 0000000..2669d92
@@ -0,0 +1,6 @@
+vlv_display.txt
+base_interrupt.txt
+base_other.txt
+base_power.txt
+base_rings.txt
+gen7_other.txt
tools/quick_dump/vlv_display.txt new file +84 -0

84 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#7 lore raw

PATCH v2 7/10 configure.ac: Add swig dependency

In reply to Ben Widawsky

As far as I can tell (and recommended to me by Matt) taking these m4 extension macros from http://www.gnu.org/software/autoconf-archive/
doesn't require the project distribute GPL. I am a bit confused from reading the license. I'd really hope someone can comment.

The only other solution would be to roll my on m4 macros, or figure out a way to check that this autoconf-archive package is included from the configure.ac.

---
 configure.ac          |   5 +
 m4/ax_pkg_swig.m4     | 135 +++++++++++++++++++++
 m4/ax_python_devel.m4 | 325 ++++++++++++++++++++++++++++++++++++++++++++++++++
 m4/ax_swig_python.m4  |  64 ++++++++++
 4 files changed, 529 insertions(+)
 create mode 100644 m4/ax_pkg_swig.m4
 create mode 100644 m4/ax_python_devel.m4
 create mode 100644 m4/ax_swig_python.m4
configure.ac +5 -0
index 7f89ee6..f2d76d3 100644
@@ -50,6 +50,11 @@ AC_CHECK_FUNCS([asprintf])
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 
+# SWIG configuration
+AX_PKG_SWIG(2.0.0, [], [ AC_MSG_ERROR([SWIG 2.0.0 or higher is required to build..]) ])
+AX_PYTHON_DEVEL([>= '3.0'])
+AX_SWIG_PYTHON
+
 # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
 m4_ifndef([XORG_MACROS_VERSION],
 	  [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
m4/ax_pkg_swig.m4 new file +135 -0

135 lines not on this page · raw message

m4/ax_python_devel.m4 new file +325 -0

325 lines not on this page · raw message

m4/ax_swig_python.m4 new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#8 lore raw

PATCH v2 8/10 quick_dump: SWIG chipset interface

In reply to Ben Widawsky

This isn't strictly necessary it would have been easy enough to simply convert intel_chipset.h but this should be nice prep work for directly doing MMIO. It also serves as a nice review point.

It's demonstrated with an autodetect function in the script. That autodetect has a hardcoded path that shouldn't be there, but it will go away in the next patch when we can properly link in libpciaccess.

Thanks to Matt for helping whip the automake stuff into shape.

---
 tools/Makefile.am                |  2 +-
 tools/quick_dump/Makefile.am     | 18 +++++++++++++++++-
 tools/quick_dump/chipset.i       | 12 ++++++++++++
 tools/quick_dump/intel_chipset.c | 16 ++++++++++++++++
 tools/quick_dump/quick_dump.py   | 15 +++++++++++++++
 5 files changed, 61 insertions(+), 2 deletions(-)
 create mode 100644 tools/quick_dump/chipset.i
 create mode 100644 tools/quick_dump/intel_chipset.c
tools/Makefile.am +1 -1
index 016fb89..6088919 100644
@@ -1,4 +1,4 @@
-DIST_SUBDIRS = quick_dump
+SUBDIRS = quick_dump
 
 bin_PROGRAMS = 				\
 	intel_disable_clock_gating 	\
tools/quick_dump/Makefile.am +17 -1
index a0c7083..6c04dd5 100644
@@ -1,6 +1,22 @@
+BUILT_SOURCES = chipset_wrap_python.c
+
+bin_SCRIPTS = quick_dump.py chipset.py
+
+lib_LTLIBRARIES = I915ChipsetPython.la
+I915ChipsetPython_la_CFLAGS = -I$(top_srcdir)/lib $(PYTHON_CPPFLAGS)
+I915ChipsetPython_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS)
+I915ChipsetPython_la_SOURCES = chipset_wrap_python.c intel_chipset.c
+
+chipset_wrap_python.c: chipset.i
+	$(SWIG) $(AX_SWIG_PYTHON_OPT) -I$(top_srcdir)/lib -o $@ $<
+
+all-local: I915ChipsetPython.la
+	$(LN_S) -f .libs/I915ChipsetPython.so _chipset.so
+
+CLEANFILES = chipset_wrap_python.c chipset.py _chipset.so
 EXTRA_DIST =  \
 	      base_display.txt base_interrupt.txt base_other.txt base_power.txt base_rings.txt \
 	      gen6_other.txt sandybridge \
 	      gen7_other.txt ivybridge \
 	      vlv_display.txt valleyview \
-	      quick_dump.py
+	      chipset.i quick_dump.py chipset.py
tools/quick_dump/chipset.i new file +12 -0
new file mode 100644
index 0000000..16c4932
@@ -0,0 +1,12 @@
+%module chipset 
+%{
+#include "intel_chipset.h"
+extern int is_sandybridge(unsigned short pciid);
+extern int is_ivybridge(unsigned short pciid);
+extern int is_valleyview(unsigned short pciid);
+%}
+
+%include "intel_chipset.h"
+extern int is_sandybridge(unsigned short pciid);
+extern int is_ivybridge(unsigned short pciid);
+extern int is_valleyview(unsigned short pciid);
tools/quick_dump/intel_chipset.c new file +16 -0
new file mode 100644
index 0000000..b242ffc
@@ -0,0 +1,16 @@
+#include "intel_chipset.h"
+
+int is_sandybridge(unsigned short pciid)
+{
+	return IS_GEN6(pciid);
+}
+
+int is_ivybridge(unsigned short pciid)
+{
+	return IS_IVYBRIDGE(pciid);
+}
+
+int is_valleyview(unsigned short pciid)
+{
+	return IS_VALLEYVIEW(pciid);
+}
tools/quick_dump/quick_dump.py +15 -0
index 3fea7bb..59cae1f 100755
@@ -5,6 +5,7 @@ import os
 import sys
 import ast
 import subprocess
+import chipset
 
 def parse_file(file):
 	for line in file:
@@ -18,6 +19,7 @@ def parse_file(file):
 
 parser = argparse.ArgumentParser(description='Dumb register dumper.')
 parser.add_argument('-b', '--baseless', action='store_true', default=False, help='baseless mode, ignore files starting with base_')
+parser.add_argument('-a', '--autodetect', action='store_true', default=False, help='autodetect chipset')
 parser.add_argument('profile', nargs='?', type=argparse.FileType('r'), default=None)
 args = parser.parse_args()
 
@@ -29,6 +31,19 @@ if args.baseless == False:
 				file = open(name.rstrip(), 'r')
 				parse_file(file)
 
+if args.autodetect:
+	sysfs_file = open('/sys/class/drm/card0/device/device', 'r')
+	devid_str = sysfs_file.read()
+	devid = int(devid_str, 16)
+	if chipset.is_sandybridge(devid):
+		args.profile = open('sandybridge', 'r')
+	elif chipset.is_ivybridge(devid):
+		args.profile = open('ivybridge', 'r')
+	elif chipset.is_valleyview(devid):
+		args.profile = open('valleyview', 'r')
+	else:
+		print("Autodetect of %x " + devid + " failed")
+
 if args.profile == None:
 	sys.exit()
 
Signature · 1 line
1.8.1.2
#9 lore raw

Re: [PATCH 08/10] quick_dump: SWIG chipset interface

Quoted 8 lines · Ben Widawsky

This isn't strictly necessary it would have been easy enough to simply convert intel_chipset.h but this should be nice prep work for directly doing MMIO. It also serves as a nice review point.

It's demonstrated with an autodetect function in the script. That autodetect has a hardcoded path that shouldn't be there, but it will go away in the next patch when we can properly link in libpciaccess.

Quoted 5 lines

Thanks to Matt for helping whip the automake stuff into shape.

---

Patches 7 & 8 are Reviewed-by: Matt Turner <[email protected]>

#10 lore raw

PATCH v2 9/10 quick_dump: Connect libpciaccess and other utils

In reply to Ben Widawsky

Make a register access library with sample to do register reads

---
 tools/quick_dump/Makefile.am     | 14 +++++++++-----
 tools/quick_dump/chipset.i       | 16 ++++++++++++++--
 tools/quick_dump/intel_chipset.c |  7 +++++++
 tools/quick_dump/quick_dump.py   |  5 ++---
 tools/quick_dump/reg_access.py   | 25 +++++++++++++++++++++++++
 5 files changed, 57 insertions(+), 10 deletions(-)
 create mode 100755 tools/quick_dump/reg_access.py
tools/quick_dump/Makefile.am +9 -5
index 6c04dd5..4711830 100644
@@ -1,14 +1,18 @@
 BUILT_SOURCES = chipset_wrap_python.c
 
-bin_SCRIPTS = quick_dump.py chipset.py
+bin_SCRIPTS = quick_dump.py chipset.py reg_access.py
 
 lib_LTLIBRARIES = I915ChipsetPython.la
-I915ChipsetPython_la_CFLAGS = -I$(top_srcdir)/lib $(PYTHON_CPPFLAGS)
-I915ChipsetPython_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS)
-I915ChipsetPython_la_SOURCES = chipset_wrap_python.c intel_chipset.c
+I915ChipsetPython_la_CFLAGS = -I$(top_srcdir)/lib $(PYTHON_CPPFLAGS) $(CFLAGS) -I/usr/include/libdrm/
+I915ChipsetPython_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) -lpciaccess
+I915ChipsetPython_la_SOURCES = chipset_wrap_python.c intel_chipset.c \
+			       ../../lib/intel_drm.c  \
+			       ../../lib/intel_pci.c  \
+			       ../../lib/intel_reg_map.c  \
+			       ../../lib/intel_mmio.c
 
 chipset_wrap_python.c: chipset.i
-	$(SWIG) $(AX_SWIG_PYTHON_OPT) -I$(top_srcdir)/lib -o $@ $<
+	$(SWIG) $(AX_SWIG_PYTHON_OPT) -I/usr/include -I$(top_srcdir)/lib -o $@ $<
 
 all-local: I915ChipsetPython.la
 	$(LN_S) -f .libs/I915ChipsetPython.so _chipset.so
tools/quick_dump/chipset.i +14 -2
index 16c4932..2f4f5ef 100644
@@ -1,12 +1,24 @@
-%module chipset 
+%module chipset
+%include "stdint.i"
 %{
+#include <pciaccess.h>
+#include <stdint.h>
 #include "intel_chipset.h"
 extern int is_sandybridge(unsigned short pciid);
 extern int is_ivybridge(unsigned short pciid);
 extern int is_valleyview(unsigned short pciid);
+extern struct pci_device *intel_get_pci_device();
+extern int intel_register_access_init(struct pci_device *pci_dev, int safe);
+extern uint32_t intel_register_read(uint32_t reg);
+extern void intel_register_access_fini();
+extern unsigned short pcidev_to_devid(struct pci_device *pci_dev);
 %}
 
-%include "intel_chipset.h"
 extern int is_sandybridge(unsigned short pciid);
 extern int is_ivybridge(unsigned short pciid);
 extern int is_valleyview(unsigned short pciid);
+extern struct pci_device *intel_get_pci_device();
+extern int intel_register_access_init(struct pci_device *pci_dev, int safe);
+extern uint32_t intel_register_read(uint32_t reg);
+extern void intel_register_access_fini();
+extern unsigned short pcidev_to_devid(struct pci_device *pci_dev);
tools/quick_dump/intel_chipset.c +7 -0
index b242ffc..d6e7f91 100644
@@ -1,3 +1,4 @@
+#include <pciaccess.h>
 #include "intel_chipset.h"
 
 int is_sandybridge(unsigned short pciid)
@@ -14,3 +15,9 @@ int is_valleyview(unsigned short pciid)
 {
 	return IS_VALLEYVIEW(pciid);
 }
+
+/* Simple helper because I couldn't make this work in the script */
+unsigned short pcidev_to_devid(struct pci_device *pdev)
+{
+	return pdev->device_id;
+}
tools/quick_dump/quick_dump.py +2 -3
index 59cae1f..44aa2ba 100755
@@ -32,9 +32,8 @@ if args.baseless == False:
 				parse_file(file)
 
 if args.autodetect:
-	sysfs_file = open('/sys/class/drm/card0/device/device', 'r')
-	devid_str = sysfs_file.read()
-	devid = int(devid_str, 16)
+	pci_dev = chipset.intel_get_pci_device()
+	devid = chipset.pcidev_to_devid(pci_dev)
 	if chipset.is_sandybridge(devid):
 		args.profile = open('sandybridge', 'r')
 	elif chipset.is_ivybridge(devid):
tools/quick_dump/reg_access.py new file +25 -0
new file mode 100755
index 0000000..0f63424
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+import chipset
+
+def read(reg):
+	reg = int(reg, 16)
+	val = chipset.intel_register_read(reg)
+	return val
+
+def init():
+	pci_dev = chipset.intel_get_pci_device()
+	ret = chipset.intel_register_access_init(pci_dev, 0)
+	if ret != 0:
+		print("Register access init failed");
+		return False
+	return True
+
+if __name__ == "__main__":
+	import sys
+
+	if init() == False:
+		sys.exit()
+
+	reg = sys.argv[1]
+	print(hex(read(reg)))
+	chipset.intel_register_access_fini()
Signature · 1 line
1.8.1.2
#11 lore raw

Re: [PATCH 09/10] quick_dump: Connect libpciaccess and other utils

Quoted 23 lines · Ben Widawsky

Make a register access library with sample to do register reads

---
 tools/quick_dump/Makefile.am     | 14 +++++++++-----
 tools/quick_dump/chipset.i       | 16 ++++++++++++++--
 tools/quick_dump/intel_chipset.c |  7 +++++++
 tools/quick_dump/quick_dump.py   |  5 ++---
 tools/quick_dump/reg_access.py   | 25 +++++++++++++++++++++++++
 5 files changed, 57 insertions(+), 10 deletions(-)
 create mode 100755 tools/quick_dump/reg_access.py
tools/quick_dump/Makefile.am +1 -1
index 6c04dd5..4711830 100644
@@ -1,14 +1,18 @@
 BUILT_SOURCES = chipset_wrap_python.c
 
-bin_SCRIPTS = quick_dump.py chipset.py
+bin_SCRIPTS = quick_dump.py chipset.py reg_access.py
 
 lib_LTLIBRARIES = I915ChipsetPython.la

tools/quick_dump/Makefile.am line 12

Quoted 10 lines
tools/quick_dump/Makefile.am +7 -3
-I915ChipsetPython_la_CFLAGS = -I$(top_srcdir)/lib $(PYTHON_CPPFLAGS)
-I915ChipsetPython_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS)
-I915ChipsetPython_la_SOURCES = chipset_wrap_python.c intel_chipset.c
+I915ChipsetPython_la_CFLAGS = -I$(top_srcdir)/lib $(PYTHON_CPPFLAGS) $(CFLAGS) -I/usr/include/libdrm/
+I915ChipsetPython_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) -lpciaccess
+I915ChipsetPython_la_SOURCES = chipset_wrap_python.c intel_chipset.c \
+			       ../../lib/intel_drm.c  \
+			       ../../lib/intel_pci.c  \
+			       ../../lib/intel_reg_map.c  \
+			       ../../lib/intel_mmio.c

I should probably $(top_srcdir)/lib these sources. Fixed locally.

Quoted 107 lines
tools/quick_dump/Makefile.am +1 -1
 chipset_wrap_python.c: chipset.i
-	$(SWIG) $(AX_SWIG_PYTHON_OPT) -I$(top_srcdir)/lib -o $@ $<
+	$(SWIG) $(AX_SWIG_PYTHON_OPT) -I/usr/include -I$(top_srcdir)/lib -o $@ $<
 
 all-local: I915ChipsetPython.la
 	$(LN_S) -f .libs/I915ChipsetPython.so _chipset.so
tools/quick_dump/chipset.i +14 -2
index 16c4932..2f4f5ef 100644
@@ -1,12 +1,24 @@
-%module chipset 
+%module chipset
+%include "stdint.i"
 %{
+#include <pciaccess.h>
+#include <stdint.h>
 #include "intel_chipset.h"
 extern int is_sandybridge(unsigned short pciid);
 extern int is_ivybridge(unsigned short pciid);
 extern int is_valleyview(unsigned short pciid);
+extern struct pci_device *intel_get_pci_device();
+extern int intel_register_access_init(struct pci_device *pci_dev, int safe);
+extern uint32_t intel_register_read(uint32_t reg);
+extern void intel_register_access_fini();
+extern unsigned short pcidev_to_devid(struct pci_device *pci_dev);
 %}
 
-%include "intel_chipset.h"
 extern int is_sandybridge(unsigned short pciid);
 extern int is_ivybridge(unsigned short pciid);
 extern int is_valleyview(unsigned short pciid);
+extern struct pci_device *intel_get_pci_device();
+extern int intel_register_access_init(struct pci_device *pci_dev, int safe);
+extern uint32_t intel_register_read(uint32_t reg);
+extern void intel_register_access_fini();
+extern unsigned short pcidev_to_devid(struct pci_device *pci_dev);
tools/quick_dump/intel_chipset.c +7 -0
index b242ffc..d6e7f91 100644
@@ -1,3 +1,4 @@
+#include <pciaccess.h>
 #include "intel_chipset.h"
 
 int is_sandybridge(unsigned short pciid)
@@ -14,3 +15,9 @@ int is_valleyview(unsigned short pciid)
 {
 	return IS_VALLEYVIEW(pciid);
 }
+
+/* Simple helper because I couldn't make this work in the script */
+unsigned short pcidev_to_devid(struct pci_device *pdev)
+{
+	return pdev->device_id;
+}
tools/quick_dump/quick_dump.py +2 -3
index 59cae1f..44aa2ba 100755
@@ -32,9 +32,8 @@ if args.baseless == False:
 				parse_file(file)
 
 if args.autodetect:
-	sysfs_file = open('/sys/class/drm/card0/device/device', 'r')
-	devid_str = sysfs_file.read()
-	devid = int(devid_str, 16)
+	pci_dev = chipset.intel_get_pci_device()
+	devid = chipset.pcidev_to_devid(pci_dev)
 	if chipset.is_sandybridge(devid):
 		args.profile = open('sandybridge', 'r')
 	elif chipset.is_ivybridge(devid):
tools/quick_dump/reg_access.py new file +25 -0
new file mode 100755
index 0000000..0f63424
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+import chipset
+
+def read(reg):
+	reg = int(reg, 16)
+	val = chipset.intel_register_read(reg)
+	return val
+
+def init():
+	pci_dev = chipset.intel_get_pci_device()
+	ret = chipset.intel_register_access_init(pci_dev, 0)
+	if ret != 0:
+		print("Register access init failed");
+		return False
+	return True
+
+if __name__ == "__main__":
+	import sys
+
+	if init() == False:
+		sys.exit()
+
+	reg = sys.argv[1]
+	print(hex(read(reg)))
+	chipset.intel_register_access_fini()
Signature · 1 line
1.8.1.2
Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
#12 lore raw

PATCH v2 10/10 quick_dump: Use the register access library

In reply to Ben Widawsky
---
 tools/quick_dump/quick_dump.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
tools/quick_dump/quick_dump.py +6 -5
index 44aa2ba..5c88ef1 100755
@@ -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('.'):
Signature · 1 line
1.8.1.2
Acked-by on the v2 series
#13 lore raw
In reply to Ben Widawsky
Quoted 7 lines · On Sat, 2 Feb 2013 16:07:52 -0800 Ben Widawsky <[email protected]> wrote:

This is my second attempt at winning approval for the series. First one
was: https://patchwork.kernel.org/patch/1493131/

In spending the time to rework this tool, I've begun to lose my belief in some of the original motivations I had. Even if you don't want to review, but just like (or dislike) what you see, I'd appreciate such comments.

I'd like to see it land in i-g-t. Having the regs defined in a text or xml file is an improvement over what we have today, and is easier to extend. At first the advantage of reg_dumper was that it parsed out the bitfields of the various regs. But we didn't keep up with that, and also haven't kept up with the regs on new platforms as well as we could. Text files would make that easier, and xml files might bring back the bit field parsing, which would be extra nice.

Jesse

#14 lore raw
Quoted 11 lines · Jesse Barnes
Quoted 7 lines · On Sat, 2 Feb 2013 16:07:52 -0800 Ben Widawsky <[email protected]> wrote:

This is my second attempt at winning approval for the series. First one
was: https://patchwork.kernel.org/patch/1493131/

In spending the time to rework this tool, I've begun to lose my belief in some of the original motivations I had. Even if you don't want to review, but just like (or dislike) what you see, I'd appreciate such comments.

Quoted 7 lines

I'd like to see it land in i-g-t. Having the regs defined in a text or xml file is an improvement over what we have today, and is easier to extend. At first the advantage of reg_dumper was that it parsed out the bitfields of the various regs. But we didn't keep up with that, and also haven't kept up with the regs on new platforms as well as we could. Text files would make that easier, and xml files might bring back the bit field parsing, which would be extra nice.

Completely agree. For me the big improvement would be being able to use the bspec register names or our internal approximation thereof rather than having to loop up the actual addresses every time.

Having the name database available in python should make building integrated little snippets to parse traces which are also python accessible.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#15 lore raw
Quoted 20 lines · Chris Wilson
Quoted 11 lines · Jesse Barnes
Quoted 7 lines · On Sat, 2 Feb 2013 16:07:52 -0800 Ben Widawsky <[email protected]> wrote:

This is my second attempt at winning approval for the series. First one
was: https://patchwork.kernel.org/patch/1493131/

In spending the time to rework this tool, I've begun to lose my belief in some of the original motivations I had. Even if you don't want to review, but just like (or dislike) what you see, I'd appreciate such comments.

Quoted 7 lines

I'd like to see it land in i-g-t. Having the regs defined in a text or xml file is an improvement over what we have today, and is easier to extend. At first the advantage of reg_dumper was that it parsed out the bitfields of the various regs. But we didn't keep up with that, and also haven't kept up with the regs on new platforms as well as we could. Text files would make that easier, and xml files might bring back the bit field parsing, which would be extra nice.

Quoted 8 lines

Completely agree. For me the big improvement would be being able to use the bspec register names or our internal approximation thereof rather than having to loop up the actual addresses every time.

Having the name database available in python should make building integrated little snippets to parse traces which are also python accessible.
-Chris

It's really nice to get support from you. A mix of fever and staring at the same code too long can really make someone go crazy. Still, a few concerns left from me, one of which I accidentally left out of the description.

- Someone needs to give me a yes or no on the m4 extension macros. This will block any pushing.
- The build kind of sucks on Arch because of Arch's choices regarding python libraries. To build this on Arch, you must run something like:
./autogen.sh PYTHON_LDFLAGS="-L/usr/lib/python3.3 -lpython3.3m" I really don't like autogen not working out of the box. Perhaps I need to add an AC_ flag to default this tool to off? What do others think? Does it work properly on other distros? How to handle this?
- Ideally, I'd like someone to send me some fixes for valleyview definitions if they're needed. I am not sure.

Jesse, if you can send me a list of DPIO offsets to read, I'll add the appropriate patch. (It can wait until you get back).

Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
#16 lore raw
Quoted 46 lines · Ben Widawsky
Quoted 20 lines · Chris Wilson
Quoted 11 lines · Jesse Barnes
Quoted 7 lines · On Sat, 2 Feb 2013 16:07:52 -0800 Ben Widawsky <[email protected]> wrote:

This is my second attempt at winning approval for the series. First one
was: https://patchwork.kernel.org/patch/1493131/

In spending the time to rework this tool, I've begun to lose my belief in some of the original motivations I had. Even if you don't want to review, but just like (or dislike) what you see, I'd appreciate such comments.

Quoted 7 lines

I'd like to see it land in i-g-t. Having the regs defined in a text or xml file is an improvement over what we have today, and is easier to extend. At first the advantage of reg_dumper was that it parsed out the bitfields of the various regs. But we didn't keep up with that, and also haven't kept up with the regs on new platforms as well as we could. Text files would make that easier, and xml files might bring back the bit field parsing, which would be extra nice.

Quoted 8 lines

Completely agree. For me the big improvement would be being able to use the bspec register names or our internal approximation thereof rather than having to loop up the actual addresses every time.

Having the name database available in python should make building integrated little snippets to parse traces which are also python accessible.
-Chris

It's really nice to get support from you. A mix of fever and staring at the same code too long can really make someone go crazy. Still, a few concerns left from me, one of which I accidentally left out of the description.

- Someone needs to give me a yes or no on the m4 extension macros. This will block any pushing.
- The build kind of sucks on Arch because of Arch's choices regarding python libraries. To build this on Arch, you must run something like:
./autogen.sh PYTHON_LDFLAGS="-L/usr/lib/python3.3 -lpython3.3m" I really don't like autogen not working out of the box. Perhaps I need to add an AC_ flag to default this tool to off? What do others think? Does it work properly on other distros? How to handle this?
- Ideally, I'd like someone to send me some fixes for valleyview definitions if they're needed. I am not sure.

Quoted 2 lines

Jesse, if you can send me a list of DPIO offsets to read, I'll add the appropriate patch. (It can wait until you get back).

Yeah, I like. Can't help you with the autfoo though :( And no opinion on the m4 macro stuff, I guess you need to poke our legal guys quickly for this.

The only thing to ponder imo is whether we should add intel_ prefixes to the tools and add all the new files to the install target (probably need tos shove the data files somewhere in var then). Without that we need to ask bug reporters to install latest git and run the dumper tools from there.

Otoh we do ask them to grab latest i-g-t git almost every time, anyway ... -Daniel

Quoted 7 lines
Signature · 6 lines
-- 
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#17 lore raw
Quoted 47 lines · Daniel Vetter
Quoted 46 lines · Ben Widawsky
Quoted 20 lines · Chris Wilson
Quoted 11 lines · Jesse Barnes
Quoted 7 lines · On Sat, 2 Feb 2013 16:07:52 -0800 Ben Widawsky <[email protected]> wrote:

This is my second attempt at winning approval for the series. First one
was: https://patchwork.kernel.org/patch/1493131/

In spending the time to rework this tool, I've begun to lose my belief in some of the original motivations I had. Even if you don't want to review, but just like (or dislike) what you see, I'd appreciate such comments.

Quoted 7 lines

I'd like to see it land in i-g-t. Having the regs defined in a text or xml file is an improvement over what we have today, and is easier to extend. At first the advantage of reg_dumper was that it parsed out the bitfields of the various regs. But we didn't keep up with that, and also haven't kept up with the regs on new platforms as well as we could. Text files would make that easier, and xml files might bring back the bit field parsing, which would be extra nice.

Quoted 8 lines

Completely agree. For me the big improvement would be being able to use the bspec register names or our internal approximation thereof rather than having to loop up the actual addresses every time.

Having the name database available in python should make building integrated little snippets to parse traces which are also python accessible.
-Chris

It's really nice to get support from you. A mix of fever and staring at the same code too long can really make someone go crazy. Still, a few concerns left from me, one of which I accidentally left out of the description.

- Someone needs to give me a yes or no on the m4 extension macros. This will block any pushing.
- The build kind of sucks on Arch because of Arch's choices regarding python libraries. To build this on Arch, you must run something like:
./autogen.sh PYTHON_LDFLAGS="-L/usr/lib/python3.3 -lpython3.3m" I really don't like autogen not working out of the box. Perhaps I need to add an AC_ flag to default this tool to off? What do others think? Does it work properly on other distros? How to handle this?
- Ideally, I'd like someone to send me some fixes for valleyview definitions if they're needed. I am not sure.

Quoted 6 lines
Quoted 2 lines

Jesse, if you can send me a list of DPIO offsets to read, I'll add the appropriate patch. (It can wait until you get back).

Yeah, I like. Can't help you with the autfoo though :( And no opinion on the m4 macro stuff, I guess you need to poke our legal guys quickly for this.

Okay, I think I've satisfied myself, from the project page:
http://savannah.gnu.org/projects/autoconf-archive/

"Every single one of those macros can be re-used without imposing any restrictions whatsoever on the licensing of the generated configure script. In particular, it is possible to use all those macros in configure scripts that are meant for non-free software"

Quoted 9 lines

The only thing to ponder imo is whether we should add intel_ prefixes to the tools and add all the new files to the install target (probably need tos shove the data files somewhere in var then). Without that we need to ask bug reporters to install latest git and run the dumper tools from there.

Otoh we do ask them to grab latest i-g-t git almost every time, anyway ... -Daniel

I've gone back and forth as to whether or not I want to robustly support this from "make install." I'm not really too certain of the correct way to install python scripts, so I've mostly punted on this. My feeling for now is, let's make it work in tree, and when it becomes more useful, make sure it works with make install.

Quoted 12 lines
Quoted 7 lines
Signature · 6 lines
-- 
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
#18 lore raw
In reply to Ben Widawsky
Quoted 3 lines · Ben Widawsky

- The build kind of sucks on Arch because of Arch's choices regarding python libraries. To build this on Arch, you must run something like:
./autogen.sh PYTHON_LDFLAGS="-L/usr/lib/python3.3 -lpython3.3m"

Don't you have a python3.pc that would allow you to pull the right flags?

An other detail it that we can't add those hard dependencies to i-g-t, distributions will hate us (even more). So you'd need to make its compilation optional.

Signature · 1 line
Damien
#19 lore raw
Quoted 7 lines · Damien Lespiau
Quoted 3 lines · Ben Widawsky

- The build kind of sucks on Arch because of Arch's choices regarding python libraries. To build this on Arch, you must run something like:
./autogen.sh PYTHON_LDFLAGS="-L/usr/lib/python3.3 -lpython3.3m"

Don't you have a python3.pc that would allow you to pull the right flags?

It's the python devel stuff which seems broken. I don't know too much about this stuff. I'm guessing it just works on other distros.

Quoted 7 lines

An other detail it that we can't add those hard dependencies to i-g-t, distributions will hate us (even more). So you'd need to make its compilation optional.

Signature · 1 line
Damien

I have no problem doing that. Remember though that SWIG is a build time dependency, not a run time one. That shouldn't be an issue for any distro. So it's really just python which concerns you?

Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center