File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ def monitor_processes(self):
120
120
121
121
out += "[%5d] %s %s %.1f%% (%s / %s)" % (
122
122
proc .pid ,
123
- proc .exe_name ,
123
+ proc .name ,
124
124
fd_stale .path ,
125
125
progress_pcnt * 100 ,
126
126
format_size (float (fd_stale .fdinfo .pos )),
Original file line number Diff line number Diff line change @@ -60,6 +60,14 @@ def exe_name(self):
60
60
"""Returns the basename of the exe path"""
61
61
return os .path .basename (self .exe )
62
62
63
+ @property
64
+ def name (self ):
65
+ try :
66
+ with open ('/proc/{0}/stat' .format (self .pid )) as f :
67
+ return f .read ().split (' ' )[1 ].replace ('(' , '' ).replace (')' , '' )
68
+ except (IOError , OSError ):
69
+ return ''
70
+
63
71
@property
64
72
def open_files (self ):
65
73
"""
@@ -100,6 +108,6 @@ def procs_by_binary_name(bin_name):
100
108
procs = []
101
109
for pid in get_pids ():
102
110
proc = Process (pid )
103
- if proc .exe_name == bin_name :
111
+ if proc .exe_name == bin_name or proc . name == bin_name :
104
112
procs .append (proc )
105
113
return procs
You can’t perform that action at this time.
0 commit comments