From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: [PATCH 1/2] intel_reg_dumper: Add a single register decode mode Date: Mon, 03 Sep 2012 10:06:45 +0300 Message-ID: <87txvfa8l6.fsf@intel.com> References: <1346420719-5532-1-git-send-email-damien.lespiau@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 26CEC9E738 for ; Mon, 3 Sep 2012 00:02:37 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky , Damien Lespiau Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sun, 02 Sep 2012, Ben Widawsky wrote: > On 2012-08-31 06:45, Damien Lespiau wrote: >> From: Damien Lespiau >> >> From time to time, one would like to decode a register value that >> have >> been captured at a certain point in time (and say printed out with a >> printk). intel_reg_dumper has all the knowledge to do that and this >> patch adds a way to ask it to decode a value. >> >> Example usage: >> >> $ ./tools/intel_reg_dumper PCH_PP_CONTROL 0xabcd0002 >> PCH_PP_CONTROL: 0xabcd0002 (blacklight disabled, power... >> >> v2: friendlier invocation (Chris Wilson) >> >> Signed-off-by: Damien Lespiau > > Back to my earlier complaint from the other patch... If the names don't > match the docs then you forced to memorize our historically awful naming > scheme. More useful to me would be to decode a register at an offset for > a given generation. I think both would be useful. So how about supporting both? Concrete suggestion: 1) If strtoul eats whole of register name, it's register offset. Print *all* matches across *all* generations. 2) If it's a register name, print *all* partial matches (from beginning of string) across *all* generations. 3) Include generation and register offset in the output: Gen5: PCH_PP_CONTROL (0xc7204): 0xabcd0002 (blacklight disabled, power... This would help in cross checking historically awful naming against register offsets, and help in checking for differences between registers and their values across generations. These patches could also go in first, and the above added later. BR, Jani.