xacct.h 995 B

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