Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43972
b: refs/heads/master
c: 4a7864c
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 10, 2006
1 parent 5ffb4dc commit 71370c3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2f1f8a3b86ccc5e998dc70a3ba35af199fdbc58
refs/heads/master: 4a7864ca638e0a38307962ee8ef122822a351b65
8 changes: 7 additions & 1 deletion trunk/include/linux/taskstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/


#define TASKSTATS_VERSION 2
#define TASKSTATS_VERSION 3
#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
* in linux/sched.h */

Expand Down Expand Up @@ -140,6 +140,12 @@ struct taskstats {
__u64 read_syscalls; /* read syscalls */
__u64 write_syscalls; /* write syscalls */
/* Extended accounting fields end */

#define TASKSTATS_HAS_IO_ACCOUNTING
/* Per-task storage I/O accounting starts */
__u64 read_bytes; /* bytes of read I/O */
__u64 write_bytes; /* bytes of write I/O */
__u64 cancelled_write_bytes; /* bytes of cancelled write I/O */
};


Expand Down
9 changes: 9 additions & 0 deletions trunk/kernel/tsacct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71370c3

Please sign in to comment.