summaryrefslogtreecommitdiffstats
path: root/kernel/tsacct.c
diff options
context:
space:
mode:
authorAndrew Morton2006-12-10 11:19:53 +0100
committerLinus Torvalds2006-12-10 18:55:41 +0100
commit4a7864ca638e0a38307962ee8ef122822a351b65 (patch)
treefb21754820a41365e524fafac11081cb52340a6f /kernel/tsacct.c
parent[PATCH] cleanup taskstats.h (diff)
downloadkernel-qcow2-linux-4a7864ca638e0a38307962ee8ef122822a351b65.tar.gz
kernel-qcow2-linux-4a7864ca638e0a38307962ee8ef122822a351b65.tar.xz
kernel-qcow2-linux-4a7864ca638e0a38307962ee8ef122822a351b65.zip
[PATCH] io-accounting: via taskstats
Deliver IO accounting via taskstats. Cc: Jay Lan <jlan@sgi.com> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Chris Sturtivant <csturtiv@sgi.com> Cc: Tony Ernst <tee@sgi.com> Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net> Cc: David Wright <daw@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/tsacct.c')
-rw-r--r--kernel/tsacct.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/tsacct.c b/kernel/tsacct.c
index 96f77013d3f0..baacc3691415 100644
--- a/kernel/tsacct.c
+++ b/kernel/tsacct.c
@@ -96,6 +96,15 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
stats->write_char = p->wchar;
stats->read_syscalls = p->syscr;
stats->write_syscalls = p->syscw;
+#ifdef CONFIG_TASK_IO_ACCOUNTING
+ stats->read_bytes = p->ioac.read_bytes;
+ stats->write_bytes = p->ioac.write_bytes;
+ stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes;
+#else
+ stats->read_bytes = 0;
+ stats->write_bytes = 0;
+ stats->cancelled_write_bytes = 0;
+#endif
}
#undef KB
#undef MB