Hi, 

I got really odd values on one of my servers, [extra timer interrupt]
just kept increasing with time.

Example:
Wakeups-from-idle per second : 304.4    interval: 10.0s
no ACPI power usage estimate available

Top causes for wakeups:
  67.9% (1083.0)   [extra timer interrupt]
  16.7% (265.8)   [eth1] <interrupt>
   7.2% (114.7)   qemu-system-x86
   2.0% ( 32.6)   [ahci] <interrupt>

1093? It's been up to 3000.

Anyways, eventually started to look in to the source and found
something, my output is now:
Wakeups-from-idle per second : 160.2    interval: 10.0s
no ACPI power usage estimate available

Top causes for wakeups:
  34.1% (253.2)   [Local timer interrupts] <kernel IPI>
  19.5% (144.7)   [extra timer interrupt]
  15.6% (115.8)   qemu-system-x86
   6.2% ( 46.2)   [Rescheduling interrupts] <kernel IPI>

Which looks a bit nicer =)

About the patch:
Since i scramble the letters in to a int, you might want to check what
the lower values is on all machines, ie could there be a machine that
gets a irq that has a value large enough to actually collide?

Also, the values are also bigger than before, if they are used to index
a array or something somewhere, we'll be wasting memory...

Comments? Suggestions? Fun trivia?

PS. I'm not subscribed, remember to CC
DS.

-- 
Ian Kumlien <pomac () vapor ! com> -- http://pomac.netswarm.net 
http://demius.net
diff --git a/powertop.c b/powertop.c
index 74eb328..896f83d 100644
--- a/powertop.c
+++ b/powertop.c
@@ -241,6 +241,7 @@ static void do_proc_irq(void)
 		return;
 	while (!feof(file)) {
 		char *c;
+		char *start;
 		int nr = -1;
 		uint64_t count = 0;
 		int special = 0;
@@ -252,22 +253,19 @@ static void do_proc_irq(void)
 		if (!c)
 			continue;
 		/* deal with NMI and the like.. make up fake nrs */
-		if (line[0] != ' ' && (line[0] < '0' || line[0] > '9')) {
-			if (strncmp(line,"NMI:", 4)==0)
-				nr=20000;
-			if (strncmp(line,"RES:", 4)==0)
-				nr=20001;
-			if (strncmp(line,"CAL:", 4)==0)
-				nr=20002;
-			if (strncmp(line,"TLB:", 4)==0)
-				nr=20003;
-			if (strncmp(line,"TRM:", 4)==0)
-				nr=20004;
-			if (strncmp(line,"THR:", 4)==0)
-				nr=20005;
-			if (strncmp(line,"SPU:", 4)==0)
-				nr=20006;
+		start = line;
+		while (*start == ' ')
+			start++;
+		if (isalpha(*start))
+		{
+			/* We now know that the interrupt is not a number and
+			 * thus special, we can also assume that the interrupt 
+			 * label should be at least four letters, like "NMI:"
+			 */
+#define MAKE4(a, b, c, d) (int)((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
+			nr = MAKE4(start[0],start[1],start[2],start[3]);
 			special = 1;
+#undef MAKE4
 		} else
 			nr = strtoull(line, NULL, 10);
 

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Power mailing list
[email protected]
http://www.bughost.org/mailman/listinfo/power

Reply via email to