lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Apr 2012 21:10:05 +0530
From:	Sasikantha babu <sasikanth.v19@...il.com>
To:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Daniel Lezcano <daniel.lezcano@...e.fr>
Cc:	Kevin Tian <kevin.tian@...el.com>,
	Fengzhe Zhang <fengzhe.zhang@...el.com>,
	Fernando Luis Vazquez Cao <fernando@....ntt.co.jp>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Marc Zyngier <marc.zyngier@....com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Mike Frysinger <vapier@...too.org>,
	linux-kernel@...r.kernel.org, x86@...nel.org,
	Sasikantha babu <sasikanth.v19@...il.com>
Subject: [PATCH 3/3] Modified generic show_interrupts to display per-CPU interrupts information


Signed-off-by: Sasikantha babu <sasikanth.v19@...il.com>
---
 kernel/irq/proc.c |   39 ++++++++++++++++++++++++++++++---------
 1 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 4bd4faa..bc5eaeb 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -410,6 +410,10 @@ int __weak arch_show_interrupts(struct seq_file *p, int prec)
 {
 	return 0;
 }
+int __weak arch_show_interrupts_cpu (struct seq_file *p, int prec, int cpu)
+{
+	return 0;
+}
 
 #ifndef ACTUAL_NR_IRQS
 # define ACTUAL_NR_IRQS nr_irqs
@@ -423,12 +427,20 @@ int show_interrupts(struct seq_file *p, void *v)
 	int i = *(loff_t *) v, j;
 	struct irqaction *action;
 	struct irq_desc *desc;
-
+        int cpu = -1;
+	
 	if (i > ACTUAL_NR_IRQS)
 		return 0;
 
-	if (i == ACTUAL_NR_IRQS)
-		return arch_show_interrupts(p, prec);
+	if (p->private)
+		cpu += (int) p->private;
+
+	if (i == ACTUAL_NR_IRQS) {
+		if (cpu < 0)
+			return arch_show_interrupts (p, prec);
+		else
+			return arch_show_interrupts_cpu (p, prec, cpu);
+	}
 
 	/* print header and calculate the width of the first column */
 	if (i == 0) {
@@ -436,8 +448,11 @@ int show_interrupts(struct seq_file *p, void *v)
 			j *= 10;
 
 		seq_printf(p, "%*s", prec + 8, "");
-		for_each_online_cpu(j)
-			seq_printf(p, "CPU%-8d", j);
+		if (cpu < 0) {
+			for_each_online_cpu(j)
+				seq_printf(p, "CPU%-8d", j);
+		} else
+			seq_printf(p, "CPU%-8d", cpu);
 		seq_putc(p, '\n');
 	}
 
@@ -446,15 +461,21 @@ int show_interrupts(struct seq_file *p, void *v)
 		return 0;
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	for_each_online_cpu(j)
-		any_count |= kstat_irqs_cpu(i, j);
+	if (cpu < 0) {
+		for_each_online_cpu(j)
+			any_count |= kstat_irqs_cpu(i, j);
+	} else
+		any_count |= kstat_irqs_cpu(i, cpu);
 	action = desc->action;
 	if (!action && !any_count)
 		goto out;
 
 	seq_printf(p, "%*d: ", prec, i);
-	for_each_online_cpu(j)
-		seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
+	if (cpu < 0) {
+		for_each_online_cpu(j)
+			seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
+	} else
+		seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
 
 	if (desc->irq_data.chip) {
 		if (desc->irq_data.chip->irq_print_chip)
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ