mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@elte.hu>,
	"Török Edwin" <edwintorok@gmail.com>,
	"Jason Baron" <jbaron@redhat.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -v2] tracing: lockdep tracepoints
Date: Wed, 4 Mar 2009 08:07:02 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.00.0903040801580.7995@gandalf.stny.rr.com> (raw)
In-Reply-To: <20090304121258.GD6032@nowhere>


On Wed, 4 Mar 2009, Frederic Weisbecker wrote:
> > 
> 
> 
> The TRACE_FIELD_SPECIAL is only used in case of complex assignment,
> those that can't be done in a simple "=" expression.
> 
> All you need is simply:
> 
> TRACE_FORMAT(lock_contended,
>      TPPROTO(struct lockdep_map *lock, unsigned long ip),
>      TPARGS(lock, ip),
>      TPFMT("%s", lock->name)
>      TRACE_STRUCT(
> 	TRACE_FIELD(char *, name, lock->name)
>      )
>      TPRAWFMT("%s");
> );


Nope, that wont work :-(  If this is saved to userspace, all the user 
would have is some hex value. If they have a copy of the vmlinux image, 
then they could probably translate that value, unless it was a module.

Perhaps something like:

 TRACE_EVENT_FORMAT(lock_contended,
	TPPROTO(struct lockdep_map *lock, unsigned long ip),
	TPARGS(lock, ip),
	TPFMT("%s", lock->name);
	TRACE_STRUCT(
		TRACE_FIELD_SPECIAL(char name[16], name,
			strncpy(name, lock->name, 16));
	),
	TPRAWFMT("%s")
 );

This would require those 16 bytes to be copied with the raw format, but 
then we would always have the name (first 16 bytes anyway) for later use.

-- Steve


  parent reply	other threads:[~2009-03-04 13:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 11:03 [PATCH] " Peter Zijlstra
2009-03-04 11:23 ` Frederic Weisbecker
2009-03-04 11:32   ` [PATCH -v2] " Peter Zijlstra
2009-03-04 11:43     ` Ingo Molnar
2009-03-04 11:58       ` Peter Zijlstra
2009-03-04 12:12         ` Frederic Weisbecker
2009-03-04 13:01           ` Peter Zijlstra
2009-03-04 13:07           ` Steven Rostedt [this message]
2009-03-04 12:02     ` Török Edwin
2009-03-04 17:57     ` [tip:tracing/ftrace] tracing: add lockdep tracepoints for lock acquire/release Peter Zijlstra

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=alpine.DEB.2.00.0903040801580.7995@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=edwintorok@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®