Ingo Molnar | b12fb7f | 2017-02-08 18:51:33 +0100 | [diff] [blame] | 1 | #ifndef _LINUX_SCHED_XACCT_H |
| 2 | #define _LINUX_SCHED_XACCT_H |
| 3 | |
Ingo Molnar | 9a07000 | 2017-02-02 19:10:05 +0100 | [diff] [blame] | 4 | /* |
| 5 | * Extended task accounting methods: |
| 6 | */ |
| 7 | |
Ingo Molnar | b12fb7f | 2017-02-08 18:51:33 +0100 | [diff] [blame] | 8 | #include <linux/sched.h> |
| 9 | |
Ingo Molnar | 9a07000 | 2017-02-02 19:10:05 +0100 | [diff] [blame] | 10 | #ifdef CONFIG_TASK_XACCT |
| 11 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) |
| 12 | { |
| 13 | tsk->ioac.rchar += amt; |
| 14 | } |
| 15 | |
| 16 | static inline void add_wchar(struct task_struct *tsk, ssize_t amt) |
| 17 | { |
| 18 | tsk->ioac.wchar += amt; |
| 19 | } |
| 20 | |
| 21 | static inline void inc_syscr(struct task_struct *tsk) |
| 22 | { |
| 23 | tsk->ioac.syscr++; |
| 24 | } |
| 25 | |
| 26 | static inline void inc_syscw(struct task_struct *tsk) |
| 27 | { |
| 28 | tsk->ioac.syscw++; |
| 29 | } |
| 30 | #else |
| 31 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | static inline void add_wchar(struct task_struct *tsk, ssize_t amt) |
| 36 | { |
| 37 | } |
| 38 | |
| 39 | static inline void inc_syscr(struct task_struct *tsk) |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | static inline void inc_syscw(struct task_struct *tsk) |
| 44 | { |
| 45 | } |
| 46 | #endif |
| 47 | |
Ingo Molnar | b12fb7f | 2017-02-08 18:51:33 +0100 | [diff] [blame] | 48 | #endif /* _LINUX_SCHED_XACCT_H */ |