eventcounters: Do not display counters for zones that are not available on an arch
Remove the counter display for all zones that are not in use.
Signed-off-by: Christoph Lameter <[email protected]>
Index: linux-2.6.17-mm6/include/linux/vmstat.h
===================================================================
--- linux-2.6.17-mm6.orig/include/linux/vmstat.h 2006-07-03 13:58:32.623475826 -0700
+++ linux-2.6.17-mm6/include/linux/vmstat.h 2006-07-03 14:04:27.383794230 -0700
@@ -18,7 +18,17 @@
* generated will simply be the increment of a global address.
*/
-#define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH
+#ifdef CONFIG_DMA32
+#define FOR_ALL_LOWER_ZONES(xx) xx##_DMA, xx##_DMA32, xx##_NORMAL
+#else
+#define FOR_ALL_LOWER_ZONES(xx) xx##_DMA, xx##_NORMAL
+#endif
+
+#ifdef CONFIG_HIGHMEM
+#define FOR_ALL_ZONES(xx) FOR_ALL_LOWER_ZONES(xx), xx##_HIGH
+#else
+#define FOR_ALL_ZONES(xx) FOR_ALL_LOWER_ZONES(xx)
+#endif
enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
FOR_ALL_ZONES(PGALLOC),
Index: linux-2.6.17-mm6/mm/vmstat.c
===================================================================
--- linux-2.6.17-mm6.orig/mm/vmstat.c 2006-07-03 13:47:22.663933375 -0700
+++ linux-2.6.17-mm6/mm/vmstat.c 2006-07-03 14:04:27.383794230 -0700
@@ -381,6 +381,18 @@ struct seq_operations fragmentation_op =
.show = frag_show,
};
+#ifdef CONFIG_ZONE_DMA32
+#define TEXTS_FOR_LOWER_ZONES(xx) xx "_dma", xx "_dma32", xx "_normal"
+#else
+#define TEXTS_FOR_LOWER_ZONES(xx) xx "_dma", xx "_normal"
+#endif
+
+#ifdef CONFIG_HIGHMEM
+#define TEXTS_FOR_ZONES(xx) TEXTS_FOR_LOWER_ZONES(xx), xx "_high"
+#else
+#define TEXTS_FOR_ZONES(xx) TEXTS_FOR_LOWER_ZONES(xx)
+#endif
+
static char *vmstat_text[] = {
/* Zoned VM counters */
"nr_anon_pages",
@@ -408,10 +420,7 @@ static char *vmstat_text[] = {
"pswpin",
"pswpout",
- "pgalloc_dma",
- "pgalloc_dma32",
- "pgalloc_normal",
- "pgalloc_high",
+ TEXTS_FOR_ZONES("pgalloc"),
"pgfree",
"pgactivate",
@@ -420,25 +429,10 @@ static char *vmstat_text[] = {
"pgfault",
"pgmajfault",
- "pgrefill_dma",
- "pgrefill_dma32",
- "pgrefill_normal",
- "pgrefill_high",
-
- "pgsteal_dma",
- "pgsteal_dma32",
- "pgsteal_normal",
- "pgsteal_high",
-
- "pgscan_kswapd_dma",
- "pgscan_kswapd_dma32",
- "pgscan_kswapd_normal",
- "pgscan_kswapd_high",
-
- "pgscan_direct_dma",
- "pgscan_direct_dma32",
- "pgscan_direct_normal",
- "pgscan_direct_high",
+ TEXTS_FOR_ZONES("pgrefill"),
+ TEXTS_FOR_ZONES("pgsteal"),
+ TEXTS_FOR_ZONES("pgscan_kswapd"),
+ TEXTS_FOR_ZONES("pgscan_direct"),
"pginodesteal",
"slabs_scanned",
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]