public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	trond.myklebust@primarydata.com
Subject: Re: Pretty-printing file.f_mode and file.f_flags in trace points
Date: Fri, 11 Apr 2014 21:42:59 -0400	[thread overview]
Message-ID: <20140411214259.2de4e9fa@gandalf.local.home> (raw)
In-Reply-To: <nsxa9brqyys.fsf@closure.thunk.org>

On Fri, 11 Apr 2014 18:32:27 -0400
Theodore Ts'o <tytso@mit.edu> wrote:

> 
> I want to add some trace points which display f_mode and f_flags from
> struct file in a human way.   I found the following handy macros defined
> in fs/nfs/nfstrace.h:
> 
> #define show_open_flags(flags) \
> 	__print_flags((unsigned long)flags, "|", \
> 		{ O_CREAT, "O_CREAT" }, \
> 		{ O_EXCL, "O_EXCL" }, \
> 		{ O_TRUNC, "O_TRUNC" }, \
> 		{ O_APPEND, "O_APPEND" }, \
> 		{ O_DSYNC, "O_DSYNC" }, \
> 		{ O_DIRECT, "O_DIRECT" }, \
> 		{ O_DIRECTORY, "O_DIRECTORY" })
> 
> #define show_fmode_flags(mode) \
> 	__print_flags(mode, "|", \
> 		{ ((__force unsigned long)FMODE_READ), "READ" }, \
> 		{ ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
> 		{ ((__force unsigned long)FMODE_EXEC), "EXEC" })
> 
> I could just cut and paste these and drop them in
> include/trace/events/ext4.h, but it would probably be better to have a
> common header file.  The question is where to put them.  Does
> include/trace/fs.h make sense to everyone?   Or should put them
> somewhere else, such as linux/fs.h?
> 

An include file for headers that are only in the include/trace/event
directory is fine to be in include/trace. That is, if you have a macro
used by multiple include/trace/events/*.h files, just put it in
include/trace. I don't even think it needs to be in the events part.

Oh, and I'm fine if it is used by TRACE_EVENT files that are in other
locations like fs/nfs/nfstrace.h.

For adding a helper include/trace/fs.h file used by files in
include/trace/events/ and other trace headers...

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

      parent reply	other threads:[~2014-04-12  1:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 22:32 Pretty-printing file.f_mode and file.f_flags in trace points Theodore Ts'o
2014-04-11 22:47 ` Trond Myklebust
2014-04-11 22:57   ` Theodore Ts'o
2014-04-11 23:00     ` Trond Myklebust
2014-04-12  1:42 ` Steven Rostedt [this message]

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=20140411214259.2de4e9fa@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    --cc=tytso@mit.edu \
    /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