public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>
Cc: Zhaolei <zhaolei@cn.fujitsu.com>,
	Tom Zanussi <tzanussi@gmail.com>, Li Zefan <lizf@cn.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 2/2 v2] tracing/lock: provide lock_acquired event support for dynamic size string
Date: Thu, 16 Apr 2009 22:00:47 +0200	[thread overview]
Message-ID: <1239912047-6282-2-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1239912047-6282-1-git-send-email-fweisbec@gmail.com>

Now that we can support the dynamic sized string, make the lock tracing
able to use it, making it safe against modules removal and consuming
the right amount of memory needed for each lock name

Changes in v2:
adapt to the __ending_string() updates and the opening_string() removal.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 include/trace/events/lockdep.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/lockdep.h b/include/trace/events/lockdep.h
index 45e326b..e649fbc 100644
--- a/include/trace/events/lockdep.h
+++ b/include/trace/events/lockdep.h
@@ -38,14 +38,14 @@ TRACE_EVENT(lock_acquired,
 	TP_ARGS(lock, ip, waittime),
 
 	TP_STRUCT__entry(
-		__field(const char *, name)
 		__field(unsigned long, wait_usec)
 		__field(unsigned long, wait_nsec_rem)
+		__ending_string(name, lock->name)
 	),
 	TP_fast_assign(
-		__entry->name = lock->name;
 		__entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);
 		__entry->wait_usec = (unsigned long) waittime;
+		strcpy(__entry->name, lock->name);
 	),
 	TP_printk("%s (%lu.%03lu us)", __entry->name, __entry->wait_usec,
 				       __entry->wait_nsec_rem)
-- 
1.6.1


  reply	other threads:[~2009-04-16 20:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 20:00 [PATCH 1/2 v2] tracing/events: provide string with undefined size support Frederic Weisbecker
2009-04-16 20:00 ` Frederic Weisbecker [this message]
2009-04-16 20:13 ` Peter Zijlstra
2009-04-16 20:28   ` Frédéric Weisbecker
2009-04-17  6:22     ` Peter Zijlstra
2009-04-17  8:59       ` Frédéric Weisbecker
2009-04-17  9:29         ` Peter Zijlstra
2009-04-17 10:04           ` Frédéric Weisbecker
2009-04-17 10:07             ` Frédéric Weisbecker
2009-04-17 10:10           ` Steven Rostedt
2009-04-17 10:16             ` Frédéric Weisbecker
2009-04-17 10:39             ` Peter Zijlstra
2009-04-17 10:51               ` Steven Rostedt
2009-04-17 11:14                 ` Frédéric Weisbecker
2009-04-17 10:39             ` Steven Rostedt
2009-04-18 18:42               ` Frederic Weisbecker
2009-04-19  0:52                 ` Steven Rostedt

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=1239912047-6282-2-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tzanussi@gmail.com \
    --cc=zhaolei@cn.fujitsu.com \
    /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