public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 7/7] blktrace: support filtering of BLK_TN_MESSAGE
Date: Fri, 27 Mar 2009 13:42:06 +0800	[thread overview]
Message-ID: <49CC672E.6050507@cn.fujitsu.com> (raw)
In-Reply-To: <49CC6691.7050103@cn.fujitsu.com>

I found large bunk of the output of blktrace are BLK_TN_MESSAGE events:

 % blktrace -d /dev/sda -o - | blkparse -i - -o ~/blk.log
 (after some seconds)
 % cat ~/blk.log | wc -l
 69041
 % cat ~/blk.log | grep "m   N" | wc -l
 38232

It will be useful to be able to filter those events.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 kernel/trace/blktrace.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 947c5b3..dcabe59 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -131,6 +131,9 @@ void __trace_note_message(struct blk_trace *bt, const char *fmt, ...)
 		     !blk_tracer_enabled))
 		return;
 
+	if (!(bt->act_mask & BLK_TC_NOTIFY))
+		return;
+
 	local_irq_save(flags);
 	buf = per_cpu_ptr(bt->msg_data, smp_processor_id());
 	va_start(args, fmt);
@@ -1366,6 +1369,7 @@ static const struct {
 	{ BLK_TC_COMPLETE,	"complete"	},
 	{ BLK_TC_FS,		"fs"		},
 	{ BLK_TC_PC,		"pc"		},
+	{ BLK_TC_NOTIFY,	"notify"	},
 	{ BLK_TC_AHEAD,		"ahead"		},
 	{ BLK_TC_META,		"meta"		},
 	{ BLK_TC_DISCARD,	"discard"	},
-- 
1.5.4.rc3


  parent reply	other threads:[~2009-03-27  5:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27  5:39 [PATCH v2 0/7] blktrace: last round of fixes Li Zefan
2009-03-27  5:39 ` [PATCH v2 1/7] trace: make 'mem' argument of trace_seq_putmem() const Li Zefan
2009-03-27  5:40 ` [PATCH v2 2/7] blktrace: make classic output more classic Li Zefan
2009-03-27  5:40 ` [PATCH v2 3/7] blktrace: fix blk_probes_ref chaos Li Zefan
2009-03-27  8:13   ` [PATCH v3 " Li Zefan
2009-03-27  5:40 ` [PATCH v2 4/7] blktrace: fix memory leak when freeing struct blk_io_trace Li Zefan
2009-03-27  8:13   ` [PATCH v3 " Li Zefan
2009-03-27  5:41 ` [PATCH v2 5/7] blktrace: extract duplidate code Li Zefan
2009-03-27  5:41 ` [PATCH v2 6/7] blktrace: print out BLK_TN_MESSAGE properly Li Zefan
2009-03-27  5:42 ` Li Zefan [this message]
2009-03-27  9:42 ` [PATCH v2 0/7] blktrace: last round of fixes Ingo Molnar
2009-03-28 22:46 ` Ingo Molnar
2009-03-29 18:02   ` Jens Axboe
2009-03-30  1:17     ` Ingo Molnar
2009-03-30  0:40   ` Li Zefan
2009-03-30  1:23     ` Ingo Molnar

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=49CC672E.6050507@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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