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: >>> import reg_access as reg >>> reg.init() True >>> 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. -- 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