1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _LINUX_SCHED_XACCT_H 3 #define _LINUX_SCHED_XACCT_H 4 5 /* 6 * Extended task accounting methods: 7 */ 8 9 #include <linux/sched.h> 10 11 #ifdef CONFIG_TASK_XACCT add_rchar(struct task_struct * tsk,ssize_t amt)12static inline void add_rchar(struct task_struct *tsk, ssize_t amt) 13 { 14 tsk->ioac.rchar += amt; 15 } 16 add_wchar(struct task_struct * tsk,ssize_t amt)17static inline void add_wchar(struct task_struct *tsk, ssize_t amt) 18 { 19 tsk->ioac.wchar += amt; 20 } 21 inc_syscr(struct task_struct * tsk)22static inline void inc_syscr(struct task_struct *tsk) 23 { 24 tsk->ioac.syscr++; 25 } 26 inc_syscw(struct task_struct * tsk)27static inline void inc_syscw(struct task_struct *tsk) 28 { 29 tsk->ioac.syscw++; 30 } 31 inc_syscfs(struct task_struct * tsk)32static inline void inc_syscfs(struct task_struct *tsk) 33 { 34 tsk->ioac.syscfs++; 35 } 36 #else add_rchar(struct task_struct * tsk,ssize_t amt)37static inline void add_rchar(struct task_struct *tsk, ssize_t amt) 38 { 39 } 40 add_wchar(struct task_struct * tsk,ssize_t amt)41static inline void add_wchar(struct task_struct *tsk, ssize_t amt) 42 { 43 } 44 inc_syscr(struct task_struct * tsk)45static inline void inc_syscr(struct task_struct *tsk) 46 { 47 } 48 inc_syscw(struct task_struct * tsk)49static inline void inc_syscw(struct task_struct *tsk) 50 { 51 } 52 inc_syscfs(struct task_struct * tsk)53static inline void inc_syscfs(struct task_struct *tsk) 54 { 55 } 56 #endif 57 58 #endif /* _LINUX_SCHED_XACCT_H */ 59