linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jim Cromie <jim.cromie@gmail.com>
To: catalin.marinas@arm.com, linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH 2/3] kmemleak: add checksum to backtrace report
Date: Tue, 25 Apr 2023 16:24:45 -0600	[thread overview]
Message-ID: <20230425222446.170486-3-jim.cromie@gmail.com> (raw)
In-Reply-To: <20230425222446.170486-1-jim.cromie@gmail.com>

change kmemleak report format:

from: "  backtrace:"
to:   "  backtrace (ck <cksum>):"

The <cksum> allows a user to see recurring backtraces without
detailed/careful reading of multiline backtraces.  So after cycling
kmemleak-test a few times, I know some leaks are repeating.

  bash-5.2# grep backtrace /sys/kernel/debug/kmemleak | wc
     62     186    1792
  bash-5.2# grep backtrace /sys/kernel/debug/kmemleak | sort -u | wc
     37     111    1067

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 mm/kmemleak.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index f025c7bc845b..2d1dfed4293d 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -362,7 +362,7 @@ static void print_unreferenced(struct seq_file *seq,
 	warn_or_seq_printf(seq, "  comm \"%s\", pid %d, jiffies %lu\n",
 			   object->comm, object->pid, object->jiffies);
 	hex_dump_object(seq, object);
-	warn_or_seq_printf(seq, "  backtrace:\n");
+	warn_or_seq_printf(seq, "  backtrace (ck %u):\n", object->checksum);
 
 	for (i = 0; i < nr_entries; i++) {
 		void *ptr = (void *)entries[i];
-- 
2.40.0



  parent reply	other threads:[~2023-04-25 22:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 22:24 [PATCH 0/3] kmemleak report format changes Jim Cromie
2023-04-25 22:24 ` [PATCH 1/3] kmemleak: drop (age <increasing>) from leak record Jim Cromie
2023-04-25 22:24 ` Jim Cromie [this message]
2023-04-25 22:24 ` [PATCH 3/3] kmemleak-test: drop __init to get better backtrace Jim Cromie
2023-04-28 17:11   ` Catalin Marinas
2023-04-28 17:25 ` [PATCH 0/3] kmemleak report format changes Catalin Marinas
2023-11-11  0:19   ` jim.cromie
2023-11-16 17:56     ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230425222446.170486-3-jim.cromie@gmail.com \
    --to=jim.cromie@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox