提交 c4c0a2d5 编写于 作者: N nicolargo

AMP for kernel process is not working #1261

上级 3db4e105
......@@ -59,6 +59,7 @@ Bugs corrected:
* Glances --browser crashed when more than 40 glances servers on screen 78x45 #1256
* OSX - Python 3 and empty percent and res #1251
* Crashes when influxdb option set #1260
* AMP for kernel process is not working #1261
Backward-incompatible changes:
......
......@@ -27,7 +27,7 @@ import signal
import sys
# Global name
__version__ = '3.0.rc4'
__version__ = '3.0.rc5'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPLv3'
......
......@@ -112,9 +112,12 @@ class AmpsList(object):
# Do not update if the enable tag is set
continue
try:
# Search in both cmdline and name (for kernel thread, see #1261)
amps_list = [p for p in processlist for c in p['cmdline'] if re.search(v.regex(), c) is not None]
amps_list += [p for p in processlist if re.search(v.regex(), p['name']) is not None]
except (TypeError, KeyError):
continue
logger.info(amps_list)
if len(amps_list) > 0:
# At least one process is matching the regex
logger.debug("AMPS: {} process detected (PID={})".format(k, amps_list[0]['pid']))
......
......@@ -95,6 +95,7 @@ class Plugin(GlancesPlugin):
'ior': '{:>4} ',
'iow': '{:<4} ',
'command': '{}',
'name': '[{}]'
}
def __init__(self, args=None):
......@@ -332,7 +333,7 @@ class Plugin(GlancesPlugin):
msg = ' ' + self.layout_stat['command'].format(arguments)
ret.append(self.curse_add_line(msg, splittable=True))
else:
msg = self.layout_stat['command'].format(p['name'])
msg = self.layout_stat['name'].format(p['name'])
ret.append(self.curse_add_line(msg, splittable=True))
except UnicodeEncodeError:
ret.append(self.curse_add_line('', splittable=True))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册