From: Wu Fengguang <fengguang.wu@intel.com>
To: linux-fsdevel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jan Kara <jack@suse.cz>, Dave Chinner <david@fromorbit.com>,
Christoph Hellwig <hch@infradead.org>
Subject: [PATCH,RFC] writeback: show raw dirtied_when in trace writeback_single_inode
Date: Mon, 29 Aug 2011 10:06:01 +0800 [thread overview]
Message-ID: <20110829020601.GA4862@localhost> (raw)
It looks more reasonable to save inode->dirtied_when in the raw trace
output, and to show both the absolute raw value for easy scripting and
the relative age in seconds for easy human reading.
The trace event was newly added in 3.1-rc1, so we still have the chance
to change the format.
btw, are there ways for user space to query the HZ value of the
running kernel? Which is required for converting the raw dirtied_when
ticks to clock time.
CC: Jan Kara <jack@suse.cz>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
include/trace/events/writeback.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- linux-next.orig/include/trace/events/writeback.h 2011-08-29 09:51:12.000000000 +0800
+++ linux-next/include/trace/events/writeback.h 2011-08-29 09:52:19.000000000 +0800
@@ -433,7 +433,7 @@ DECLARE_EVENT_CLASS(writeback_single_ino
__array(char, name, 32)
__field(unsigned long, ino)
__field(unsigned long, state)
- __field(unsigned long, age)
+ __field(unsigned long, dirtied_when)
__field(unsigned long, writeback_index)
__field(long, nr_to_write)
__field(unsigned long, wrote)
@@ -444,19 +444,19 @@ DECLARE_EVENT_CLASS(writeback_single_ino
dev_name(inode->i_mapping->backing_dev_info->dev), 32);
__entry->ino = inode->i_ino;
__entry->state = inode->i_state;
- __entry->age = (jiffies - inode->dirtied_when) *
- 1000 / HZ;
+ __entry->age = (jiffies - inode->dirtied_when) / HZ;
__entry->writeback_index = inode->i_mapping->writeback_index;
__entry->nr_to_write = nr_to_write;
__entry->wrote = nr_to_write - wbc->nr_to_write;
),
- TP_printk("bdi %s: ino=%lu state=%s age=%lu "
+ TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
"index=%lu to_write=%ld wrote=%lu",
__entry->name,
__entry->ino,
show_inode_state(__entry->state),
- __entry->age,
+ __entry->dirtied_when,
+ (jiffies - __entry->dirtied_when) / HZ,
__entry->writeback_index,
__entry->nr_to_write,
__entry->wrote
next reply other threads:[~2011-08-29 2:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 2:06 Wu Fengguang [this message]
2011-08-29 7:42 ` [PATCH,RFC] writeback: show raw dirtied_when in trace writeback_single_inode Christoph Hellwig
2011-08-29 9:23 ` [PATCH,v2] " Wu Fengguang
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=20110829020601.GA4862@localhost \
--to=fengguang.wu@intel.com \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).