latencytop.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * latencytop.h: Infrastructure for displaying latency
  3. *
  4. * (C) Copyright 2008 Intel Corporation
  5. * Author: Arjan van de Ven <arjan@linux.intel.com>
  6. *
  7. */
  8. #ifndef _INCLUDE_GUARD_LATENCYTOP_H_
  9. #define _INCLUDE_GUARD_LATENCYTOP_H_
  10. #include <linux/compiler.h>
  11. struct task_struct;
  12. #ifdef CONFIG_LATENCYTOP
  13. #define LT_SAVECOUNT 32
  14. #define LT_BACKTRACEDEPTH 12
  15. struct latency_record {
  16. unsigned long backtrace[LT_BACKTRACEDEPTH];
  17. unsigned int count;
  18. unsigned long time;
  19. unsigned long max;
  20. };
  21. extern int latencytop_enabled;
  22. void __account_scheduler_latency(struct task_struct *task, int usecs, int inter);
  23. static inline void
  24. account_scheduler_latency(struct task_struct *task, int usecs, int inter)
  25. {
  26. if (unlikely(latencytop_enabled))
  27. __account_scheduler_latency(task, usecs, inter);
  28. }
  29. void clear_all_latency_tracing(struct task_struct *p);
  30. extern int sysctl_latencytop(struct ctl_table *table, int write,
  31. void __user *buffer, size_t *lenp, loff_t *ppos);
  32. #else
  33. static inline void
  34. account_scheduler_latency(struct task_struct *task, int usecs, int inter)
  35. {
  36. }
  37. static inline void clear_all_latency_tracing(struct task_struct *p)
  38. {
  39. }
  40. #endif
  41. #endif