Tag Archives: Tips

Easy way to get a priority of a process in Linux

So, I was researching online on how to get a priority of a Linux process (RT or not) and all asnwers used GNU top  or GNU ps , which is fine, but not on my embedded system that uses a simpler version of those tools from busy-box. Anyway, I know that procfs somehow shows that data, right. So with the help of man 5 proc  I wrote this small shell script that you can easily use to get the scheduling policy and its priority.

You can use as ./prio.sh PID .

I find this very useful on listing kernel thread priorities for PREEMPT_RT .

Enjoy.