From: Grant Likely <grant.likely@secretlab.ca>
To: David Daney <ddaney.cavm@gmail.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>
Subject: Re: [PATCH] iqrdomain: Improve formatting in debugfs.
Date: Wed, 11 Apr 2012 01:03:32 -0600 [thread overview]
Message-ID: <20120411070332.6F3C03E081E@localhost> (raw)
In-Reply-To: <1334016417-18748-1-git-send-email-ddaney.cavm@gmail.com>
On Mon, 9 Apr 2012 17:06:57 -0700, David Daney <ddaney.cavm@gmail.com> wrote:
> From: David Daney <david.daney@cavium.com>
>
> The irq_domain_mapping file has some interesting output when chip_data
> contains leading zeros:
>
> virq hwirq chip name chip data domain name
> .
> .
> .
> 103 0x00000 CIU2-W 0x 5e0000000000000 none
> 104 0x00000 CIU2-W 0x 5f0000000000000 none
> 105 0x00000 CIU2-M 0x (null) none
> 113 0x00000 CIU2-E 0x1080000000000000 none
> .
> .
> .
>
> I think there should be no space in there between the "0x" and the
> rest. Also the '(null)' entry doesn't make much sense at all with a
> "0x".
Yeah, it doesn't make much sense with the '0x', but I don't want to
supress the (null) output because it is really important to highlight
when a domain isn't assigned to an active irq.
Fixing the zero pad is trivial to fix though. Just remove the
precision from the %p format. Here's my counter-patch:
---
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 9310a8d..eb05e40 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -643,8 +643,8 @@ static int virq_debug_show(struct seq_file *m, void *private)
void *data;
int i;
- seq_printf(m, "%-5s %-7s %-15s %-18s %s\n", "virq", "hwirq",
- "chip name", "chip data", "domain name");
+ seq_printf(m, "%-5s %-7s %-15s %-*s %s\n", "irq", "hwirq",
+ "chip name", 2 * sizeof(void *) + 2, "chip data", "domain name");
for (i = 1; i < nr_irqs; i++) {
desc = irq_to_desc(i);
@@ -667,7 +667,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
seq_printf(m, "%-15s ", p);
data = irq_desc_get_chip_data(desc);
- seq_printf(m, "0x%16p ", data);
+ seq_printf(m, data ? "0x%p " : " %p ", data);
if (desc->irq_data.domain && desc->irq_data.domain->of_node)
p = desc->irq_data.domain->of_node->full_name;
next prev parent reply other threads:[~2012-04-11 7:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-10 0:06 [PATCH] iqrdomain: Improve formatting in debugfs David Daney
2012-04-11 7:03 ` Grant Likely [this message]
2012-04-11 9:16 ` Andreas Schwab
2012-04-11 14:52 ` Grant Likely
2012-04-11 14:57 ` Grant Likely
2012-04-16 22:01 ` Andreas Schwab
2012-04-16 22:25 ` Grant Likely
2012-04-11 15:33 ` David Daney
2012-04-12 19:20 ` Andreas Schwab
2012-04-12 20:38 ` David Daney
2012-04-12 20:46 ` Grant Likely
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=20120411070332.6F3C03E081E@localhost \
--to=grant.likely@secretlab.ca \
--cc=benh@kernel.crashing.org \
--cc=david.daney@cavium.com \
--cc=ddaney.cavm@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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