Individual thread priority checking using command line in linux
Asked Answered
S

4

6

I can see number of threads used in application by going to /proc/$(pidof task)/ and giving

cat status.

Is there any way to check individual thread priority in linux using commands?

Regards,
Learner

Samuels answered 21/1, 2014 at 9:11 Comment(0)
T
4

Run ps with-m -l. It will list all the thread and priority with respect to particular PID

ps -m -l [PID]

Example:

PC@PCuser:~$ ps -m -l 10070

F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY        TIME CMD
0 -  1000 10070     1  0   -   - - 31325 -      ?          0:42 gedit
0 S  1000     -     -  0  80   0 -     - poll_s -          0:41 -
1 S  1000     -     -  0  80   0 -     - poll_s -          0:00 -
1 S  1000     -     -  0  80   0 -     - poll_s -          0:00 -

EDIT:

PC@PCuser:~$ ps -T -l [PID]

F S   UID   PID  SPID  PPID  C PRI  NI ADDR SZ WCHAN  TTY        TIME CMD
0 S  1000 10070 10070     1  0  80   0 - 31325 poll_s ?          0:42 gedit
1 S  1000 10070 10073     1  0  80   0 - 31325 poll_s ?          0:00 gedit
1 S  1000 10070 10074     1  0  80   0 - 31325 poll_s ?          0:00 gedit
Theophany answered 21/1, 2014 at 9:29 Comment(3)
I prefer ps -T -l [PID]Vocation
Yes you are correct. It will give some more information. I will update my answerTheophany
What is the priority range? Higher number means higher priority?Vulgarism
F
2

$ ps -T -l [PID] can give me more information, but it can't provide the thread name on my system. I combine this result and (gdb) info thread to get more details.

Friesland answered 21/9, 2019 at 6:6 Comment(0)
N
2

ps -T -l -p [PID] This command gives me the thread priority info with the thread names

Nonego answered 31/10, 2023 at 18:35 Comment(0)
V
1

Or, top -H (or top followed by hitting the H key) for interactive view.

However cf. https://superuser.com/questions/286752/unix-ps-l-priority

Vocation answered 21/1, 2014 at 9:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.