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