From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Mathieu Desnoyers <compudj@krystal.dyndns.org>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Theodore Tso <tytso@mit.edu>,
Christoph Hellwig <hch@infradead.org>,
Peter Zijlstra <peterz@infradead.org>, Mel Gorman <mel@csn.ul.ie>,
Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Subject: [PATCH 10/11] tracing/events: modify lockdep print to new format
Date: Wed, 10 Jun 2009 12:53:16 -0400 [thread overview]
Message-ID: <20090610170000.766033125@goodmis.org> (raw)
In-Reply-To: 20090610165306.794813861@goodmis.org
[-- Attachment #1: 0010-tracing-events-modify-lockdep-print-to-new-format.patch --]
[-- Type: text/plain, Size: 2065 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Use new format for better parsing of lockdep events.
The current conversion of the nsec value in the lockstat lock event
is performed in the fast path. Now that there is a tag to do the conversion
we can move this into the slow path and increase performance while tracing.
[ Impact: increase performance in lockstat tracing ]
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/trace/events/lockdep.h | 18 +++++++-----------
1 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/include/trace/events/lockdep.h b/include/trace/events/lockdep.h
index 0e956c9..4251f17 100644
--- a/include/trace/events/lockdep.h
+++ b/include/trace/events/lockdep.h
@@ -27,9 +27,8 @@ TRACE_EVENT(lock_acquire,
__assign_str(name, lock->name);
),
- TP_printk("%s%s%s", (__entry->flags & 1) ? "try " : "",
- (__entry->flags & 2) ? "read " : "",
- __get_str(name))
+ TP_FORMAT("<ifmask:flags:1:try :><ifmask:flags:2:read :>"
+ "<string:name>")
);
TRACE_EVENT(lock_release,
@@ -46,7 +45,7 @@ TRACE_EVENT(lock_release,
__assign_str(name, lock->name);
),
- TP_printk("%s", __get_str(name))
+ TP_FORMAT("<string:name>")
);
#ifdef CONFIG_LOCK_STAT
@@ -65,7 +64,7 @@ TRACE_EVENT(lock_contended,
__assign_str(name, lock->name);
),
- TP_printk("%s", __get_str(name))
+ TP_FORMAT("<string:name>")
);
TRACE_EVENT(lock_acquired,
@@ -75,16 +74,13 @@ TRACE_EVENT(lock_acquired,
TP_STRUCT__entry(
__string(name, lock->name)
- __field(unsigned long, wait_usec)
- __field(unsigned long, wait_nsec_rem)
+ __field(long long, wait_nsec)
),
TP_fast_assign(
__assign_str(name, lock->name);
- __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);
- __entry->wait_usec = (unsigned long) waittime;
+ __entry->wait_nsec = waittime;
),
- TP_printk("%s (%lu.%03lu us)", __get_str(name), __entry->wait_usec,
- __entry->wait_nsec_rem)
+ TP_FORMAT("<string:name> (<nsec2usec:3:wait_nsec> us)")
);
#endif
--
1.6.3.1
--
next prev parent reply other threads:[~2009-06-10 17:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 16:53 [PATCH 00/11] [GIT PULL][for 2.6.32] new event print tag language Steven Rostedt
2009-06-10 16:53 ` [PATCH 01/11] tracing: add entry size to iterator Steven Rostedt
2009-06-10 16:53 ` [PATCH 02/11] tracing/events: nicer print format for parsing Steven Rostedt
2009-06-10 16:53 ` [PATCH 03/11] tracing: add nsec2sec print formats Steven Rostedt
2009-06-10 16:53 ` [PATCH 04/11] tracing: add major and minor tags for print format Steven Rostedt
2009-06-10 16:53 ` [PATCH 05/11] tracing: add func and symfunc to tag format Steven Rostedt
2009-06-10 16:53 ` [PATCH 06/11] tracing: update sample code with new " Steven Rostedt
2009-06-10 16:53 ` [PATCH 07/11] tracing/events: modify irq print to new format Steven Rostedt
2009-06-10 16:53 ` [PATCH 08/11] tracing/events: modify sched " Steven Rostedt
2009-06-10 16:53 ` [PATCH 09/11] tracing/events: modify kmem " Steven Rostedt
2009-06-10 16:53 ` Steven Rostedt [this message]
2009-06-10 16:53 ` [PATCH 11/11] tracing: convert the block trace points to use the new tag format 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=20090610170000.766033125@goodmis.org \
--to=rostedt@goodmis.org \
--cc=acme@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=compudj@krystal.dyndns.org \
--cc=fweisbec@gmail.com \
--cc=hch@infradead.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tytso@mit.edu \
--cc=xiaoguangrong@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