xacct.h 815 B

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