aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2009-10-25 15:37:04 -0700
committerJohn Rigby <john.rigby@linaro.org>2011-10-17 09:52:37 -0600
commit37fdb67c68c5c1c3cae93c7cb01a766135192da7 (patch)
tree32c6046fe7f785a41206dbfaa62f208881c69283 /fs
parent4f4f17f40347a54cd168aef33e54925a0ddfd272 (diff)
UBUNTU: SAUCE: (no-up) vfs: Add a trace point in the mark_inode_dirty function
[apw@canonical.com: This has no upstream traction but is used by powertop, so its worth carrying.] PowerTOP would like to be able to show who is keeping the disk busy by dirtying data. The most logical spot for this is in the vfs in the mark_inode_dirty() function. Doing this on the block level is not possible because by the time the IO hits the block layer the guilty party can no longer be found ("kjournald" and "pdflush" are not useful answers to "who caused this file to be dirty). The trace point follows the same logic/style as the block_dump code and pretty much dumps the same data, just not to dmesg (and thus to /var/log/messages) but via the trace events streams. Note: This patch was posted to lkml and might potentially go into 2.6.33 but I have not seen which maintainer will take it. Signed-of-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Amit Kucheria <amit.kucheria@canonical.com> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs-writeback.c3
-rw-r--r--fs/inode.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index fe190a8b0bc..735e29f4fe8 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -27,6 +27,7 @@
#include <linux/backing-dev.h>
#include <linux/buffer_head.h>
#include <linux/tracepoint.h>
+#include <trace/events/vfs.h>
#include "internal.h"
/*
@@ -1047,6 +1048,8 @@ void __mark_inode_dirty(struct inode *inode, int flags)
if ((inode->i_state & flags) == flags)
return;
+ trace_dirty_inode(inode, current);
+
if (unlikely(block_dump))
block_dump___mark_inode_dirty(inode);
diff --git a/fs/inode.c b/fs/inode.c
index 4291eae074c..6fc341f2da3 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1696,3 +1696,7 @@ bool inode_owner_or_capable(const struct inode *inode)
return false;
}
EXPORT_SYMBOL(inode_owner_or_capable);
+
+#define CREATE_TRACE_POINTS
+#include <trace/events/vfs.h>
+