public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] - prof_cpu_mask problems
@ 2003-11-16 19:30 Jack Steiner
  2003-11-16 21:25 ` Matthew Wilcox
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Jack Steiner @ 2003-11-16 19:30 UTC (permalink / raw)
  To: linux-ia64


I ran into several problems with the prof_cpu_mask & other
irq masks.

	- Displaying the profiling mask via "cat /proc/irq/prof_cpu_mask"
	  clears the mask.

	- the IRQ masks are displayed in an unusual format:
		# echo 12345678 >prof_cpu_mask
		# cat prof_cpu_mask
		5678123400000000



--- linux_base/arch/ia64/kernel/irq.c	Sun Nov 16 13:02:56 2003
+++ linux/arch/ia64/kernel/irq.c	Sun Nov 16 13:28:30 2003
@@ -974,18 +974,18 @@
 static int irq_affinity_read_proc (char *page, char **start, off_t off,
 			int count, int *eof, void *data)
 {
-	int k, len;
-	cpumask_t tmp = irq_affinity[(long)data];
+	cpumask_t mask, irqmask = irq_affinity[(long)data];
+	int i, j, k, len = 0;
 
 	if (count < HEX_DIGITS+1)
 		return -EINVAL;
 
-	len = 0;
-	for (k = 0; k < sizeof(cpumask_t)/sizeof(u16); ++k) {
-		int j = sprintf(page, "%04hx", (u16)cpus_coerce(tmp));
+	i = sizeof(cpumask_t)/sizeof(u16);
+	for (k = 0; k < i; ++k) {
+		cpus_shift_right(mask, irqmask, 16*(i-k-1));
+		j = sprintf(page, "%04hx", (u16)cpus_coerce(mask));
 		len += j;
 		page += j;
-		cpus_shift_right(tmp, tmp, 16);
 	}
 	len += sprintf(page, "\n");
 	return len;
@@ -1033,17 +1033,18 @@
 static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
 			int count, int *eof, void *data)
 {
-	cpumask_t *mask = (cpumask_t *)data;
-	int k, len = 0;
+	cpumask_t mask, profmask = *(cpumask_t *)data;
+	int i, j, k, len = 0;
 
 	if (count < HEX_DIGITS+1)
 		return -EINVAL;
 
-	for (k = 0; k < sizeof(cpumask_t)/sizeof(u16); ++k) {
-		int j = sprintf(page, "%04hx", (u16)cpus_coerce(*mask));
+	i = sizeof(cpumask_t)/sizeof(u16);
+	for (k = 0; k < i; ++k) {
+		cpus_shift_right(mask, profmask, 16*(i-k-1));
+		j = sprintf(page, "%04hx", (u16)cpus_coerce(mask));
 		len += j;
 		page += j;
-		cpus_shift_right(*mask, *mask, 16);
 	}
 	len += sprintf(page, "\n");
 	return len;
-- 
Thanks

Jack Steiner (steiner@sgi.com)          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-11-20  4:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-16 19:30 [PATCH] - prof_cpu_mask problems Jack Steiner
2003-11-16 21:25 ` Matthew Wilcox
2003-11-17 17:16 ` Luck, Tony
2003-11-17 17:30 ` Matthew Wilcox
2003-11-19 21:45 ` Paul Jackson
2003-11-19 22:54 ` William Lee Irwin III
2003-11-20  2:17 ` Paul Jackson
2003-11-20  2:38 ` Paul Jackson
2003-11-20  2:47 ` William Lee Irwin III
2003-11-20  2:59 ` Paul Jackson
2003-11-20  4:47 ` Paul Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox