linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "George G. Davis" <george_davis@mentor.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	"George G. Davis" <george_davis@mentor.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: [PATCH] tracing: kmem: convert call_site addresses to user friendly symbols
Date: Fri, 19 Jul 2019 22:22:40 -0400	[thread overview]
Message-ID: <1563589361-18337-1-git-send-email-george_davis@mentor.com> (raw)

While attempting to debug slub freelist pointer corruption bugs
caused by a module, I discovered that the kmem call_site addresses are
not at all user friendly for modules unless you manage to save a copy
of kallsyms for the running kernel beforehand.

So convert kmem call_site addresses to user friendly symbols which is
especially helpful for module callers when you don't have a copy of
kallsyms for the running kernel.

Signed-off-by: George G. Davis <george_davis@mentor.com>
---
 include/trace/events/kmem.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index eb57e3037deb..ae18e61fa1c0 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -35,7 +35,7 @@ DECLARE_EVENT_CLASS(kmem_alloc,
 		__entry->gfp_flags	= gfp_flags;
 	),
 
-	TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s",
+	TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s",
 		__entry->call_site,
 		__entry->ptr,
 		__entry->bytes_req,
@@ -88,7 +88,7 @@ DECLARE_EVENT_CLASS(kmem_alloc_node,
 		__entry->node		= node;
 	),
 
-	TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d",
+	TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d",
 		__entry->call_site,
 		__entry->ptr,
 		__entry->bytes_req,
@@ -131,7 +131,7 @@ DECLARE_EVENT_CLASS(kmem_free,
 		__entry->ptr		= ptr;
 	),
 
-	TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
+	TP_printk("call_site=%pS ptr=%p", __entry->call_site, __entry->ptr)
 );
 
 DEFINE_EVENT(kmem_free, kfree,
-- 
2.7.4


             reply	other threads:[~2019-07-20  2:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-20  2:22 George G. Davis [this message]
2019-07-21  5:26 ` [PATCH] tracing: kmem: convert call_site addresses to user friendly symbols kbuild test robot
2019-07-22 13:43 ` Steven Rostedt
2019-07-22 21:23   ` George G. Davis

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=1563589361-18337-1-git-send-email-george_davis@mentor.com \
    --to=george_davis@mentor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).