简体   繁体   中英

How to get information about process in Linux

How can I get process statistics from kernel and return the buf as

number of processes : ticks_user : ticks_system : ticks_interrupt : cpuseconds : procsizes : resident segment sizes

I found some information in /proc/[pid]/stat , but there is no data about ticks system, ticks_interrupt, cpusecond .

Where can I find info about these?

Any pointers to API or documentation will be helpful

Use

ps ax
top
htop

for the start, read the manpage, and for top/htop press h to get a help screen q to quit;

However, none of the manpages mentions ticks - what is it?

You may can give vmstat a try it is not in ticks, but why do you need ticks?

CPU These are percentages of total CPU time. us: Time spent running non-kernel code. (user time, including nice time) sy: Time spent running kernel code. (system time) id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time. wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle. st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.

What are you planing to do with this information?

Sometimes it may also to grep through the kernel sources, trying your buzzwords.

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