Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要获取在特定进程中运行的不同线程所使用的资源。假设我给一个特定的 pid 作为输入,我必须获取有关该 pid 线程的信息(在用户、内核模式下花费的时间)。是否有一个处理有关线程的所有细节的 Proc 文件?
The information for the threads of a process can be found in the task subdirectory of the proc dir:
task
/proc/[pid]/task/[tid]/stat
Additionally, top can display thread information:
top
top -H -p [pid]