All of lore.kernel.org
 help / color / mirror / Atom feed
* + lib-kasprintfc-use-kmalloc_track_caller-to-get-accurate-traces-for-kvasprintf.patch added to -mm tree
@ 2012-10-09 21:18 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2012-10-09 21:18 UTC (permalink / raw)
  To: mm-commits; +Cc: elezegarcia, sam


The patch titled
     Subject: lib/kasprintf.c: use kmalloc_track_caller() to get accurate traces for kvasprintf
has been added to the -mm tree.  Its filename is
     lib-kasprintfc-use-kmalloc_track_caller-to-get-accurate-traces-for-kvasprintf.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Ezequiel Garcia <elezegarcia@gmail.com>
Subject: lib/kasprintf.c: use kmalloc_track_caller() to get accurate traces for kvasprintf

Previously kvasprintf() allocation was being done through kmalloc(), thus
producing an inaccurate trace report.

This is a common problem: in order to get accurate callsite tracing, a
lib/utils function shouldn't allocate kmalloc but instead use
kmalloc_track_caller.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 lib/kasprintf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN lib/kasprintf.c~lib-kasprintfc-use-kmalloc_track_caller-to-get-accurate-traces-for-kvasprintf lib/kasprintf.c
--- a/lib/kasprintf.c~lib-kasprintfc-use-kmalloc_track_caller-to-get-accurate-traces-for-kvasprintf
+++ a/lib/kasprintf.c
@@ -21,7 +21,7 @@ char *kvasprintf(gfp_t gfp, const char *
 	len = vsnprintf(NULL, 0, fmt, aq);
 	va_end(aq);
 
-	p = kmalloc(len+1, gfp);
+	p = kmalloc_track_caller(len+1, gfp);
 	if (!p)
 		return NULL;
 
_

Patches currently in -mm which might be from elezegarcia@gmail.com are

origin.patch
lib-kasprintfc-use-kmalloc_track_caller-to-get-accurate-traces-for-kvasprintf.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-09 21:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09 21:18 + lib-kasprintfc-use-kmalloc_track_caller-to-get-accurate-traces-for-kvasprintf.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.