From: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: kmemleak hexdump proposal
Date: Tue, 14 Jul 2009 13:33:56 +0300 [thread overview]
Message-ID: <20090714103356.GA2929@localdomain.by> (raw)
In-Reply-To: <1247566033.28240.46.camel@pc1117.cambridge.arm.com>
[-- Attachment #1: Type: text/plain, Size: 2526 bytes --]
On (07/14/09 11:07), Catalin Marinas wrote:
> Hi,
>
Hello Catalin,
> On Mon, 2009-06-29 at 21:10 +0100, Sergey Senozhatsky wrote:
> > This is actually draft. We'll discuss details during next merge window (or earlier).
>
> Better earlier (I plan to get some more kmemleak patches into
> linux-next).
>
> > hex dump prints not more than HEX_MAX_LINES lines by HEX_ROW_SIZE (16 or 32) bytes.
> > ( min(object->size, HEX_MAX_LINES * HEX_ROW_SIZE) ).
> >
> > Example (HEX_ROW_SIZE 16):
> >
> > unreferenced object 0xf68b59b8 (size 32):
> > comm "swapper", pid 1, jiffies 4294877610
> > hex dump (first 32 bytes):
> > 70 6e 70 20 30 30 3a 30 31 00 5a 5a 5a 5a 5a 5a pnp 00:01.ZZZZZZ
> > 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ.
>
> That's my preferred as I do not want to go beyond column 80.
>
Same with me.
> > diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> > index 5063873..65c5d74 100644
> > --- a/mm/kmemleak.c
> > +++ b/mm/kmemleak.c
> > @@ -160,6 +160,15 @@ struct kmemleak_object {
> > /* flag set to not scan the object */
> > #define OBJECT_NO_SCAN (1 << 2)
> >
> > +/* number of bytes to print per line; must be 16 or 32 */
> > +#define HEX_ROW_SIZE 32
>
> 16 here.
>
OK.
[...]
> > @@ -303,6 +343,11 @@ static void print_unreferenced(struct seq_file *seq,
> > object->pointer, object->size);
> > seq_printf(seq, " comm \"%s\", pid %d, jiffies %lu\n",
> > object->comm, object->pid, object->jiffies);
> > +
> > + /* check whether hex dump should be printed */
> > + if (atomic_read(&kmemleak_hex_dump))
> > + hex_dump_object(seq, object);
>
> No need for this check, just leave it in all cases (as we now only read
> the reports via the debug/kmemleak file.
>
> > @@ -1269,6 +1314,10 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
> > start_scan_thread();
> > else if (strncmp(buf, "scan=off", 8) == 0)
> > stop_scan_thread();
> > + else if (strncmp(buf, "hexdump=on", 10) == 0)
> > + atomic_set(&kmemleak_hex_dump, 1);
> > + else if (strncmp(buf, "hexdump=off", 11) == 0)
> > + atomic_set(&kmemleak_hex_dump, 0);
>
> Same here.
>
Am I understand correct that no way for user to on/off hexdump?
/* no need for atomic_t kmemleak_hex_dump */
> Thanks.
>
> --
> Catalin
>
Sergey
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 315 bytes --]
next prev parent reply other threads:[~2009-07-14 10:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-28 17:36 Sergey Senozhatsky
2009-06-29 9:43 ` Pekka Enberg
2009-06-29 9:48 ` Catalin Marinas
2009-06-29 10:19 ` Sergey Senozhatsky
2009-06-29 10:19 ` Pekka Enberg
2009-06-29 10:38 ` Catalin Marinas
2009-06-29 10:42 ` Pekka Enberg
2009-06-29 10:52 ` Sergey Senozhatsky
2009-06-29 20:10 ` Sergey Senozhatsky
2009-07-14 10:07 ` Catalin Marinas
2009-07-14 10:33 ` Sergey Senozhatsky [this message]
2009-07-14 10:34 ` Catalin Marinas
2009-07-14 10:57 ` Sergey Senozhatsky
2009-07-14 13:39 ` Catalin Marinas
2009-07-14 14:03 ` Sergey Senozhatsky
2009-07-14 14:17 ` Catalin Marinas
2009-07-14 15:22 ` kmemleak: Printing of the objects hex dump Sergey Senozhatsky
2009-06-29 10:45 ` kmemleak hexdump proposal Sergey Senozhatsky
2009-06-29 10:58 ` Catalin Marinas
2009-06-29 11:08 ` Sergey Senozhatsky
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=20090714103356.GA2929@localdomain.by \
--to=sergey.senozhatsky@mail.by \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=penberg@cs.helsinki.fi \
/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