diff mbox series

[-next,4/5] mm/kmemleak-test: use %px instead of %p in print

Message ID 20200921020007.35803-5-chenjun102@huawei.com
State New
Headers show
Series mm/kmemleak´╝Üsupport for percpu memory leak detect | expand

Commit Message

Chen Jun Sept. 21, 2020, 2 a.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Real addresses are used for diagnose issues.
Convert %p with %px to print kernel addresses.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Chen Jun <chenjun102@huawei.com>
---
 mm/kmemleak-test.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

Comments

Catalin Marinas Sept. 22, 2020, 9:58 a.m. UTC | #1
On Mon, Sep 21, 2020 at 02:00:06AM +0000, Chen Jun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Real addresses are used for diagnose issues.
> Convert %p with %px to print kernel addresses.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Signed-off-by: Chen Jun <chenjun102@huawei.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
diff mbox series

Patch

diff --git a/mm/kmemleak-test.c b/mm/kmemleak-test.c
index e19279ff6aa3..75fe1b8c3226 100644
--- a/mm/kmemleak-test.c
+++ b/mm/kmemleak-test.c
@@ -40,25 +40,25 @@  static int __init kmemleak_test_init(void)
 	pr_info("Kmemleak testing\n");
 
 	/* make some orphan objects */
-	pr_info("kmalloc(32) = %p\n", kmalloc(32, GFP_KERNEL));
-	pr_info("kmalloc(32) = %p\n", kmalloc(32, GFP_KERNEL));
-	pr_info("kmalloc(1024) = %p\n", kmalloc(1024, GFP_KERNEL));
-	pr_info("kmalloc(1024) = %p\n", kmalloc(1024, GFP_KERNEL));
-	pr_info("kmalloc(2048) = %p\n", kmalloc(2048, GFP_KERNEL));
-	pr_info("kmalloc(2048) = %p\n", kmalloc(2048, GFP_KERNEL));
-	pr_info("kmalloc(4096) = %p\n", kmalloc(4096, GFP_KERNEL));
-	pr_info("kmalloc(4096) = %p\n", kmalloc(4096, GFP_KERNEL));
+	pr_info("kmalloc(32) = %px\n", kmalloc(32, GFP_KERNEL));
+	pr_info("kmalloc(32) = %px\n", kmalloc(32, GFP_KERNEL));
+	pr_info("kmalloc(1024) = %px\n", kmalloc(1024, GFP_KERNEL));
+	pr_info("kmalloc(1024) = %px\n", kmalloc(1024, GFP_KERNEL));
+	pr_info("kmalloc(2048) = %px\n", kmalloc(2048, GFP_KERNEL));
+	pr_info("kmalloc(2048) = %px\n", kmalloc(2048, GFP_KERNEL));
+	pr_info("kmalloc(4096) = %px\n", kmalloc(4096, GFP_KERNEL));
+	pr_info("kmalloc(4096) = %px\n", kmalloc(4096, GFP_KERNEL));
 #ifndef CONFIG_MODULES
-	pr_info("kmem_cache_alloc(files_cachep) = %p\n",
+	pr_info("kmem_cache_alloc(files_cachep) = %px\n",
 		kmem_cache_alloc(files_cachep, GFP_KERNEL));
-	pr_info("kmem_cache_alloc(files_cachep) = %p\n",
+	pr_info("kmem_cache_alloc(files_cachep) = %px\n",
 		kmem_cache_alloc(files_cachep, GFP_KERNEL));
 #endif
-	pr_info("vmalloc(64) = %p\n", vmalloc(64));
-	pr_info("vmalloc(64) = %p\n", vmalloc(64));
-	pr_info("vmalloc(64) = %p\n", vmalloc(64));
-	pr_info("vmalloc(64) = %p\n", vmalloc(64));
-	pr_info("vmalloc(64) = %p\n", vmalloc(64));
+	pr_info("vmalloc(64) = %px\n", vmalloc(64));
+	pr_info("vmalloc(64) = %px\n", vmalloc(64));
+	pr_info("vmalloc(64) = %px\n", vmalloc(64));
+	pr_info("vmalloc(64) = %px\n", vmalloc(64));
+	pr_info("vmalloc(64) = %px\n", vmalloc(64));
 
 	/*
 	 * Add elements to a list. They should only appear as orphan
@@ -66,7 +66,7 @@  static int __init kmemleak_test_init(void)
 	 */
 	for (i = 0; i < 10; i++) {
 		elem = kzalloc(sizeof(*elem), GFP_KERNEL);
-		pr_info("kzalloc(sizeof(*elem)) = %p\n", elem);
+		pr_info("kzalloc(sizeof(*elem)) = %px\n", elem);
 		if (!elem)
 			return -ENOMEM;
 		INIT_LIST_HEAD(&elem->list);
@@ -75,7 +75,7 @@  static int __init kmemleak_test_init(void)
 
 	for_each_possible_cpu(i) {
 		per_cpu(kmemleak_test_pointer, i) = kmalloc(129, GFP_KERNEL);
-		pr_info("kmalloc(129) = %p\n",
+		pr_info("kmalloc(129) = %px\n",
 			per_cpu(kmemleak_test_pointer, i));
 	}