def _get_rt(self, pid): scheduler = schedutils.get_scheduler(pid) sched_str = schedutils.schedstr(scheduler) priority = schedutils.get_priority(pid) log.debug("Read scheduler policy '%s' and priority '%d' of PID '%d'" % (sched_str, priority, pid)) return (scheduler, priority)
def show_settings(pid): policy = schedutils.get_scheduler(pid) spolicy = schedutils.schedstr(policy) rtprio = schedutils.get_priority(pid) reset_on_fork = "" if policy & schedutils.SCHED_RESET_ON_FORK: reset_on_fork = "|SCHED_RESET_ON_FORK" print '''pid %d's current scheduling policy: %s%s pid %d's current scheduling priority: %d''' % (pid, spolicy, reset_on_fork, pid, rtprio)
def get_priority(self, pid): return schedutils.get_priority(pid)