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 0/3] kmemleak report format changes
Date: Tue, 25 Apr 2023 16:24:43 -0600	[thread overview]
Message-ID: <20230425222446.170486-1-jim.cromie@gmail.com> (raw)

If format changes are not /sys/** ABI violating, heres 3 minor ones:

1st strips "age <increasing>" from output.  This makes the output
idempotent; unchanging until a new leak is reported.

2nd adds the backtrace.checksum to the "backtrace:" line.  This lets a
user see repeats without actually reading the whole backtrace.  So now
the backtrace line looks like this:

  backtrace (ck 603070071):  # also see below

Q: should ck be spelled crc ? it feels more communicative.

NB: with ck exposed, it becomes possible to do a "selective clear",
something like:

  echo drop 603070071 > /sys/kernel/debug/kmemleak

The 3rd patch takes __init off of kmemleak_test_init().  This fixes a
bare-pointer in the 2nd line of the backtrace below, which previously
looked like:

    [<00000000ef738764>] 0xffffffffc02350a2

NB: this happens still/again, after rmmod kmemleak-test.

unreferenced object 0xffff888005d9ca40 (size 32):
  comm "modprobe", pid 412, jiffies 4294703300
  hex dump (first 32 bytes):
    00 cd d9 05 80 88 ff ff 40 cf d9 05 80 88 ff ff  ........@.......
    14 a7 c4 f6 7d f9 87 10 00 00 00 00 00 00 00 00  ....}...........
  backtrace (ck 1354775490):
    [<000000002c474f61>] kmalloc_trace+0x26/0x90
    [<00000000b26599c1>] kmemleak_test_init+0x58/0x2d0 [kmemleak_test]
    [<0000000044d13990>] do_one_initcall+0x43/0x210
    [<00000000131bc505>] do_init_module+0x4a/0x210
    [<00000000b2902890>] __do_sys_finit_module+0x93/0xf0
    [<00000000673fdce2>] do_syscall_64+0x34/0x80
    [<00000000357a2d80>] entry_SYSCALL_64_after_hwframe+0x46/0xb0


Jim Cromie (3):
  kmemleak: drop (age <increasing>) from leak record
  kmemleak: add checksum to backtrace report
  kmemleak-test: drop __init to get better backtrace

 mm/kmemleak.c                    | 8 +++-----
 samples/kmemleak/kmemleak-test.c | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

-- 
2.40.0



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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 22:24 Jim Cromie [this message]
2023-04-25 22:24 ` [PATCH 1/3] kmemleak: drop (age <increasing>) from leak record Jim Cromie
2023-04-25 22:24 ` [PATCH 2/3] kmemleak: add checksum to backtrace report Jim Cromie
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-1-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