lkml.org 
[lkml]   [2003]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: /proc/stat's intr field looks odd, although /proc/interrupts seems correct
On Mon, 11 Aug 2003, Zwane Mwaikambo wrote:

> On i386 you can find out the last irq line number during MP table parsing
> (ACPI bits are also in mpparse.c), for the hotplug case i suppose the
> hotplug code could bump this up as devices get attached. But unless we do
> dynamic NR_IRQs its all just too much effort.

Boring weekend...

Index: linux-2.6.0-test3-huge_kpage/fs/proc/proc_misc.c
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test3/fs/proc/proc_misc.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 proc_misc.c
--- linux-2.6.0-test3-huge_kpage/fs/proc/proc_misc.c 10 Aug 2003 08:42:45 -0000 1.1.1.1
+++ linux-2.6.0-test3-huge_kpage/fs/proc/proc_misc.c 11 Aug 2003 05:49:54 -0000
@@ -411,8 +411,19 @@ static int kstat_read_proc(char *page, c
len += sprintf(page + len, "intr %u", sum);

#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA)
- for (i = 0 ; i < NR_IRQS ; i++)
+{
+ static int last_irq = 0;
+
+ for (i = last_irq; i < NR_IRQS; i++) {
+ if (irq_desc[i].action) {
+ if (i > last_irq)
+ last_irq = i;
+ }
+ }
+
+ for (i = 0 ; i <= last_irq ; i++)
len += sprintf(page + len, " %u", kstat_irqs(i));
+}
#endif

len += sprintf(page + len,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.045 / U:1.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site