PCPProcess.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef HEADER_PCPProcess
  2. #define HEADER_PCPProcess
  3. /*
  4. htop - PCPProcess.h
  5. (C) 2014 Hisham H. Muhammad
  6. (C) 2020 htop dev team
  7. (C) 2020-2021 Red Hat, Inc. All Rights Reserved.
  8. Released under the GNU GPLv2+, see the COPYING file
  9. in the source distribution for its full text.
  10. */
  11. #include <stdbool.h>
  12. #include "Machine.h"
  13. #include "Object.h"
  14. #include "Process.h"
  15. #define PROCESS_FLAG_LINUX_CGROUP 0x00000800
  16. #define PROCESS_FLAG_LINUX_OOM 0x00001000
  17. #define PROCESS_FLAG_LINUX_SMAPS 0x00002000
  18. #define PROCESS_FLAG_LINUX_CTXT 0x00004000
  19. #define PROCESS_FLAG_LINUX_SECATTR 0x00008000
  20. #define PROCESS_FLAG_LINUX_AUTOGROUP 0x00080000
  21. typedef struct PCPProcess_ {
  22. Process super;
  23. /* default result offset to use for searching proc metrics */
  24. unsigned int offset;
  25. unsigned long int cminflt;
  26. unsigned long int cmajflt;
  27. unsigned long long int utime;
  28. unsigned long long int stime;
  29. unsigned long long int cutime;
  30. unsigned long long int cstime;
  31. long m_share;
  32. long m_priv;
  33. long m_pss;
  34. long m_swap;
  35. long m_psswp;
  36. long m_trs;
  37. long m_drs;
  38. long m_lrs;
  39. long m_dt;
  40. /* Data read (in kilobytes) */
  41. unsigned long long io_rchar;
  42. /* Data written (in kilobytes) */
  43. unsigned long long io_wchar;
  44. /* Number of read(2) syscalls */
  45. unsigned long long io_syscr;
  46. /* Number of write(2) syscalls */
  47. unsigned long long io_syscw;
  48. /* Storage data read (in kilobytes) */
  49. unsigned long long io_read_bytes;
  50. /* Storage data written (in kilobytes) */
  51. unsigned long long io_write_bytes;
  52. /* Storage data cancelled (in kilobytes) */
  53. unsigned long long io_cancelled_write_bytes;
  54. /* Point in time of last io scan (in seconds elapsed since the Epoch) */
  55. unsigned long long io_last_scan_time;
  56. double io_rate_read_bps;
  57. double io_rate_write_bps;
  58. char* cgroup;
  59. char* cgroup_short;
  60. char* container_short;
  61. long int autogroup_id;
  62. int autogroup_nice;
  63. unsigned int oom;
  64. unsigned long long int delay_read_time;
  65. unsigned long long cpu_delay_total;
  66. unsigned long long blkio_delay_total;
  67. unsigned long long swapin_delay_total;
  68. float cpu_delay_percent;
  69. float blkio_delay_percent;
  70. float swapin_delay_percent;
  71. unsigned long ctxt_total;
  72. unsigned long ctxt_diff;
  73. char* secattr;
  74. unsigned long long int last_mlrs_calctime;
  75. } PCPProcess;
  76. extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD];
  77. extern const ProcessClass PCPProcess_class;
  78. Process* PCPProcess_new(const Machine* host);
  79. void Process_delete(Object* cast);
  80. bool Process_isThread(const Process* this);
  81. #endif