summaryrefslogtreecommitdiffstats
path: root/mm/kmemleak.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-10-28 14:33:12 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2009-10-28 18:07:54 +0100
commitfefdd336b2a2f7617e0c8a0777c731d9ed6454ae (patch)
treee70e4478b5713863da5fc7fbd29f4d5a63ed559b /mm/kmemleak.c
parentkmemleak: Release the object lock before calling put_object() (diff)
downloadlinux-fefdd336b2a2f7617e0c8a0777c731d9ed6454ae.tar.xz
linux-fefdd336b2a2f7617e0c8a0777c731d9ed6454ae.zip
kmemleak: Show the age of an unreferenced object
The jiffies shown for unreferenced objects isn't always meaningful to people debugging kernel memory leaks. This patch adds the age as well to the displayed information. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'mm/kmemleak.c')
-rw-r--r--mm/kmemleak.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index f06c0921e472..ce79d91eeef7 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -346,11 +346,13 @@ static void print_unreferenced(struct seq_file *seq,
struct kmemleak_object *object)
{
int i;
+ unsigned int msecs_age = jiffies_to_msecs(jiffies - object->jiffies);
seq_printf(seq, "unreferenced object 0x%08lx (size %zu):\n",
object->pointer, object->size);
- seq_printf(seq, " comm \"%s\", pid %d, jiffies %lu\n",
- object->comm, object->pid, object->jiffies);
+ seq_printf(seq, " comm \"%s\", pid %d, jiffies %lu (age %d.%03ds)\n",
+ object->comm, object->pid, object->jiffies,
+ msecs_age / 1000, msecs_age % 1000);
hex_dump_object(seq, object);
seq_printf(seq, " backtrace:\n");