From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Re: GFS2: Add tracepoints
Date: Fri, 29 May 2009 20:50:10 +0100 [thread overview]
Message-ID: <1243626610.3431.17.camel@localhost.localdomain> (raw)
In-Reply-To: <20090529192352.GA2706@infradead.org>
Hi,
On Fri, 2009-05-29 at 15:23 -0400, Christoph Hellwig wrote:
> On Fri, May 29, 2009 at 08:11:00PM +0100, Steven Whitehouse wrote:
> > +static inline u8 glock_trace_state(unsigned int state)
> > +{
> > + switch(state) {
> > + case LM_ST_SHARED:
> > + return DLM_LOCK_PR;
> > + case LM_ST_DEFERRED:
> > + return DLM_LOCK_CW;
> > + case LM_ST_EXCLUSIVE:
> > + return DLM_LOCK_EX;
> > + }
> > + return DLM_LOCK_NL;
> > +}
>
> I think this would be better done using __print_symbolic.
>
This is just a conversion of constants, but the others below I'll fix up
in the next version.
> > +static inline const char *glock_trace_name(u8 state)
> > +{
> > + switch(state) {
> > + case DLM_LOCK_PR:
> > + return "PR";
> > + case DLM_LOCK_CW:
> > + return "CW";
> > + case DLM_LOCK_EX:
> > + return "EX";
> > + case DLM_LOCK_NL:
> > + return "NL";
> > + default:
> > + return "--";
> > + }
> > +}
>
> Same here.
>
> > +static inline const char *gfs2_blkst_name(u8 state)
> > +{
> > + switch(state) {
> > + case GFS2_BLKST_FREE:
> > + return "free";
> > + case GFS2_BLKST_USED:
> > + return "used";
> > + case GFS2_BLKST_DINODE:
> > + return "dinode";
> > + case GFS2_BLKST_UNLINKED:
> > + return "unlinked";
> > + }
> > + return "???";
> > +}
>
> Same here.
>
> > + TP_STRUCT__entry(
> > + __array( char, devname, BDEVNAME_SIZE )
>
> This is extremly inefficient. We'd be much better off just storing
> the dev_t and introducing a __trace_bdevname to expand a bdevname
> into the tracer buffer. It's been on my todo list for a while and
> I'll look into it next week unless you beat me to it.
>
Ok. I wasn't sure how efficient bdevname() was vs. copying the name
around, but that sounds like a good plan if its not too expensive an
operation.
> > + __entry->gltype = gl->gl_name.ln_type;
> > + __entry->cur_state = glock_trace_state(gl->gl_state);
> > + __entry->new_state = glock_trace_state(new_state);
> > + __entry->tgt_state = glock_trace_state(gl->gl_target);
> > + __entry->dmt_state = DLM_LOCK_IV;
> > + if (test_bit(GLF_DEMOTE, &gl->gl_flags) ||
> > + test_bit(GLF_PENDING_DEMOTE, &gl->gl_flags))
> > + __entry->dmt_state = glock_trace_state(gl->gl_demote_state);
>
> Wouldn't it be better to just trace gl_flags and gl_demote_state?
>
Yes, that sounds good. That is legacy code from the original patch to
blktrace which was rather more limited in scope and wasn't able to print
the flags.
> > +);
> > +
> > +#endif /* _TRACE_GFS2_H */
> > +
> > +/* This part must be outside protection */
> > +#undef TRACE_INCLUDE_PATH
> > +#define TRACE_INCLUDE_PATH ../../fs/gfs2/
>
> Shouldn't an
>
> #define TRACE_INCLUDE_PATH .
>
> do it? (although that would need -I$(src), not sure how good that is.
Ah, I though this was an alternative after the comments in the earlier
review, but I can look into it if you think thats better,
Steve.
next prev parent reply other threads:[~2009-05-29 19:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-29 19:11 [Cluster-devel] GFS2: Add tracepoints Steven Whitehouse
2009-05-29 19:23 ` [Cluster-devel] " Christoph Hellwig
2009-05-29 19:50 ` Steven Whitehouse [this message]
2009-05-30 10:25 ` Christoph Hellwig
2009-06-01 14:19 ` Steven Whitehouse
2009-06-01 17:30 ` [Cluster-devel] [GFS2 PATCH] bz502531 - GFS2: smbd proccess hangs with flock() call Abhijith Das
2009-06-02 8:08 ` Steven Whitehouse
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=1243626610.3431.17.camel@localhost.localdomain \
--to=swhiteho@redhat.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