Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _LINUX_SCHED_XACCT_H
0003 #define _LINUX_SCHED_XACCT_H
0004 
0005 /*
0006  * Extended task accounting methods:
0007  */
0008 
0009 #include <linux/sched.h>
0010 
0011 #ifdef CONFIG_TASK_XACCT
0012 static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
0013 {
0014     tsk->ioac.rchar += amt;
0015 }
0016 
0017 static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
0018 {
0019     tsk->ioac.wchar += amt;
0020 }
0021 
0022 static inline void inc_syscr(struct task_struct *tsk)
0023 {
0024     tsk->ioac.syscr++;
0025 }
0026 
0027 static inline void inc_syscw(struct task_struct *tsk)
0028 {
0029     tsk->ioac.syscw++;
0030 }
0031 #else
0032 static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
0033 {
0034 }
0035 
0036 static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
0037 {
0038 }
0039 
0040 static inline void inc_syscr(struct task_struct *tsk)
0041 {
0042 }
0043 
0044 static inline void inc_syscw(struct task_struct *tsk)
0045 {
0046 }
0047 #endif
0048 
0049 #endif /* _LINUX_SCHED_XACCT_H */