简体   繁体   中英

Why I can't see my process which is created fork function in linux top command

I have a C program which creates processes with fork() and prints pid of them with get_pid(). While this program is running, I use "top" command to see same processes, but I can't see them in there. Why? and how I can see my processes with "top" command?

top sorts according to a field, by default this is cpu time

your C program is probably too small and efficient to show up in the list

to see similar metrics to top but for a specific pid use ps, for example

ps -lp 12188

I'm with @Vorsprung. You may also note that you can use top with a pid argument:

top -p PID

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM