| To: | pcp@xxxxxxxxxxx |
|---|---|
| Subject: | [pcp] proc/interrupts parsing fix for large CPU counts |
| From: | Arthur Kepner <akepner@xxxxxxx> |
| Date: | Wed, 26 Jan 2011 13:33:28 -0800 |
| User-agent: | Mutt/1.5.19 (2009-01-05) |
The linux pmda assumes that /proc/interrupts contains lines formatted
like so:
123: 1 2 3 .....
i.e., the interrupt number is precisely 3 characters wide. It's
usually 4 characters wide on larger systems.
This fixes it.
---
diff --git a/src/pmdas/linux/proc_interrupts.c
b/src/pmdas/linux/proc_interrupts.c
index 63045c2..5b13a0b 100644
--- a/src/pmdas/linux/proc_interrupts.c
+++ b/src/pmdas/linux/proc_interrupts.c
@@ -73,9 +73,9 @@ refresh_proc_interrupts(proc_interrupts_t *proc_interrupts)
}
while (fgets(buf, sizeof(buf), fp) != NULL) {
- if (buf[3] != ':')
+ s = strchr(buf, ':');
+ if (s == NULL)
continue;
- s = buf + 3;
is_syscall = 0;
if (sscanf(buf, "%u:", &intr) != 1) {
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [pcp] pcp updates, Max Matveev |
|---|---|
| Next by Date: | Re: [pcp] proc/interrupts parsing fix for large CPU counts, Ken McDonell |
| Previous by Thread: | pcp updates - minor Mac OS X testing fallout, Ken McDonell |
| Next by Thread: | Re: [pcp] proc/interrupts parsing fix for large CPU counts, Ken McDonell |
| Indexes: | [Date] [Thread] [Top] [All Lists] |