From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Ingo Molnar" <mingo@elte.hu>,
"Steven Rostedt" <rostedt@goodmis.org>,
"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 13:12:59 +0100 [thread overview]
Message-ID: <20090304121258.GD6032@nowhere> (raw)
In-Reply-To: <1236167883.5330.7264.camel@laptop>
On Wed, Mar 04, 2009 at 12:58:03PM +0100, Peter Zijlstra wrote:
> On Wed, 2009-03-04 at 12:43 +0100, Ingo Molnar wrote:
> >
> > > +TRACE_FORMAT(lock_contended,
> > > + TPPROTO(struct lockdep_map *lock, unsigned long ip),
> > > + TPARGS(lock, ip),
> > > + TPFMT("%s", lock->name)
> > > + );
> >
> > Would it be possible to use the C syntax tracepoints perhaps?
> > They are bigger:
> >
> > TRACE_EVENT_FORMAT(sched_switch,
> > TPPROTO(struct rq *rq, struct task_struct *prev,
> > struct task_struct *next),
> > TPARGS(rq, prev, next),
> > TPFMT("task %s:%d ==> %s:%d",
> > prev->comm, prev->pid, next->comm, next->pid),
> > TRACE_STRUCT(
> > TRACE_FIELD(pid_t, prev_pid, prev->pid)
> > TRACE_FIELD(int, prev_prio, prev->prio)
> > TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
> > next_comm,
> > TPCMD(memcpy(TRACE_ENTRY->next_comm,
> > next->comm,
> > TASK_COMM_LEN)))
> > TRACE_FIELD(pid_t, next_pid, next->pid)
> > TRACE_FIELD(int, next_prio, next->prio)
> > ),
> > TPRAWFMT("prev %d:%d ==> next %s:%d:%d")
> > );
>
> I'm not quite sure how to do strings with those. The IRQ tracepoints
> cheat and omit the string, and the sched tracepoints cheat and use this
> static sized comm array.
>
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");
);
next prev parent reply other threads:[~2009-03-04 12:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-04 11:03 [PATCH] tracing: lockdep tracepoints 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 [this message]
2009-03-04 13:01 ` Peter Zijlstra
2009-03-04 13:07 ` Steven Rostedt
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=20090304121258.GD6032@nowhere \
--to=fweisbec@gmail.com \
--cc=edwintorok@gmail.com \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--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