mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
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>
This commit is contained in:
parent
0587da40be
commit
fefdd336b2
1 changed files with 4 additions and 2 deletions
|
@ -346,11 +346,13 @@ static void print_unreferenced(struct seq_file *seq,
|
||||||
struct kmemleak_object *object)
|
struct kmemleak_object *object)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
unsigned int msecs_age = jiffies_to_msecs(jiffies - object->jiffies);
|
||||||
|
|
||||||
seq_printf(seq, "unreferenced object 0x%08lx (size %zu):\n",
|
seq_printf(seq, "unreferenced object 0x%08lx (size %zu):\n",
|
||||||
object->pointer, object->size);
|
object->pointer, object->size);
|
||||||
seq_printf(seq, " comm \"%s\", pid %d, jiffies %lu\n",
|
seq_printf(seq, " comm \"%s\", pid %d, jiffies %lu (age %d.%03ds)\n",
|
||||||
object->comm, object->pid, object->jiffies);
|
object->comm, object->pid, object->jiffies,
|
||||||
|
msecs_age / 1000, msecs_age % 1000);
|
||||||
hex_dump_object(seq, object);
|
hex_dump_object(seq, object);
|
||||||
seq_printf(seq, " backtrace:\n");
|
seq_printf(seq, " backtrace:\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue