From: Christoph Hellwig <hch@infradead.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Re: GFS2: Add tracepoints
Date: Fri, 29 May 2009 15:23:52 -0400 [thread overview]
Message-ID: <20090529192352.GA2706@infradead.org> (raw)
In-Reply-To: <1243624260.3431.6.camel@localhost.localdomain>
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.
> +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.
> + __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?
> +);
> +
> +#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.
next prev parent reply other threads:[~2009-05-29 19:23 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 ` Christoph Hellwig [this message]
2009-05-29 19:50 ` [Cluster-devel] " Steven Whitehouse
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=20090529192352.GA2706@infradead.org \
--to=hch@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