def get_thread_cpu(thread):
 cmd = ('ps -o cpuid,lwp -eL | grep -w %s$' % thread)
 cpu_thread = system_output(cmd)
 if (not cpu_thread):
  return []
 return list(set([_.strip().split()[0] for _ in cpu_thread.splitlines()]))

def get_thread_cpu ( thread ) : cmd = ( 'ps -o cpuid,lwp -eL | grep -w %s$' % thread ) cpu_thread = system_output ( cmd ) if ( not cpu_thread ) : return [ ] return list ( set ( [ _ . strip ( ) . split ( ) [ 0 ] for _ in cpu_thread . splitlines ( ) ] ) )
get the light weight process used cpus .