Example #1
0
 def threads(self):
     ret = []
     tids = os.listdir('/proc/%d/lwp' % self.pid)
     hit_enoent = False
     for tid in tids:
         tid = int(tid)
         try:
             utime, stime = cext.query_process_thread(self.pid, tid)
         except EnvironmentError as err:
             # ENOENT == thread gone in meantime
             if err.errno == errno.ENOENT:
                 hit_enoent = True
                 continue
             raise
         else:
             nt = _common.pthread(tid, utime, stime)
             ret.append(nt)
     if hit_enoent:
         # raise NSP if the process disappeared on us
         os.stat('/proc/%s' % self.pid)
     return ret
Example #2
0
 def get_process_threads(self):
     ret = []
     tids = os.listdir('/proc/%d/lwp' % self.pid)
     hit_enoent = False
     for tid in tids:
         tid = int(tid)
         try:
             utime, stime = _psutil_sunos.query_process_thread(self.pid, tid)
         except EnvironmentError:
             # ENOENT == thread gone in meantime
             err = sys.exc_info()[1]
             if err.errno == errno.ENOENT:
                 hit_enoent = True
                 continue
             raise
         else:
             nt = nt_thread(tid, utime, stime)
             ret.append(nt)
     if hit_enoent:
         # raise NSP if the process disappeared on us
         os.stat('/proc/%s' % self.pid)
     return ret
Example #3
0
 def get_process_threads(self):
     ret = []
     tids = os.listdir('/proc/%d/lwp' % self.pid)
     hit_enoent = False
     for tid in tids:
         tid = int(tid)
         try:
             utime, stime = _psutil_sunos.query_process_thread(self.pid, tid)
         except EnvironmentError:
             # ENOENT == thread gone in meantime
             err = sys.exc_info()[1]
             if err.errno == errno.ENOENT:
                 hit_enoent = True
                 continue
             raise
         else:
             nt = nt_thread(tid, utime, stime)
             ret.append(nt)
     if hit_enoent:
         # raise NSP if the process disappeared on us
         os.stat('/proc/%s' % self.pid)
     return ret
Example #4
0
 def threads(self):
     ret = []
     tids = os.listdir('/proc/%d/lwp' % self.pid)
     hit_enoent = False
     for tid in tids:
         tid = int(tid)
         try:
             utime, stime = cext.query_process_thread(
                 self.pid, tid)
         except EnvironmentError as err:
             # ENOENT == thread gone in meantime
             if err.errno == errno.ENOENT:
                 hit_enoent = True
                 continue
             raise
         else:
             nt = _common.pthread(tid, utime, stime)
             ret.append(nt)
     if hit_enoent:
         # raise NSP if the process disappeared on us
         os.stat('/proc/%s' % self.pid)
     return ret