예제 #1
0
파일: irqview.py 프로젝트: noushi/tuna
    def set_irq_columns(self, iter, irq, irq_info, nics):
        new_value = [None] * self.nr_columns
        users = tuna.get_irq_users(self.irqs, irq, nics)
        if self.has_threaded_irqs:
            irq_re = tuna.threaded_irq_re(irq)
            pids = self.ps.find_by_regex(irq_re)
            if pids:
                pid = pids[0]
                prio = int(self.ps[pid]["stat"]["rt_priority"])
                sched = schedutils.schedstr(schedutils.get_scheduler(pid))[6:]
            else:
                sched = ""
                pid = -1
                prio = -1
            new_value[self.COL_PID] = pid
            new_value[self.COL_POL] = sched
            new_value[self.COL_PRI] = prio

        new_value[self.COL_NUM] = irq
        new_value[self.COL_AFF] = tuna.get_irq_affinity_text(self.irqs, irq)
        new_value[self.COL_EVENTS] = reduce(lambda a, b: a + b,
                                            irq_info["cpu"])
        new_value[self.COL_USERS] = ",".join(users)

        gui.set_store_columns(self.list_store, iter, new_value)
예제 #2
0
파일: procview.py 프로젝트: bristot/tuna
	def set_thread_columns(self, iter, tid, thread_info):
		new_value = [ None ] * self.nr_columns

		new_value[self.COL_PRI] = int(thread_info["stat"]["rt_priority"])
		new_value[self.COL_POL] = schedutils.schedstr(schedutils.get_scheduler(tid))[6:]
		thread_affinity_list = schedutils.get_affinity(tid)

		new_value[self.COL_PID] = tid
		new_value[self.COL_AFF] = tuna.list_to_cpustring(thread_affinity_list)
		try:
			new_value[self.COL_VOLCTXT] = int(thread_info["status"]["voluntary_ctxt_switches"])
			new_value[self.COL_NONVOLCTXT] = int(thread_info["status"]["nonvoluntary_ctxt_switches"])
			new_value[self.COL_CGROUP] = thread_info["cgroups"]
		except:
			pass

		new_value[self.COL_CMDLINE] = procfs.process_cmdline(thread_info)

		gui.set_store_columns(self.tree_store, iter, new_value)
예제 #3
0
파일: procview.py 프로젝트: noushi/tuna
    def set_thread_columns(self, iter, tid, thread_info):
        new_value = [None] * self.nr_columns

        new_value[self.COL_PRI] = int(thread_info["stat"]["rt_priority"])
        new_value[self.COL_POL] = schedutils.schedstr(
            schedutils.get_scheduler(tid))[6:]
        thread_affinity_list = schedutils.get_affinity(tid)

        new_value[self.COL_PID] = tid
        new_value[self.COL_AFF] = tuna.list_to_cpustring(thread_affinity_list)
        try:
            new_value[self.COL_VOLCTXT] = int(
                thread_info["status"]["voluntary_ctxt_switches"])
            new_value[self.COL_NONVOLCTXT] = int(
                thread_info["status"]["nonvoluntary_ctxt_switches"])
            new_value[self.COL_CGROUP] = thread_info["cgroups"]
        except:
            pass

        new_value[self.COL_CMDLINE] = procfs.process_cmdline(thread_info)

        gui.set_store_columns(self.tree_store, iter, new_value)
예제 #4
0
파일: irqview.py 프로젝트: bristot/tuna
	def set_irq_columns(self, iter, irq, irq_info, nics):
		new_value = [ None ] * self.nr_columns
		users = tuna.get_irq_users(self.irqs, irq, nics)
		if self.has_threaded_irqs:
			irq_re = tuna.threaded_irq_re(irq)
			pids = self.ps.find_by_regex(irq_re)
			if pids:
				pid = pids[0]
				prio = int(self.ps[pid]["stat"]["rt_priority"])
				sched = schedutils.schedstr(schedutils.get_scheduler(pid))[6:]
			else:
				sched = ""
				pid = -1
				prio = -1
			new_value[self.COL_PID] = pid
			new_value[self.COL_POL] = sched
			new_value[self.COL_PRI] = prio

		new_value[self.COL_NUM] = irq
		new_value[self.COL_AFF] = tuna.get_irq_affinity_text(self.irqs, irq)
		new_value[self.COL_EVENTS] = reduce(lambda a, b: a + b, irq_info["cpu"])
		new_value[self.COL_USERS] = ",".join(users)

		gui.set_store_columns(self.list_store, iter, new_value)