Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1601835

[PATCH 3/3] mm: page_alloc: Break up a long single-line printk

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject [PATCH 3/3] mm: page_alloc: Break up a long single-line printk
Date 2017-03-16 02:50 +0100
Message-ID <tlsI9-7Ou-1@gated-at.bofh.it> (permalink)
References <tlsI9-7Ou-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Blocked multiple line output is easier to read than an
extremely long single line.

Miscellanea:

o Add "Node" prefix to each new line of the block

Signed-off-by: Joe Perches <joe@perches.com>
---
 mm/page_alloc.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6816bb167394..2d3c10734874 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4540,20 +4540,23 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
 		       " inactive_anon:%lukB"
 		       " active_file:%lukB"
 		       " inactive_file:%lukB"
-		       " unevictable:%lukB",
+		       " unevictable:%lukB"
+		       "\n",
 		       pgdat->node_id,
 		       K(node_page_state(pgdat, NR_ACTIVE_ANON)),
 		       K(node_page_state(pgdat, NR_INACTIVE_ANON)),
 		       K(node_page_state(pgdat, NR_ACTIVE_FILE)),
 		       K(node_page_state(pgdat, NR_INACTIVE_FILE)),
 		       K(node_page_state(pgdat, NR_UNEVICTABLE)));
-		printk(KERN_CONT
+		printk("Node %d"
 		       " isolated(anon):%lukB"
 		       " isolated(file):%lukB"
 		       " mapped:%lukB"
 		       " dirty:%lukB"
 		       " writeback:%lukB"
-		       " shmem:%lukB",
+		       " shmem:%lukB"
+		       "\n",
+		       pgdat->node_id,
 		       K(node_page_state(pgdat, NR_ISOLATED_ANON)),
 		       K(node_page_state(pgdat, NR_ISOLATED_FILE)),
 		       K(node_page_state(pgdat, NR_FILE_MAPPED)),
@@ -4561,20 +4564,23 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
 		       K(node_page_state(pgdat, NR_WRITEBACK)),
 		       K(node_page_state(pgdat, NR_SHMEM)));
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-		printk(KERN_CONT
+		printk("Node %d"
 		       " shmem_thp: %lukB"
 		       " shmem_pmdmapped: %lukB"
-		       " anon_thp: %lukB",
+		       " anon_thp: %lukB"
+		       "\n",
+		       pgdat->node_id,
 		       K(node_page_state(pgdat, NR_SHMEM_THPS) * HPAGE_PMD_NR),
 		       K(node_page_state(pgdat, NR_SHMEM_PMDMAPPED)
 			 * HPAGE_PMD_NR),
 		       K(node_page_state(pgdat, NR_ANON_THPS) * HPAGE_PMD_NR));
 #endif
-		printk(KERN_CONT
+		printk("Node %d"
 		       " writeback_tmp:%lukB"
 		       " unstable:%lukB"
 		       " all_unreclaimable? %s"
 		       "\n",
+		       pgdat->node_id,
 		       K(node_page_state(pgdat, NR_WRITEBACK_TEMP)),
 		       K(node_page_state(pgdat, NR_UNSTABLE_NFS)),
 		       pgdat->kswapd_failures >= MAX_RECLAIM_RETRIES ?
-- 
2.10.0.rc2.1.g053435c

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 3/3] mm: page_alloc: Break up a long single-line printk Joe Perches <joe@perches.com> - 2017-03-16 02:50 +0100
  Re: [PATCH 3/3] mm: page_alloc: Break up a long single-line printk Michal Hocko <mhocko@kernel.org> - 2017-03-16 12:00 +0100

csiph-web