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-09-23 08:54:31 -0600
commita5c4bcb1a3f682ba9366aeb2a4c5de24a57bd977 (patch)
tree53a85d6c960d2eaae5d51a86a0756985fdb4e928 /fs
parent249697c6ff25f63856720093f4e31c161a95ee06 (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 0f015a0468d..f50f2dc1af5 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"
/*
@@ -1038,6 +1039,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>
+