From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/9] ARM: fix /proc/interrupts formatting
Date: Mon, 15 Nov 2010 17:59:05 +0000 [thread overview]
Message-ID: <E1PI3Kb-00029u-3U@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20101115175553.GC31421@n2100.arm.linux.org.uk>
As per x86, align the initial column according to how many IRQs we
have. Also, provide an english explaination for the 'LOC:' and
'IPI:' lines.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/include/asm/mach/irq.h | 2 +-
arch/arm/include/asm/smp.h | 4 ++--
arch/arm/kernel/fiq.c | 5 +++--
arch/arm/kernel/irq.c | 16 ++++++++++------
arch/arm/kernel/smp.c | 14 +++++++-------
5 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
index ce3eee9..2bc47fb 100644
--- a/arch/arm/include/asm/mach/irq.h
+++ b/arch/arm/include/asm/mach/irq.h
@@ -20,7 +20,7 @@ struct seq_file;
extern unsigned int arch_nr_irqs;
extern void (*init_arch_irq)(void);
extern void init_FIQ(void);
-extern int show_fiq_list(struct seq_file *, void *);
+extern int show_fiq_list(struct seq_file *, int);
/*
* This is for easy migration, but should be changed in the source
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index da7e7ca..f93d0a6 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -33,7 +33,7 @@ struct seq_file;
/*
* generate IPI list text
*/
-extern void show_ipi_list(struct seq_file *p);
+extern void show_ipi_list(struct seq_file *, int);
/*
* Called from assembly code, this handles an IPI.
@@ -97,6 +97,6 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
/*
* show local interrupt info
*/
-extern void show_local_irqs(struct seq_file *);
+extern void show_local_irqs(struct seq_file *, int);
#endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index 6ff7919..47837b8 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -67,10 +67,11 @@ static struct fiq_handler default_owner = {
static struct fiq_handler *current_fiq = &default_owner;
-int show_fiq_list(struct seq_file *p, void *v)
+int show_fiq_list(struct seq_file *p, int prec)
{
if (current_fiq != &default_owner)
- seq_printf(p, "FIQ: %s\n", current_fiq->name);
+ seq_printf(p, "%*s: %s\n", prec, "FIQ",
+ current_fiq->name);
return 0;
}
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index ea29721..4e7a7d2 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -57,11 +57,15 @@ int show_interrupts(struct seq_file *p, void *v)
struct irq_desc *desc;
struct irqaction * action;
unsigned long flags;
+ int prec, n;
+
+ for (prec = 3, n = 1000; prec < 10 && n <= nr_irqs; prec++)
+ n *= 10;
if (i == 0) {
char cpuname[12];
- seq_printf(p, " ");
+ seq_printf(p, "%*s ", prec, "");
for_each_present_cpu(cpu) {
sprintf(cpuname, "CPU%d", cpu);
seq_printf(p, " %10s", cpuname);
@@ -76,7 +80,7 @@ int show_interrupts(struct seq_file *p, void *v)
if (!action)
goto unlock;
- seq_printf(p, "%3d: ", i);
+ seq_printf(p, "%*d: ", prec, i);
for_each_present_cpu(cpu)
seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
seq_printf(p, " %10s", desc->chip->name ? : "-");
@@ -89,15 +93,15 @@ unlock:
raw_spin_unlock_irqrestore(&desc->lock, flags);
} else if (i == nr_irqs) {
#ifdef CONFIG_FIQ
- show_fiq_list(p, v);
+ show_fiq_list(p, prec);
#endif
#ifdef CONFIG_SMP
- show_ipi_list(p);
+ show_ipi_list(p, prec);
#endif
#ifdef CONFIG_LOCAL_TIMERS
- show_local_irqs(p);
+ show_local_irqs(p, prec);
#endif
- seq_printf(p, "Err: %10lu\n", irq_err_count);
+ seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
}
return 0;
}
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index edb8fd5..d0e36e3 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -396,16 +396,16 @@ void arch_send_call_function_single_ipi(int cpu)
send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE);
}
-void show_ipi_list(struct seq_file *p)
+void show_ipi_list(struct seq_file *p, int prec)
{
unsigned int cpu;
- seq_puts(p, "IPI:");
+ seq_printf(p, "%*s: ", prec, "IPI");
for_each_present_cpu(cpu)
- seq_printf(p, " %10u", __get_irq_stat(cpu, ipi_irqs));
+ seq_printf(p, "%10u ", __get_irq_stat(cpu, ipi_irqs));
- seq_putc(p, '\n');
+ seq_printf(p, " Inter-processor interrupts\n");
}
/*
@@ -435,16 +435,16 @@ asmlinkage void __exception do_local_timer(struct pt_regs *regs)
set_irq_regs(old_regs);
}
-void show_local_irqs(struct seq_file *p)
+void show_local_irqs(struct seq_file *p, int prec)
{
unsigned int cpu;
- seq_printf(p, "LOC: ");
+ seq_printf(p, "%*s: ", prec, "LOC");
for_each_present_cpu(cpu)
seq_printf(p, "%10u ", __get_irq_stat(cpu, local_timer_irqs));
- seq_putc(p, '\n');
+ seq_printf(p, " Local timer interrupts\n");
}
#endif
--
1.6.2.5
next prev parent reply other threads:[~2010-11-15 17:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-15 17:55 [PATCH 0/9] Clean up SMP IPI support Russell King - ARM Linux
2010-11-15 17:58 ` [PATCH 1/9] ARM: remove obsolete smp_cross_call_done() Russell King - ARM Linux
2010-11-15 17:58 ` [PATCH 2/9] ARM: smp: pass an ipi number to smp_cross_call() Russell King - ARM Linux
2010-11-17 11:05 ` Catalin Marinas
2010-11-15 17:58 ` [PATCH 3/9] ARM: smp: avoid using bitmasks and locks for IPIs, use hardware instead Russell King - ARM Linux
2010-11-17 17:06 ` Catalin Marinas
2010-11-17 17:19 ` Russell King - ARM Linux
2010-11-17 17:28 ` Catalin Marinas
2010-11-15 17:58 ` [PATCH 4/9] ARM: include local timer irq stats only when local timers configured Russell King - ARM Linux
2010-11-15 17:58 ` [PATCH 5/9] ARM: smp: provide accessors for irq_stat data Russell King - ARM Linux
2010-11-15 17:58 ` [PATCH 6/9] ARM: smp: move ipi_count into irq_stat structure Russell King - ARM Linux
2010-11-15 17:59 ` Russell King - ARM Linux [this message]
2010-11-15 17:59 ` [PATCH 8/9] ARM: smp: provide individual IPI interrupt statistics Russell King - ARM Linux
2010-11-15 17:59 ` [PATCH 9/9] ARM: smp: collect IPI and local timer IRQs for /proc/stat Russell King - ARM Linux
2010-11-17 17:07 ` [PATCH 0/9] Clean up SMP IPI support Catalin Marinas
2010-11-17 17:17 ` Catalin Marinas
2010-11-17 17:21 ` Russell King - ARM Linux
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=E1PI3Kb-00029u-3U@rmk-PC.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.