PCPMachine.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef HEADER_PCPMachine
  2. #define HEADER_PCPMachine
  3. /*
  4. htop - PCPMachine.h
  5. (C) 2014 Hisham H. Muhammad
  6. Released under the GNU GPLv2+, see the COPYING file
  7. in the source distribution for its full text.
  8. */
  9. #include <stdbool.h>
  10. #include <sys/types.h>
  11. #include "Hashtable.h"
  12. #include "Machine.h"
  13. #include "UsersTable.h"
  14. #include "pcp/Platform.h"
  15. #include "linux/ZswapStats.h"
  16. #include "zfs/ZfsArcStats.h"
  17. typedef enum CPUMetric_ {
  18. CPU_TOTAL_TIME,
  19. CPU_USER_TIME,
  20. CPU_SYSTEM_TIME,
  21. CPU_SYSTEM_ALL_TIME,
  22. CPU_IDLE_ALL_TIME,
  23. CPU_IDLE_TIME,
  24. CPU_NICE_TIME,
  25. CPU_IOWAIT_TIME,
  26. CPU_IRQ_TIME,
  27. CPU_SOFTIRQ_TIME,
  28. CPU_STEAL_TIME,
  29. CPU_GUEST_TIME,
  30. CPU_GUESTNICE_TIME,
  31. CPU_TOTAL_PERIOD,
  32. CPU_USER_PERIOD,
  33. CPU_SYSTEM_PERIOD,
  34. CPU_SYSTEM_ALL_PERIOD,
  35. CPU_IDLE_ALL_PERIOD,
  36. CPU_IDLE_PERIOD,
  37. CPU_NICE_PERIOD,
  38. CPU_IOWAIT_PERIOD,
  39. CPU_IRQ_PERIOD,
  40. CPU_SOFTIRQ_PERIOD,
  41. CPU_STEAL_PERIOD,
  42. CPU_GUEST_PERIOD,
  43. CPU_GUESTNICE_PERIOD,
  44. CPU_FREQUENCY,
  45. CPU_METRIC_COUNT
  46. } CPUMetric;
  47. typedef struct PCPMachine_ {
  48. Machine super;
  49. int smaps_flag;
  50. double period;
  51. double timestamp; /* previous sample timestamp */
  52. pmAtomValue* cpu; /* aggregate values for each metric */
  53. pmAtomValue** percpu; /* per-processor values for each metric */
  54. pmAtomValue* values; /* per-processor buffer for just one metric */
  55. ZfsArcStats zfs;
  56. /*ZramStats zram; -- not needed, calculated in-line in Platform.c */
  57. ZswapStats zswap;
  58. } PCPMachine;
  59. #endif