Skip to content

Instantly share code, notes, and snippets.

@ebarcikowski
Created April 28, 2017 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebarcikowski/28274ac5532b78aedad5cc04dbdc4f8d to your computer and use it in GitHub Desktop.
Save ebarcikowski/28274ac5532b78aedad5cc04dbdc4f8d to your computer and use it in GitHub Desktop.
set RT interupt priorities
def set_system_rt_priorities():
prio_table = {
'irq/8-rtc0': 90,
'ktimersoftd/0': 85,
'ktimersoftd/1': 85,
'ktimersoftd/2': 85,
'ktimersoftd/3': 85,
'irq/88-eth0': 85,
'irq/89-eth0-TxR': 85,
'irq/90-eth0-TxR': 85,
'irq/91-eth0-TxR': 85,
'irq/92-eth0-TxR': 85
}
for key in prio_table:
try:
cmd, pid, prio = lookup_prio(key)
new_prio = prio_table[key]
if prio < new_prio :
print("adjusting priority: {}, {}, {}->{}".format(
cmd, pid, prio, new_prio))
chrt_cmd = "chrt -fp {} {}".format(new_prio, pid)
subprocess.call(chrt_cmd, shell=True)
except subprocess.CalledProcessError:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment