danatel Asked: 2010-01-20 04:19:26 +0800 CST2010-01-20 04:19:26 +0800 CST 2010-01-20 04:19:26 +0800 CST busybox - how to list process priority? 772 How to list process priority on an embedded linux with busybox? busybox ps 2 Answers Voted Best Answer Dennis Williamson 2010-01-20T06:09:08+08:002010-01-20T06:09:08+08:00 Busybox can be compiled with ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS which will enable nice among others. Then you can do, for example: busybox ps -o pid,nice,user,args POSIX user, group, comm, args, pid, ppid, pgid, tty, vsz ENABLE_FEATURE_PS_TIME etime, time ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS nice, rgroup, ruser, pcpu (although pcpu seems to be commented out) Non-POSIX rss ENABLE_SELINUX label Razan Paul 2017-03-03T17:24:55+08:002017-03-03T17:24:55+08:00 If you have a cut-down Linux distribution where ps and top does not give you priority information, you can parse the stat file of proc for your process ID to get the priority information. cat /proc/PID/stat | awk '{print "priority " $18 " nice " $19}' The values at position 18 and 19 of stat file represent priority and nice For more: https://linux.die.net/man/5/proc
Busybox can be compiled with
ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS
which will enablenice
among others. Then you can do, for example:POSIX
ENABLE_FEATURE_PS_TIME
ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS
Non-POSIX
ENABLE_SELINUX
If you have a cut-down Linux distribution where ps and top does not give you priority information, you can parse the stat file of proc for your process ID to get the priority information.
The values at position 18 and 19 of stat file represent priority and nice
For more: https://linux.die.net/man/5/proc