blob: c078f0a94ceca7ddae6630fc6640f3553d5d8a42 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Ingo Molnarb12fb7f2017-02-08 18:51:33 +01002#ifndef _LINUX_SCHED_XACCT_H
3#define _LINUX_SCHED_XACCT_H
4
Ingo Molnar9a070002017-02-02 19:10:05 +01005/*
6 * Extended task accounting methods:
7 */
8
Ingo Molnarb12fb7f2017-02-08 18:51:33 +01009#include <linux/sched.h>
10
Ingo Molnar9a070002017-02-02 19:10:05 +010011#ifdef CONFIG_TASK_XACCT
12static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
13{
14 tsk->ioac.rchar += amt;
15}
16
17static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
18{
19 tsk->ioac.wchar += amt;
20}
21
22static inline void inc_syscr(struct task_struct *tsk)
23{
24 tsk->ioac.syscr++;
25}
26
27static inline void inc_syscw(struct task_struct *tsk)
28{
29 tsk->ioac.syscw++;
30}
31#else
32static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
33{
34}
35
36static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
37{
38}
39
40static inline void inc_syscr(struct task_struct *tsk)
41{
42}
43
44static inline void inc_syscw(struct task_struct *tsk)
45{
46}
47#endif
48
Ingo Molnarb12fb7f2017-02-08 18:51:33 +010049#endif /* _LINUX_SCHED_XACCT_H */