msm_sysstats.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _UAPI_MSM_SYSSTATS_H_
  7. #define _UAPI_MSM_SYSSTATS_H_
  8. #include <linux/types.h>
  9. #define SYSSTATS_GENL_NAME "SYSSTATS"
  10. #define SYSSTATS_GENL_VERSION 0x2
  11. #define TS_COMM_LEN 32
  12. #define SYSSTATS_TYPE_UNSPEC 0
  13. #define SYSSTATS_TASK_TYPE_STATS 1
  14. #define SYSSTATS_TYPE_NULL 2
  15. #define SYSSTATS_TASK_TYPE_FOREACH 3
  16. #define SYSSTATS_MEMINFO_TYPE_STATS 4
  17. #define SYSSTATS_PID_TYPE_STATS 5
  18. #define SYSSTATS_CMD_ATTR_UNSPEC 0
  19. #define SYSSTATS_TASK_CMD_ATTR_PID 1
  20. #define SYSSTATS_TASK_CMD_ATTR_FOREACH 2
  21. #define SYSSTATS_TASK_CMD_ATTR_PIDS_OF_NAME 3
  22. #define SYSSTATS_CMD_UNSPEC 0
  23. #define SYSSTATS_TASK_CMD_GET 1
  24. #define SYSSTATS_TASK_CMD_NEW 2
  25. #define SYSSTATS_MEMINFO_CMD_GET 3
  26. #define SYSSTATS_MEMINFO_CMD_NEW 4
  27. #define SYSSTATS_PIDS_CMD_GET 5
  28. #define SYSSTATS_PIDS_CMD_NEW 6
  29. struct sysstats_task {
  30. __u64 anon_rss; /* KB */
  31. __u64 file_rss; /* KB */
  32. __u64 swap_rss; /* KB */
  33. __u64 shmem_rss; /* KB */
  34. __u64 unreclaimable; /* KB */
  35. __u64 utime; /* User CPU time [usec] */
  36. __u64 stime; /* System CPU time [usec] */
  37. __u64 cutime; /* Cumulative User CPU time [usec] */
  38. __u64 cstime; /* Cumulative System CPU time [usec] */
  39. __s16 oom_score;
  40. __s16 __padding;
  41. __u32 pid;
  42. __u32 uid;
  43. __u32 ppid; /* Parent process ID */
  44. char name[TS_COMM_LEN]; /* Command name */
  45. char state[TS_COMM_LEN]; /* Process state */
  46. };
  47. /*
  48. * All values in KB.
  49. */
  50. struct sysstats_mem {
  51. __u64 memtotal;
  52. __u64 misc_reclaimable;
  53. __u64 unreclaimable;
  54. __u64 zram_compressed;
  55. __u64 swap_used;
  56. __u64 swap_total;
  57. __u64 buffer;
  58. __u64 vmalloc_total;
  59. __u64 swapcache;
  60. __u64 slab_reclaimable;
  61. __u64 slab_unreclaimable;
  62. __u64 free_cma;
  63. __u64 file_mapped;
  64. __u64 pagetable;
  65. __u64 kernelstack;
  66. __u64 shmem;
  67. __u64 dma_nr_free;
  68. __u64 dma_nr_active_anon;
  69. __u64 dma_nr_inactive_anon;
  70. __u64 dma_nr_active_file;
  71. __u64 dma_nr_inactive_file;
  72. __u64 normal_nr_free;
  73. __u64 normal_nr_active_anon;
  74. __u64 normal_nr_inactive_anon;
  75. __u64 normal_nr_active_file;
  76. __u64 normal_nr_inactive_file;
  77. __u64 movable_nr_free;
  78. __u64 movable_nr_active_anon;
  79. __u64 movable_nr_inactive_anon;
  80. __u64 movable_nr_active_file;
  81. __u64 movable_nr_inactive_file;
  82. __u64 highmem_nr_free;
  83. __u64 highmem_nr_active_anon;
  84. __u64 highmem_nr_inactive_anon;
  85. __u64 highmem_nr_active_file;
  86. __u64 highmem_nr_inactive_file;
  87. };
  88. struct sysstats_pid {
  89. __u64 pid;
  90. };
  91. #endif /* _UAPI_MSM_SYSSTATS_H_ */