Created
April 28, 2017 20:56
-
-
Save ebarcikowski/28274ac5532b78aedad5cc04dbdc4f8d to your computer and use it in GitHub Desktop.
set RT interupt priorities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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