linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Arjan van de Ven <arjan@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, Al Viro <viro@ZenIV.linux.org.uk>,
	Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] vfs: Add a trace point in the mark_inode_dirty function
Date: Mon, 29 Nov 2010 09:41:37 -0500	[thread overview]
Message-ID: <20101129144137.GA10213@Krystal> (raw)
In-Reply-To: <1291040469.30543.715.camel@gandalf.stny.rr.com>

* Steven Rostedt (rostedt@goodmis.org) wrote:
> [ Adding Ingo, Peter and Mathieu ]
> 
> On Mon, 2010-11-29 at 14:15 +0900, KOSAKI Motohiro wrote:
> > > On Mon, 29 Nov 2010 10:41:51 +0900 (JST)
> > > KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> > > 
> > > > > Signed-of-by: Arjan van de Ven <arjan@linux.intel.com>
> > > > > ---
> > > > >  fs/fs-writeback.c                |    3 +++
> > > > >  include/linux/fs.h               |   12 ++++++++++++
> > > > >  include/trace/events/writeback.h |   28
> > > > > ++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 0
> > > > > deletions(-)
> > > > > 
> > > > > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> > > > > index 3d06ccc..62e33cc 100644
> > > > > --- a/fs/fs-writeback.c
> > > > > +++ b/fs/fs-writeback.c
> > > > > @@ -952,6 +952,9 @@ void __mark_inode_dirty(struct inode *inode,
> > > > > int flags) if ((inode->i_state & flags) == flags)
> > > > >  		return;
> > > > >  
> > > > > +	if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC |
> > > > > I_DIRTY_PAGES))
> > > > > +		trace_writeback_inode_dirty(inode, flags);
> > > > > +
> > > > 
> > > > Why can't we move this branch into TP_fast_assign()?
> > > 
> > > not really because then the tracepoint is already in process of being
> > > emitted... no way to retract it anymore.
> > 
> > I'm not tracing expert. but Steven said we can it in past. (cc him)
> > 
> > http://www.spinics.net/lists/linux-ext4/msg20045.html
> > 
> 
> Yes, this came up before. Currently, if you add the if statement in the
> trcacepoint, you just wasted space. But if we can add a discard_entry,
> or better yet, I can add a TRACE_EVENT_CONDITION() that adds an if
> statement to check. Something like:
> 
> 	TRACE_EVENT_CONDITION(name,
> 		[...]
> 	TP_condition(
> 			if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC |
> 			    I_DIRTY_PAGES))
> 				return 1;
> 			else
> 				return 0;
> 		    ),

Yep, something like this would be really useful for us too in user-space. One
example use-case is to let a telecom application filter by "call ID" when
following one call across multiple telecom switches. The kind of condition we
would have is:

 	TRACE_EVENT_CONDITION(name,
 		[...]
 	TP_condition(
 			if (unlikely(call_id == monitored_call_id))
 				return 1;
                        if (unlikely(!call_id_monitoring))
                                return 1;
 			return 0;
 		    ),

So in this case, "call_id" is received as parameter, but "monitored_call_id" and
"call_id_monitoring" are global variables.

One question that strikes me is: would you declare this outside of the
TRACE_EVENT() or inside it ? How would you match the TRACE_EVENT() and the
TRACE_EVENT_CONDITION() if they are separate, by name ?

The dynamic "pre-filters" will also be useful, but I think this kind of
statically defined conditions will answer a large amount of our requirements,
letting these filtering expressions be designed by application developers and
used by operators/engineers.

Thanks,

Mathieu

> 
> Have this run on the parameters and not the entry fields (because the
> entry fields are from the ring buffer, and to use them, we must first
> write to the ring buffer (something we want to avoid).
> 
> We could also make this code work with "pre-filters". That is, filters
> on the tracepoints that access the parameters and not the final entries.
> This would let us circumvent allocating ring buffer space when the
> filter states to skip the entry.
> 
> -- Steve
> 
> 			
> 
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2010-11-29 14:41 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26 20:56 [PATCH] vfs: Add a trace point in the mark_inode_dirty function Arjan van de Ven
2010-11-28 17:52 ` Christoph Hellwig
2010-11-28 18:43   ` Arjan van de Ven
2010-11-29  1:41     ` KOSAKI Motohiro
2010-11-29  4:54       ` Arjan van de Ven
2010-11-29  5:15         ` KOSAKI Motohiro
2010-11-29 14:21           ` Steven Rostedt
2010-11-29 14:41             ` Mathieu Desnoyers [this message]
2010-11-29 16:31               ` Steven Rostedt
2010-11-30  0:37             ` KOSAKI Motohiro
2010-11-29  3:53     ` Nick Piggin
  -- strict thread matches above, loose matches on Subject: below --
2009-10-26  5:53 Arjan van de Ven
2009-10-26  6:03 ` Andrew Morton
2009-10-26  6:55   ` Arjan van de Ven
2009-10-27 16:01 ` Jason Baron
2009-11-11  2:01 ` Wu Fengguang
2009-11-11  6:34   ` Arjan van de Ven
2009-11-11  6:40     ` Wu Fengguang
2009-11-11  7:42     ` Jeff Garzik
2009-11-11  7:45       ` Ingo Molnar
2009-11-11  7:56         ` Jeff Garzik
2009-11-11 11:15           ` Ingo Molnar
2009-11-11 17:27         ` Kok, Auke
2009-11-11 18:29         ` Theodore Tso
2009-11-11 18:56           ` Ingo Molnar
2009-11-12  2:15           ` Arjan van de Ven
2009-11-11 16:19       ` Arjan van de Ven
2009-11-11 23:10         ` Frank Ch. Eigler
2009-11-11 23:37           ` Kok, Auke
2009-11-12  7:22             ` Ingo Molnar
2009-11-20 10:43               ` Christoph Hellwig
2009-11-20 10:51                 ` Ingo Molnar
2009-11-20 14:45                 ` Arjan van de Ven
2009-11-20 16:05                   ` Jamie Lokier
2009-11-20 16:45                     ` Arjan van de Ven
2009-11-11  2:33 ` Li Zefan
2009-11-15 19:00   ` Arjan van de Ven
2009-11-16  0:56     ` Li Zefan

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=20101129144137.GA10213@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    --cc=arjan@infradead.org \
    --cc=hch@infradead.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).