aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/delayacct.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/delayacct.h')
-rw-r--r--include/linux/delayacct.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
index 0ecbf9aad8e1..d955078a1441 100644
--- a/include/linux/delayacct.h
+++ b/include/linux/delayacct.h
@@ -18,6 +18,7 @@
18#define _LINUX_DELAYACCT_H 18#define _LINUX_DELAYACCT_H
19 19
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/taskstats_kern.h>
21 22
22/* 23/*
23 * Per-task flags relevant to delay accounting 24 * Per-task flags relevant to delay accounting
@@ -35,6 +36,7 @@ extern void __delayacct_tsk_init(struct task_struct *);
35extern void __delayacct_tsk_exit(struct task_struct *); 36extern void __delayacct_tsk_exit(struct task_struct *);
36extern void __delayacct_blkio_start(void); 37extern void __delayacct_blkio_start(void);
37extern void __delayacct_blkio_end(void); 38extern void __delayacct_blkio_end(void);
39extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *);
38 40
39static inline void delayacct_set_flag(int flag) 41static inline void delayacct_set_flag(int flag)
40{ 42{
@@ -74,6 +76,16 @@ static inline void delayacct_blkio_end(void)
74 __delayacct_blkio_end(); 76 __delayacct_blkio_end();
75} 77}
76 78
79static inline int delayacct_add_tsk(struct taskstats *d,
80 struct task_struct *tsk)
81{
82 if (likely(!delayacct_on))
83 return -EINVAL;
84 if (!tsk->delays)
85 return 0;
86 return __delayacct_add_tsk(d, tsk);
87}
88
77#else 89#else
78static inline void delayacct_set_flag(int flag) 90static inline void delayacct_set_flag(int flag)
79{} 91{}
@@ -89,6 +101,9 @@ static inline void delayacct_blkio_start(void)
89{} 101{}
90static inline void delayacct_blkio_end(void) 102static inline void delayacct_blkio_end(void)
91{} 103{}
104static inline int delayacct_add_tsk(struct taskstats *d,
105 struct task_struct *tsk)
106{ return 0; }
92#endif /* CONFIG_TASK_DELAY_ACCT */ 107#endif /* CONFIG_TASK_DELAY_ACCT */
93 108
94#endif 109#endif