@
howellz 学到了,多谢大佬,学习了
$ man procfs
/proc/[tid] subdirectories
Each one of these subdirectories contains files and subdirectories exposing information about the thread with the corre‐
sponding thread ID. The contents of these directories are the same as the corresponding /proc/[pid]/task/[tid] directo‐
ries.
The /proc/[tid] subdirectories are not visible when iterating through /proc with getdents(2) (and thus are not visible
when one uses ls(1) to view the contents of /proc).
然后用 sysdig 抓 ls /proc
第一个命令行:$ sudo sysdig
proc.name = ls
第二个命令行:$ ls /proc
然后第一个命令行得到:
...
333156 14:54:19.153132412 4 ls (671251) > stat
333159 14:54:19.153141644 4 ls (671251) < stat res=0 path=/proc
333160 14:54:19.153149403 4 ls (671251) > openat
333161 14:54:19.153159898 4 ls (671251) > fstat fd=-82524538700541
333162 14:54:19.153161715 4 ls (671251) < fstat res=0
333164 14:54:19.153169912 4 ls (671251) > getdents64 fd=137455746819
333175 14:54:19.154214139 4 ls (671251) < getdents64 res=11840
333176 14:54:19.154223263 4 ls (671251) > lstat
333177 14:54:19.154232665 4 ls (671251) < lstat res=0 path=/proc/fb
333178 14:54:19.154238761 4 ls (671251) > lstat
333179 14:54:19.154242851 4 ls (671251) < lstat res=0 path=/proc/fs
333180 14:54:19.154247207 4 ls (671251) > lstat
333181 14:54:19.154250957 4 ls (671251) < lstat res=0 path=/proc/bus
333182 14:54:19.154254649 4 ls (671251) > lstat
333183 14:54:19.154257514 4 ls (671251) < lstat res=0 path=/proc/dma
333184 14:54:19.154260911 4 ls (671251) > lstat
333185 14:54:19.154263837 4 ls (671251) < lstat res=0 path=/proc/i8k
...