8eb008
--- crash-trace-command-2.0/trace.c.orig
8eb008
+++ crash-trace-command-2.0/trace.c
8eb008
@@ -96,7 +96,7 @@ struct ring_buffer_per_cpu {
8eb008
 	ulong real_head_page;
8eb008
 
8eb008
 	int head_page_index;
8eb008
-	unsigned int nr_pages;
8eb008
+	unsigned long nr_pages;
8eb008
 	ulong *pages;
8eb008
 
8eb008
 	ulong *linear_pages;
8eb008
@@ -430,7 +432,13 @@ static int ftrace_init_buffers(struct ri
8eb008
 		buffer_read_value(overrun);
8eb008
 		buffer_read_value(entries);
8eb008
 		if (per_cpu_buffer_sizes) {
8eb008
-			buffer_read_value(nr_pages);
8eb008
+			if (MEMBER_SIZE("ring_buffer_per_cpu", "nr_pages") == sizeof(unsigned int)) {
8eb008
+				unsigned int tmp_nr_pages;
8eb008
+				read_value(tmp_nr_pages, buffers[i].kaddr, ring_buffer_per_cpu, nr_pages);
8eb008
+				buffers[i].nr_pages = (unsigned long) tmp_nr_pages;
8eb008
+			} else {
8eb008
+				buffer_read_value(nr_pages);
8eb008
+			}
8eb008
 			pages = buffers[i].nr_pages;
8eb008
 		} else
8eb008
 			buffers[i].nr_pages = pages;