Fix crash with SCHED_IDLE policy

There are two new schduling policies to be recognized by cset.  SCHED_ISO and
SCHED_IDLE.  The former is not yet implemented in Linux kernel so we write out
'???' when we encounter its code.  For the latter there is the string 'idl'.

Signed-off-by: Libor Pechacek <lpechacek@suse.com>
python3
Libor Pechacek 9 years ago
parent 2214078783
commit de1ae0d598

@ -684,7 +684,7 @@ def move_pidspec(pidspec, toset, fset=None, threads=False):
def task_detail(pid, width=70):
# scheduler policy definitions
policy = ['o', 'f', 'r', 'b']
policy = ['o', 'f', 'r', 'b', '?', 'i']
# stat location definitions
statdef = {
'pid': 0,
@ -732,6 +732,11 @@ def task_detail(pid, width=70):
out2.append('th')
elif stat[statdef['rtpolicy']] == '3':
out2.append('at')
# SCHED_ISO is reserved but not yet implemented as of Linux v4.4
elif stat[statdef['rtpolicy']] == '4':
out2.append('??')
elif stat[statdef['rtpolicy']] == '5':
out2.append('dl')
else:
if int(stat[statdef['rtpriority']]) < 10:
out2.append('_')

Loading…
Cancel
Save