How to list process priority on an embedded linux with busybox?
Asked
Active
Viewed 1.9k times
2 Answers
6
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
Dennis Williamson
- 60,515
- 14
- 113
- 148
-
BusyBox `ps` also seems to support `stat` as a field to show the process status – kbolino Dec 14 '18 at 01:35
3
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
Razan Paul
- 211
- 2
- 5