[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210715031533.9553-13-justin.he@arm.com>
Date: Thu, 15 Jul 2021 11:15:32 +0800
From: Jia He <justin.he@....com>
To: linux-kernel@...r.kernel.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Christoph Hellwig <hch@...radead.org>, nd@....com,
Jia He <justin.he@....com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org
Subject: [PATCH RFC 12/13] mm: simplify the printing with '%pd' specifier
Use '%pd' to simplify the printing since kbasename(file_path()) is to
get the last dentry of the full path.
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Jia He <justin.he@....com>
---
mm/memory.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 747a01d495f2..350692ada6f7 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -5217,18 +5217,14 @@ void print_vma_addr(char *prefix, unsigned long ip)
vma = find_vma(mm, ip);
if (vma && vma->vm_file) {
struct file *f = vma->vm_file;
- char *buf = (char *)__get_free_page(GFP_NOWAIT);
- if (buf) {
- char *p;
-
- p = file_path(f, buf, PAGE_SIZE);
- if (IS_ERR(p))
- p = "?";
- printk("%s%s[%lx+%lx]", prefix, kbasename(p),
+
+ if (f)
+ printk("%s%pd[%lx+%lx]", prefix, f->f_path.dentry,
vma->vm_start,
vma->vm_end - vma->vm_start);
- free_page((unsigned long)buf);
- }
+ else
+ printk("%s?[%lx+%lx]", prefix, vma->vm_start,
+ vma->vm_end - vma->vm_start);
}
mmap_read_unlock(mm);
}
--
2.17.1
Powered by blists - more mailing lists