Skip to contentSkip to conversation

staging: android: lowmemorykiller: well-marked debug print

PATCH In review Dmitry Voytik 3 participants 5 messages Mar 15, 2013 – Mar 16, 2013 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: android: lowmemorykiller: well-marked debug print

Add "lmk:" prefix to the debug print so it's easier to analyse LMK's debug output:
dmesg | grep lmk

---
 drivers/staging/android/lowmemorykiller.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/lowmemorykiller.c +1 -1
index 3b91b0f..4ea7b70 100644
@@ -60,7 +60,7 @@ static unsigned long lowmem_deathpending_timeout;
 #define lowmem_print(level, x...)			\
 	do {						\
 		if (lowmem_debug_level >= (level))	\
-			printk(x);			\
+			pr_info("lmk: " x);		\
 	} while (0)
 
 static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 3 lines · Dmitry Voytik

Add "lmk:" prefix to the debug print so it's easier to analyse LMK's debug output:
dmesg | grep lmk

Ick, no, please use the proper interface for this (i.e. pr_fmt).

greg k-h

#2 lore raw
Quoted 6 lines · Greg Kroah-Hartman
Quoted 3 lines

Add "lmk:" prefix to the debug print so it's easier to analyse LMK's debug output:
dmesg | grep lmk

Ick, no, please use the proper interface for this (i.e. pr_fmt).

And I'm sure that mysterious new "lmk:" messages appearing in the kernel log will be understood by about 0.00001% of people.

#3 lore raw
Quoted 5 lines · David Rientjes
Quoted 2 lines

Ick, no, please use the proper interface for this (i.e. pr_fmt).

And I'm sure that mysterious new "lmk:" messages appearing in the kernel log will be understood by about 0.00001% of people.

David, Greg,

Thank you for fair comments. In the following e-mail I'll send the fixed patch according to your comments.

#4 lore raw

PATCH 1/1 staging: android: lowmemorykiller: well-marked debug print

In reply to David Rientjes

Add "lowmemorykiller:" prefix to the debug print so it's easier to analyse LMK's debug output:
dmesg | grep lowmemorykiller

---
 drivers/staging/android/lowmemorykiller.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/android/lowmemorykiller.c +3 -1
index 53d80c2..fe74494 100644
@@ -30,6 +30,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -61,7 +63,7 @@ static unsigned long lowmem_deathpending_timeout;
 #define lowmem_print(level, x...)			\
 	do {						\
 		if (lowmem_debug_level >= (level))	\
-			printk(x);			\
+			pr_info(x);			\
 	} while (0)
 
 static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
Signature · 1 line
1.7.9.5