aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 446373535190..76c8e2dc48dd 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1013,8 +1013,10 @@ struct task_struct {
1013 * to a stack based synchronous wait) if its doing sync IO. 1013 * to a stack based synchronous wait) if its doing sync IO.
1014 */ 1014 */
1015 wait_queue_t *io_wait; 1015 wait_queue_t *io_wait;
1016#ifdef CONFIG_TASK_XACCT
1016/* i/o counters(bytes read/written, #syscalls */ 1017/* i/o counters(bytes read/written, #syscalls */
1017 u64 rchar, wchar, syscr, syscw; 1018 u64 rchar, wchar, syscr, syscw;
1019#endif
1018 struct task_io_accounting ioac; 1020 struct task_io_accounting ioac;
1019#if defined(CONFIG_TASK_XACCT) 1021#if defined(CONFIG_TASK_XACCT)
1020 u64 acct_rss_mem1; /* accumulated rss usage */ 1022 u64 acct_rss_mem1; /* accumulated rss usage */
@@ -1649,6 +1651,44 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
1649 1651
1650extern void normalize_rt_tasks(void); 1652extern void normalize_rt_tasks(void);
1651 1653
1654#ifdef CONFIG_TASK_XACCT
1655static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
1656{
1657 tsk->rchar += amt;
1658}
1659
1660static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
1661{
1662 tsk->wchar += amt;
1663}
1664
1665static inline void inc_syscr(struct task_struct *tsk)
1666{
1667 tsk->syscr++;
1668}
1669
1670static inline void inc_syscw(struct task_struct *tsk)
1671{
1672 tsk->syscw++;
1673}
1674#else
1675static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
1676{
1677}
1678
1679static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
1680{
1681}
1682
1683static inline void inc_syscr(struct task_struct *tsk)
1684{
1685}
1686
1687static inline void inc_syscw(struct task_struct *tsk)
1688{
1689}
1690#endif
1691
1652#endif /* __KERNEL__ */ 1692#endif /* __KERNEL__ */
1653 1693
1654#endif 1694#endif