diff options
author | Shailabh Nagar <nagar@watson.ibm.com> | 2006-07-14 03:24:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-15 00:53:57 -0400 |
commit | 25890454667b3295f67b3372352be90705f8667c (patch) | |
tree | f66e24be59ced75853eb82709e3036e735aac21e /include/linux | |
parent | a3baf649ca9ca0a96fba538f03b0f17c043b755c (diff) |
[PATCH] per-task-delay-accounting: /proc export of aggregated block I/O delays
Export I/O delays seen by a task through /proc/<tgid>/stats for use in top
etc.
Note that delays for I/O done for swapping in pages (swapin I/O) is clubbed
together with all other I/O here (this is not the case in the netlink
interface where the swapin I/O is kept distinct)
[akpm@osdl.org: printk warning fix]
Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com>
Signed-off-by: Balbir Singh <balbir@in.ibm.com>
Cc: Jes Sorensen <jes@sgi.com>
Cc: Peter Chubb <peterc@gelato.unsw.edu.au>
Cc: Erich Focht <efocht@ess.nec.de>
Cc: Levent Serinol <lserinol@gmail.com>
Cc: Jay Lan <jlan@engr.sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/delayacct.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index d955078a1441..7e8b6011b8f3 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h | |||
@@ -37,6 +37,7 @@ extern void __delayacct_tsk_exit(struct task_struct *); | |||
37 | extern void __delayacct_blkio_start(void); | 37 | extern void __delayacct_blkio_start(void); |
38 | extern void __delayacct_blkio_end(void); | 38 | extern void __delayacct_blkio_end(void); |
39 | extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); | 39 | extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); |
40 | extern __u64 __delayacct_blkio_ticks(struct task_struct *); | ||
40 | 41 | ||
41 | static inline void delayacct_set_flag(int flag) | 42 | static inline void delayacct_set_flag(int flag) |
42 | { | 43 | { |
@@ -86,6 +87,13 @@ static inline int delayacct_add_tsk(struct taskstats *d, | |||
86 | return __delayacct_add_tsk(d, tsk); | 87 | return __delayacct_add_tsk(d, tsk); |
87 | } | 88 | } |
88 | 89 | ||
90 | static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) | ||
91 | { | ||
92 | if (tsk->delays) | ||
93 | return __delayacct_blkio_ticks(tsk); | ||
94 | return 0; | ||
95 | } | ||
96 | |||
89 | #else | 97 | #else |
90 | static inline void delayacct_set_flag(int flag) | 98 | static inline void delayacct_set_flag(int flag) |
91 | {} | 99 | {} |
@@ -104,6 +112,8 @@ static inline void delayacct_blkio_end(void) | |||
104 | static inline int delayacct_add_tsk(struct taskstats *d, | 112 | static inline int delayacct_add_tsk(struct taskstats *d, |
105 | struct task_struct *tsk) | 113 | struct task_struct *tsk) |
106 | { return 0; } | 114 | { return 0; } |
115 | static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) | ||
116 | { return 0; } | ||
107 | #endif /* CONFIG_TASK_DELAY_ACCT */ | 117 | #endif /* CONFIG_TASK_DELAY_ACCT */ |
108 | 118 | ||
109 | #endif | 119 | #endif |