Exemplo n.º 1
0
    def include_cpus(self, cpus):
        self.previous_pid_affinities, \
          self.previous_irq_affinities = tuna.include_cpus(cpus, self.cpus.nr_cpus)

        if self.previous_pid_affinities:
            self.procview.refresh()

        if self.previous_irq_affinities:
            self.irqview.refresh()
Exemplo n.º 2
0
	def include_cpus(self, cpus):
		self.previous_pid_affinities, \
		  self.previous_irq_affinities = tuna.include_cpus(cpus, self.cpus.nr_cpus)

		if self.previous_pid_affinities:
			self.procview.refresh()

		if self.previous_irq_affinities:
			self.irqview.refresh()
Exemplo n.º 3
0
			if not op:
				irq_list = None
		elif o in ("-f", "--filter"):
			filter = True
		elif o in ("-g", "--gui"):
			run_gui = True
		elif o in ("-i", "--isolate"):
			if not cpu_list:
				print "tuna: --isolate " + _("requires a cpu list!")
				sys.exit(2)
			tuna.isolate_cpus(cpu_list, get_nr_cpus())
		elif o in ("-I", "--include"):
			if not cpu_list:
				print "tuna: --include " + _("requires a cpu list!")
				sys.exit(2)
			tuna.include_cpus(cpu_list, get_nr_cpus())
		elif o in ("-p", "--priority"):
			if not thread_list:
				print ("tuna: %s " % o) + _("requires a thread list!")
				sys.exit(2)
			try:
				tuna.threads_set_priority(thread_list, a, affect_children)
			except (SystemError, OSError) as err: # (3, 'No such process') old python-schedutils incorrectly raised SystemError
				print "tuna: %s" % err
				sys.exit(2)
		elif o in ("-P", "--show_threads"):
			# If the user specified process names that weren't
			# resolved to pids, don't show all threads.
			if not thread_list and not irq_list:
				if thread_list_str or irq_list_str:
					continue
Exemplo n.º 4
0
     if not op:
         irq_list = None
 elif o in ("-f", "--filter"):
     filter = True
 elif o in ("-g", "--gui"):
     run_gui = True
 elif o in ("-i", "--isolate"):
     if not cpu_list:
         print "tuna: --isolate " + _("requires a cpu list!")
         sys.exit(2)
     tuna.isolate_cpus(cpu_list, consolewriter.get_nr_cpus())
 elif o in ("-I", "--include"):
     if not cpu_list:
         print "tuna: --include " + _("requires a cpu list!")
         sys.exit(2)
     tuna.include_cpus(cpu_list, consolewriter.get_nr_cpus())
 elif o in ("-p", "--priority"):
     if not thread_list:
         print("tuna: %s " % o) + _("requires a thread list!")
         sys.exit(2)
     try:
         tuna.threads_set_priority(thread_list, a, affect_children)
     except (
             SystemError, OSError
     ) as err:  # (3, 'No such process') old python-schedutils incorrectly raised SystemError
         print "tuna: %s" % err
         sys.exit(2)
 elif o in ("-P", "--show_threads"):
     # If the user specified process names that weren't
     # resolved to pids, don't show all threads.
     if not thread_list and not irq_list:
Exemplo n.º 5
0
     if not op:
         irq_list = None
 elif o in ("-f", "--filter"):
     filter = True
 elif o in ("-g", "--gui"):
     run_gui = True
 elif o in ("-i", "--isolate"):
     if not cpu_list:
         print "tuna: --isolate " + _("requires a cpu list!")
         sys.exit(2)
     tuna.isolate_cpus(cpu_list, get_nr_cpus())
 elif o in ("-I", "--include"):
     if not cpu_list:
         print "tuna: --include " + _("requires a cpu list!")
         sys.exit(2)
     tuna.include_cpus(cpu_list, get_nr_cpus())
 elif o in ("-p", "--priority"):
     if not thread_list:
         print ("tuna: %s " % o) + _("requires a thread list!")
         sys.exit(2)
     try:
         tuna.threads_set_priority(thread_list, a, affect_children)
     except (
         SystemError,
         OSError,
     ) as err:  # (3, 'No such process') old python-schedutils incorrectly raised SystemError
         print "tuna: %s" % err
         sys.exit(2)
 elif o in ("-P", "--show_threads"):
     # If the user specified process names that weren't
     # resolved to pids, don't show all threads.