summaryrefslogtreecommitdiff
path: root/include/linux/sched/xacct.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched/xacct.h')
-rw-r--r--include/linux/sched/xacct.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/sched/xacct.h b/include/linux/sched/xacct.h
index 890f7ce5cd27..a28156a0d34a 100644
--- a/include/linux/sched/xacct.h
+++ b/include/linux/sched/xacct.h
@@ -1,6 +1,48 @@
#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++;
+}
+#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)
+{
+}
+#endif
+
#endif /* _LINUX_SCHED_XACCT_H */