github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/sentry/fs/proc/README.md (about) 1 This document tracks what is implemented in procfs. Refer to 2 Documentation/filesystems/proc.txt in the Linux project for information about 3 procfs generally. 4 5 **NOTE**: This document is not guaranteed to be up to date. If you find an 6 inconsistency, please file a bug. 7 8 [TOC] 9 10 ## Kernel data 11 12 The following files are implemented: 13 14 <!-- mdformat off(don't wrap the table) --> 15 16 | File /proc/ | Content | 17 | :------------------------ | :---------------------------------------------------- | 18 | [cpuinfo](#cpuinfo) | Info about the CPU | 19 | [filesystems](#filesystems) | Supported filesystems | 20 | [loadavg](#loadavg) | Load average of last 1, 5 & 15 minutes | 21 | [meminfo](#meminfo) | Overall memory info | 22 | [stat](#stat) | Overall kernel statistics | 23 | [sys](#sys) | Change parameters within the kernel | 24 | [uptime](#uptime) | Wall clock since boot, combined idle time of all cpus | 25 | [version](#version) | Kernel version | 26 27 <!-- mdformat on --> 28 29 ### cpuinfo 30 31 ```bash 32 $ cat /proc/cpuinfo 33 processor : 0 34 vendor_id : GenuineIntel 35 cpu family : 6 36 model : 45 37 model name : unknown 38 stepping : unknown 39 cpu MHz : 1234.588 40 fpu : yes 41 fpu_exception : yes 42 cpuid level : 13 43 wp : yes 44 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx xsaveopt 45 bogomips : 1234.59 46 clflush size : 64 47 cache_alignment : 64 48 address sizes : 46 bits physical, 48 bits virtual 49 power management: 50 51 ... 52 ``` 53 54 Notable divergences: 55 56 Field name | Notes 57 :--------------- | :--------------------------------------- 58 model name | Always unknown 59 stepping | Always unknown 60 fpu | Always yes 61 fpu_exception | Always yes 62 wp | Always yes 63 bogomips | Bogus value (matches cpu MHz) 64 clflush size | Always 64 65 cache_alignment | Always 64 66 address sizes | Always 46 bits physical, 48 bits virtual 67 power management | Always blank 68 69 Otherwise fields are derived from the sentry configuration. 70 71 ### filesystems 72 73 ```bash 74 $ cat /proc/filesystems 75 nodev 9p 76 nodev devpts 77 nodev devtmpfs 78 nodev proc 79 nodev sysfs 80 nodev tmpfs 81 ``` 82 83 ### loadavg 84 85 ```bash 86 $ cat /proc/loadavg 87 0.00 0.00 0.00 0/0 0 88 ``` 89 90 Column | Notes 91 :------------------------------------ | :---------- 92 CPU.IO utilization in last 1 minute | Always zero 93 CPU.IO utilization in last 5 minutes | Always zero 94 CPU.IO utilization in last 10 minutes | Always zero 95 Num currently running processes | Always zero 96 Total num processes | Always zero 97 98 TODO(b/62345059): Populate the columns with accurate statistics. 99 100 ### meminfo 101 102 ```bash 103 $ cat /proc/meminfo 104 MemTotal: 2097152 kB 105 MemFree: 2083540 kB 106 MemAvailable: 2083540 kB 107 Buffers: 0 kB 108 Cached: 4428 kB 109 SwapCache: 0 kB 110 Active: 10812 kB 111 Inactive: 2216 kB 112 Active(anon): 8600 kB 113 Inactive(anon): 0 kB 114 Active(file): 2212 kB 115 Inactive(file): 2216 kB 116 Unevictable: 0 kB 117 Mlocked: 0 kB 118 SwapTotal: 0 kB 119 SwapFree: 0 kB 120 Dirty: 0 kB 121 Writeback: 0 kB 122 AnonPages: 8600 kB 123 Mapped: 4428 kB 124 Shmem: 0 kB 125 126 ``` 127 128 Notable divergences: 129 130 Field name | Notes 131 :---------------- | :----------------------------------------------------- 132 Buffers | Always zero, no block devices 133 SwapCache | Always zero, no swap 134 Inactive(anon) | Always zero, see SwapCache 135 Unevictable | Always zero TODO(b/31823263) 136 Mlocked | Always zero TODO(b/31823263) 137 SwapTotal | Always zero, no swap 138 SwapFree | Always zero, no swap 139 Dirty | Always zero TODO(b/31823263) 140 Writeback | Always zero TODO(b/31823263) 141 MemAvailable | Uses the same value as MemFree since there is no swap. 142 Slab | Missing 143 SReclaimable | Missing 144 SUnreclaim | Missing 145 KernelStack | Missing 146 PageTables | Missing 147 NFS_Unstable | Missing 148 Bounce | Missing 149 WritebackTmp | Missing 150 CommitLimit | Missing 151 Committed_AS | Missing 152 VmallocTotal | Missing 153 VmallocUsed | Missing 154 VmallocChunk | Missing 155 HardwareCorrupted | Missing 156 AnonHugePages | Missing 157 ShmemHugePages | Missing 158 ShmemPmdMapped | Missing 159 HugePages_Total | Missing 160 HugePages_Free | Missing 161 HugePages_Rsvd | Missing 162 HugePages_Surp | Missing 163 Hugepagesize | Missing 164 DirectMap4k | Missing 165 DirectMap2M | Missing 166 DirectMap1G | Missing 167 168 ### stat 169 170 ```bash 171 $ cat /proc/stat 172 cpu 0 0 0 0 0 0 0 0 0 0 173 cpu0 0 0 0 0 0 0 0 0 0 0 174 cpu1 0 0 0 0 0 0 0 0 0 0 175 cpu2 0 0 0 0 0 0 0 0 0 0 176 cpu3 0 0 0 0 0 0 0 0 0 0 177 cpu4 0 0 0 0 0 0 0 0 0 0 178 cpu5 0 0 0 0 0 0 0 0 0 0 179 cpu6 0 0 0 0 0 0 0 0 0 0 180 cpu7 0 0 0 0 0 0 0 0 0 0 181 intr 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 182 ctxt 0 183 btime 1504040968 184 processes 0 185 procs_running 0 186 procs_blokkcked 0 187 softirq 0 0 0 0 0 0 0 0 0 0 0 188 ``` 189 190 All fields except for `btime` are always zero. 191 192 TODO(b/37226836): Populate with accurate fields. 193 194 ### sys 195 196 ```bash 197 $ ls /proc/sys 198 kernel vm 199 ``` 200 201 Directory | Notes 202 :-------- | :---------------------------- 203 abi | Missing 204 debug | Missing 205 dev | Missing 206 fs | Missing 207 kernel | Contains hostname (only) 208 net | Missing 209 user | Missing 210 vm | Contains mmap_min_addr (only) 211 212 ### uptime 213 214 ```bash 215 $ cat /proc/uptime 216 3204.62 0.00 217 ``` 218 219 Column | Notes 220 :------------------------------- | :---------------------------- 221 Total num seconds system running | Time since procfs was mounted 222 Number of seconds idle | Always zero 223 224 ### version 225 226 ```bash 227 $ cat /proc/version 228 Linux version 4.4 #1 SMP Sun Jan 10 15:06:54 PST 2016 229 ``` 230 231 ## Process-specific data 232 233 The following files are implemented: 234 235 File /proc/PID | Content 236 :---------------------- | :--------------------------------------------------- 237 [auxv](#auxv) | Copy of auxiliary vector for the process 238 [cmdline](#cmdline) | Command line arguments 239 [comm](#comm) | Command name associated with the process 240 [environ](#environ) | Process environment 241 [exe](#exe) | Symlink to the process's executable 242 [fd](#fd) | Directory containing links to open file descriptors 243 [fdinfo](#fdinfo) | Information associated with open file descriptors 244 [gid_map](#gid_map) | Mappings for group IDs inside the user namespace 245 [io](#io) | IO statistics 246 [maps](#maps) | Memory mappings (anon, executables, library files) 247 [mounts](#mounts) | Mounted filesystems 248 [mountinfo](#mountinfo) | Information about mounts 249 [ns](#ns) | Directory containing info about supported namespaces 250 [stat](#stat) | Process statistics 251 [statm](#statm) | Process memory statistics 252 [status](#status) | Process status in human readable format 253 [task](#task) | Directory containing info about running threads 254 [uid_map](#uid_map) | Mappings for user IDs inside the user namespace 255 256 ### auxv 257 258 TODO 259 260 ### cmdline 261 262 TODO 263 264 ### comm 265 266 TODO 267 268 ### environment 269 270 TODO 271 272 ### exe 273 274 TODO 275 276 ### fd 277 278 TODO 279 280 ### fdinfo 281 282 TODO 283 284 ### gid_map 285 286 TODO 287 288 ### io 289 290 Only has data for rchar, wchar, syscr, and syscw. 291 292 TODO: add more detail. 293 294 ### maps 295 296 TODO 297 298 ### mounts 299 300 TODO 301 302 ### mountinfo 303 304 TODO 305 306 ### ns 307 308 TODO 309 310 ### stat 311 312 Only has data for pid, comm, state, ppid, utime, stime, cutime, cstime, 313 num_threads, and exit_signal. 314 315 TODO: add more detail. 316 317 ### statm 318 319 Only has data for vss and rss. 320 321 TODO: add more detail. 322 323 ### status 324 325 Contains data for Name, State, Tgid, Pid, Ppid, TracerPid, FDSize, VmSize, 326 VmRSS, Threads, CapInh, CapPrm, CapEff, CapBnd, Seccomp. 327 328 TODO: add more detail. 329 330 ### task 331 332 TODO 333 334 ### uid_map 335 336 TODO