mm: simplify and improve print_vma_addr() output

Use '%pD' to print out the filename, and print out the actual offset
within the file too, rather than just what the virtual address of the
mapping is (which doesn't tell you anything about any mapping offsets).

Also, use the exact vma_lookup() instead of find_vma() - the latter
looks up any vma _after_ the address, which is of questionable value
(yes, maybe you fell off the beginning, but you'd be more likely to fall
off the end).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+6 -13
+6 -13
mm/memory.c
··· 6210 6210 if (!mmap_read_trylock(mm)) 6211 6211 return; 6212 6212 6213 - vma = find_vma(mm, ip); 6213 + vma = vma_lookup(mm, ip); 6214 6214 if (vma && vma->vm_file) { 6215 6215 struct file *f = vma->vm_file; 6216 - char *buf = (char *)__get_free_page(GFP_NOWAIT); 6217 - if (buf) { 6218 - char *p; 6219 - 6220 - p = file_path(f, buf, PAGE_SIZE); 6221 - if (IS_ERR(p)) 6222 - p = "?"; 6223 - printk("%s%s[%lx+%lx]", prefix, kbasename(p), 6224 - vma->vm_start, 6225 - vma->vm_end - vma->vm_start); 6226 - free_page((unsigned long)buf); 6227 - } 6216 + ip -= vma->vm_start; 6217 + ip += vma->vm_pgoff << PAGE_SHIFT; 6218 + printk("%s%pD[%lx,%lx+%lx]", prefix, f, ip, 6219 + vma->vm_start, 6220 + vma->vm_end - vma->vm_start); 6228 6221 } 6229 6222 mmap_read_unlock(mm); 6230 6223 }