diff --git a/guider/guider.conf b/guider/guider.conf index 391b2b72..e4d98475 100644 --- a/guider/guider.conf +++ b/guider/guider.conf @@ -27,7 +27,7 @@ - psi: cpu, memory, io - cgroup: cpu, throttle, memory, read, write, cpuDelay, memDelay, ioDelay - battery: per, left, plugged - - time: uptime, runtimeBt, runtimeLt + - time: uptime, runtime - SCOPE - SYSTEM: system resources @@ -233,8 +233,7 @@ < time > - uptime: system uptime - - runtimeBt: task runtime (Bigger) - - runtimeLt: task runtime (Lesser) + - runtime: task runtime - VARIABLE - EVTNAME: event name @@ -322,6 +321,7 @@ "apply": "true", "total": 95, "interval": 5, + "comp": "big", "after": "60s", "taskmon": "true", "oneshot": "true", @@ -350,6 +350,7 @@ "apply": "false", "total": 90, "interval": 3, + "comp": "big", "perm": "root", "signal": "3:SIGINT", "command": ["simpleperf record -g -o /data/perf.dat"], @@ -362,6 +363,7 @@ "total": 90, "kernel": 80, "interval": 2, + "comp": "big", "multicond": "true", "condgroup": "CPU-KERNEL-HOT", "lcommand": ["SAVE"], @@ -373,6 +375,7 @@ "apply": "false", "temp": 90, "interval": 2, + "comp": "big", "multicond": "true", "condgroup": "CPU-KERNEL-HOT", "message": "CPU is hot" @@ -385,6 +388,7 @@ "apply": "false", "total": 95, "interval": 3, + "comp": "big", "oneshot": "true", "refresh": 30, "lock": "true", @@ -397,10 +401,11 @@ { "apply": "false", "pri": "R90", + "comp": "less", "oneshot": "true", "refresh": 30, "exceptOR": ["b.out"], - "command": ["CMD_TTOP_PROC"], + "command": ["SAVEPRIO"], "explain": "monitor CPU priority for all processes except for b.out" } ], @@ -410,6 +415,7 @@ "apply": "false", "total": 98, "interval": 3, + "comp": "big", "perm": "root", "lock": "true", "oneshot": "true", @@ -426,6 +432,7 @@ "apply": "false", "total": 90, "interval": 3, + "comp": "big", "taskmon": "true", "command": ["SAVE"], "message": "system CORE usage is high", @@ -436,6 +443,7 @@ "apply": "false", "total": 90, "interval": 3, + "comp": "big", "taskmon": "true", "command": ["SAVECPU"], "message": "system CORE usage is high", @@ -450,6 +458,7 @@ "apply": "false", "total": 95, "interval": 10, + "comp": "big", "taskmon": "true", "command": ["SAVE:5s"], "message": "system GPU usage is high", @@ -464,6 +473,7 @@ { "apply": "true", "available": 100, + "comp": "less", "dumpfile": ["/proc/cmdline"], "goneshot": "true", "command": ["SAVEMEM"], @@ -477,6 +487,7 @@ #"oomKill": 1, #"pgRclmBg": 102400, #"pgRclmFg": 1024, + "comp": "less", "oneshot": "true", "refresh": 10, "command": ["SAVERAW"], @@ -488,6 +499,7 @@ "*": { "apply": "false", "rss": 800, + "comp": "big", "perm": "root", "oneshot": "true", "lock": "true", @@ -499,6 +511,7 @@ "a.out*": { "apply": "false", "rss": 10, + "comp": "big", "interval": 3, "perm": "root", "oneshot": "true", @@ -514,6 +527,7 @@ "SYSTEM": { "apply": "false", "total": 2048, + "comp": "big", "oneshot": "true", "command": ["CMD_MTOP"], "message": "GPU memory usage is high", @@ -523,6 +537,7 @@ "*": { "apply": "false", "size": 310, + "comp": "big", "perm": "root", "oneshot": "true", "exceptOR": ["b.out"], @@ -534,6 +549,7 @@ "weston": { "apply": "false", "size": 500, + "comp": "big", "perm": "root", "oneshot": "true", "command": ["SAVE:3s"], @@ -548,6 +564,7 @@ "SYSTEM": { "apply": "false", "usagePer": 95, + "comp": "big", "interval": 5, "perm": "root", "command": ["CMD_MTOP"], @@ -558,6 +575,7 @@ "*": { "apply": "false", "swap": 100, + "comp": "big", "exceptOR": ["b.out"], "command": ["CMD_MTOP"], "explain": "monitor swapped out memory for all processes" @@ -571,6 +589,7 @@ "apply": "false", "ioWait": 10, "interval": 5, + "comp": "big", "perm": "root", "command": ["SAVEBLOCK", "CMD_DISKTOP"], "message": "system I/O is heavy", @@ -581,8 +600,9 @@ "apply": "false", "read": "500M", "write": "100M", - "perm": "root", "interval": 2, + "comp": "big", + "perm": "root", "exceptOR": ["b.out"], "command": ["CMD_DISKTOP_TOTAL"], "explain": "monitor block I/O usage for all processes" @@ -593,6 +613,7 @@ "read": "500M", "write": "100M", "interval": 2, + "comp": "big", "perm": "root", "command": ["CMD_DISKTOP_TOTAL"], "explain": "monitor block I/O usage for specific processes having name starts with a.out" @@ -605,8 +626,8 @@ "SYSTEM": { "apply": "false", "usagePer": 95, - "comp": "big", "interval": 3, + "comp": "big", "oneshot": "true", "perm": "root", "command": ["CMD_DISKTOP"], @@ -619,6 +640,7 @@ "usagePer": 99, "free": 100, "interval": 5, + "comp": "big", "exceptOR": ["/dev/loop*"], "perm": "root", "oneshot": "true", @@ -631,6 +653,7 @@ "usagePer": 99, "free": 100, "interval": 3, + "comp": "big", "perm": "root", "oneshot": "true", "command": ["CMD_DISKTOP"], @@ -646,6 +669,7 @@ "inbound": "1G", "outbound": "500M", "interval": 3, + "comp": "big", "perm": "root", "command": ["CMD_NETTOP"], "message": "system network usage is high", @@ -657,6 +681,7 @@ "recv": "1G", "trans": "500M", "interval": 3, + "comp": "big", "exceptOR": ["lo"], "perm": "root", "command": ["CMD_NETTOP"], @@ -667,8 +692,9 @@ "apply": "false", "recv": "1G", "trans": "1G", - "perm": "root", "interval": 3, + "comp": "big", + "perm": "root", "command": ["CMD_NETTOP"], "explain": "monitor network usage for the specific device" } @@ -680,6 +706,7 @@ "SYSTEM": { "apply": "false", "load1m": 8, + "comp": "big", "command": ["SAVE"], "message": "system loadavg value is high", "explain": "monitor system load" @@ -692,6 +719,7 @@ "SYSTEM": { "apply": "false", "curFd": 90000, + "comp": "big", "perm": "root", "oneshot": "true", "command": ["CMD_FTOP"], @@ -701,6 +729,7 @@ "*": { "apply": "false", "fdSize": 10000, + "comp": "big", "perm": "root", "oneshot": "true", "refresh": 100, @@ -712,6 +741,7 @@ "a.out": { "apply": "false", "fdSize": 10000, + "comp": "big", "perm": "root", "oneshot": "true", "command": ["CMD_FTOP_PROC"], @@ -724,13 +754,14 @@ "SYSTEM": { "apply": "false", - "interval": 5, "nrUDPSock": 10000, "nrUDPRxQ": "200m", "nrTCPSock": 10000, "nrTCPConn": 10000, "nrTCPTxQ": "200m", "nrUDSSock": 10000, + "interval": 5, + "comp": "big", "perm": "root", "oneshot": "true", "command": ["CMD_FTOP"], @@ -803,6 +834,7 @@ { "apply": "false", "nrCtx": 50000, + "comp": "big", "command": ["CMD_TTOP_CTX"], "explain": "monitor context switching of all tasks" }, @@ -811,6 +843,7 @@ "apply": "false", "new": 1, "die": 1, + "comp": "big", "command": ["SAVE"], "explain": "monitor lifecycle of all tasks" }, @@ -819,6 +852,7 @@ "apply": "false", "abnormal": 1, "interval": 5, + "comp": "big", "command": ["SAVE"], "explain": "monitor abnormal status of all tasks" } @@ -829,6 +863,7 @@ "exceptOR": ["b.out", "kworker*"], "nrCtx": 5000, "interval": 3, + "comp": "big", "command": ["SAVE:3s"], "explain": "monitor context switching of all tasks except for specific tasks" }, @@ -839,6 +874,7 @@ "new": 1, "die": 1, "interval": 3, + "comp": "big", "command": ["SAVE"], "explain": "monitor lifecycle of specific tasks having name starts with yes" }, @@ -848,6 +884,7 @@ "abnormal": 1, "abnormalCond": "Dt", "interval": 3, + "comp": "big", "command": ["SAVE"], "explain": "monitor abnormal status Dt of specific tasks having name starts with yes" }, @@ -1042,6 +1079,7 @@ "some-diff": 30, "type": "min", "interval": 5, + "comp": "big", "oneshot": "true", "refresh": 100, "command": ["SAVE:3s"], @@ -1058,6 +1096,7 @@ "some-diff": 30, "type": "min", "interval": 5, + "comp": "big", "oneshot": "true", "refresh": 100, "command": ["SAVE:3s"], @@ -1074,6 +1113,7 @@ "some-diff": 30, "type": "min", "interval": 5, + "comp": "big", "oneshot": "true", "refresh": 100, "command": ["SAVE:3s"], @@ -1088,32 +1128,35 @@ "/": [ { "apply": "false", - "interval": 3, "taskmon": "true", "cpu": 400, "throttle": 100, + "interval": 3, + "comp": "big", "command": ["SAVE"], "explain": "monitor cgroup CPU usage" }, { "apply": "false", - "interval": 3, "taskmon": "true", "memory": 300, "read": 600, "write": 500, + "interval": 3, + "comp": "big", "command": ["SAVE"], "explain": "monitor cgroup memory usage" }, { "apply": "false", - "interval": 2, "taskmon": "true", "cpuDelay": 90, "memDelay": 90, "ioDelay": 90, + "interval": 2, + "comp": "big", "command": ["SAVE"], "explain": "monitor cgroup delay" } @@ -1123,16 +1166,27 @@ "battery": { - "SYSTEM": { - "apply": "false", - "per": 20, - "plugged": "false", - "left": "30m", - "perm": "root", - "oneshot": "true", - "command": ["SAVE"], - "explain": "monitor specific files of the system" - } + "SYSTEM": [ + { + "apply": "false", + "per": 20, + "left": "30m", + "comp": "less", + "perm": "root", + "oneshot": "true", + "command": ["SAVE"], + "explain": "monitor specific files of the system" + }, + + { + "apply": "false", + "plugged": "false", + "perm": "root", + "oneshot": "true", + "command": ["SAVE"], + "explain": "monitor specific files of the system" + } + ] }, @@ -1149,7 +1203,8 @@ "yes*": { "apply": "false", - "runtimeBt": "10s", + "runtime": "5s", + "comp": "big", "oneshot": "true", "command": ["SAVE"], "explain": "monitor runtime of the specific task" diff --git a/guider/guider.py b/guider/guider.py index d19360ab..1f9c2882 100755 --- a/guider/guider.py +++ b/guider/guider.py @@ -7,7 +7,7 @@ __credits__ = "Peace Lee" __license__ = "GPLv2" __version__ = "3.9.8" -__revision__ = "241024" +__revision__ = "241025" __maintainer__ = "Peace Lee" __email__ = "iipeace5@gmail.com" __repository__ = "https://github.com/iipeace/guider" @@ -35160,8 +35160,7 @@ def _checkPerm(item): sysattr = confData["time"].get("SYSTEM") if sysattr: _convAttr(sysattr, "uptime", UtilMgr.convUnit2Time) - _convAttr(confData["time"], "runtimeBt", UtilMgr.convUnit2Time) - _convAttr(confData["time"], "runtimeLt", UtilMgr.convUnit2Time) + _convAttr(confData["time"], "runtime", UtilMgr.convUnit2Time) # check block # try: @@ -51963,12 +51962,8 @@ def doPrint(newline=True, clear=False, flush=True, addLine=False): if not SysMgr.bufferString and not SysMgr.bufferList: return - isList = not "STRPRINTBUF" in SysMgr.environList - - if isList: - output = SysMgr.getPrintList(retStr=True, char="") - else: - output = SysMgr.bufferString + # get pring buffer string # + output = SysMgr.getPrintBuf() if addLine: output += "\n" @@ -51999,13 +51994,13 @@ def addPrint(string, newline=1, force=False): if not SysMgr.printEnable: return - # check buffer type # - isList = not "STRPRINTBUF" in SysMgr.environList - # check skip condition # if not force and SysMgr.checkCutCond(newline): return False + # check buffer type # + isList = not "STRPRINTBUF" in SysMgr.environList + # add to list buffer # if isList: SysMgr.bufferList.append(string) @@ -52032,27 +52027,41 @@ def addPrint(string, newline=1, force=False): return True @staticmethod - def getPrintList(retStr=False, sort=False, char="\n"): - if sort: - SysMgr.bufferList.sort() + def hasPrintBuf(): + return SysMgr.bufferString or SysMgr.bufferList - if retStr: - return char.join(SysMgr.bufferList) + @staticmethod + def getPrintBuf(retStr=True, sort=False, char=""): + isList = not "STRPRINTBUF" in SysMgr.environList + if isList: + if sort: + SysMgr.bufferList.sort() + + if retStr: + return char.join(SysMgr.bufferList) + else: + return SysMgr.bufferList else: - return SysMgr.bufferList + return SysMgr.bufferString @staticmethod def delPrint(newline=1): try: - target = SysMgr.bufferString - start = target.rfind("\n") - pos = newline + # check buffer type # + isList = not "STRPRINTBUF" in SysMgr.environList + if isList: + SysMgr.bufferList.pop(-(abs(newline))) + else: + target = SysMgr.bufferString + start = target.rfind("\n") + pos = newline + + while start >= 0 and pos > 1: + start = target.rfind("\n", start - 1) + pos -= 1 - while start >= 0 and pos > 1: - start = target.rfind("\n", start - 1) - pos -= 1 + SysMgr.bufferString = target[: start + 1] - SysMgr.bufferString = target[: start + 1] SysMgr.bufferRows -= newline except: pass @@ -53499,10 +53508,14 @@ def printTopStats(): SysMgr.doPrint(addLine=True) # buffered mode # else: - SysMgr.addProcBuffer(SysMgr.bufferString + "\n") + # get pring buffer string # + bufStr = SysMgr.getPrintBuf() + + # add string to print buffer # + SysMgr.addProcBuffer(bufStr + "\n") # send output to nodes registered # - SysMgr.sendOutput2Nodes(SysMgr.bufferString) + SysMgr.sendOutput2Nodes(bufStr) # flush buffer # SysMgr.clearPrint() @@ -90167,7 +90180,8 @@ def _popFields(struct, items): # handle buffered logs # if buffered: - output = SysMgr.getPrintList(retStr=True, sort=True) + # get print buffer string # + output = SysMgr.getPrintBuf(sort=True, char="\n") SysMgr.clearPrint() SysMgr.printPipe(output, flush=True) @@ -92121,21 +92135,20 @@ def executeCmd( self, cmdList, sym=None, fname=None, args=[], force=False, isExit=True ): def _flushPrint(newline=True): + output = SysMgr.getPrintBuf() if SysMgr.outPath: if SysMgr.showAll: - self.callPrint.append(SysMgr.bufferString[1:]) + self.callPrint.append(output[1:]) # print to stdout # if SysMgr.streamEnable: - sys.stdout.write(SysMgr.bufferString) + sys.stdout.write(output) else: if self.bufferedStr: - SysMgr.bufferString += self.bufferedStr + output += self.bufferedStr self.bufferedStr = "" - SysMgr.printPipe( - SysMgr.bufferString, flush=True, newline=newline - ) + SysMgr.printPipe(output, flush=True, newline=newline) SysMgr.clearPrint() @@ -93978,6 +93991,9 @@ def removeAllBp(self, tgid=None, verb=True, target=[]): UtilMgr.deleteProgress() def removeBp(self, addr, lock=False): + if not addr: + return + try: savedData = self.bpList[addr]["data"] except: @@ -99718,7 +99734,7 @@ def printContext( SysMgr.addPrint("%s\n" % oneLine, force=True) if SysMgr.outPath: - self.callPrint.append(SysMgr.bufferString) + self.callPrint.append(SysMgr.getPrintBuf()) else: SysMgr.doPrint(newline=False, clear=True) @@ -104220,7 +104236,7 @@ def _getOneItem(): self.addrCacheList[symbol] = ret return ret - return [] + return 0 def _saveFileCache(symbol, mfile): if not symbol in ElfAnalyzer.symFileList: @@ -104359,11 +104375,11 @@ def _saveFileCache(symbol, mfile): "failed to find %s symbol for %s(%s)" % (symbol, self.comm, self.pid) ) - return addrList + return 0 if one else addrList elif len(addrList) > 1: self.printSymbolList(addrList) - return addrList + return 0 if one else addrList def lock(self, pos=-1): # pylint: disable=undefined-variable @@ -132940,7 +132956,7 @@ def _applyTickLabel(items, ax, maxVal): + "\n" ) - if SysMgr.bufferString: + if SysMgr.hasPrintBuf(): SysMgr.printPipe("%s# %s\n" % ("", "Delay(%)")) SysMgr.doPrint() SysMgr.printPipe(oneLine) @@ -133019,7 +133035,7 @@ def _applyTickLabel(items, ax, maxVal): + "\n" ) - if SysMgr.bufferString: + if SysMgr.hasPrintBuf(): SysMgr.printPipe("%s# %s\n" % ("", "MEM(MB)")) SysMgr.doPrint() SysMgr.printPipe(oneLine) @@ -133102,7 +133118,7 @@ def _applyTickLabel(items, ax, maxVal): + "\n" ) - if SysMgr.bufferString: + if SysMgr.hasPrintBuf(): SysMgr.printPipe("%s# %s\n" % ("", "BLK_RD(MB)")) SysMgr.doPrint() SysMgr.printPipe(oneLine) @@ -133189,7 +133205,7 @@ def _applyTickLabel(items, ax, maxVal): + "\n" ) - if SysMgr.bufferString: + if SysMgr.hasPrintBuf(): SysMgr.printPipe("%s# %s\n" % ("", "BLK_WR(MB)")) SysMgr.doPrint() SysMgr.printPipe(oneLine) @@ -139076,7 +139092,7 @@ def _printEventWarning(func): elif func == "mm_page_alloc": m = re.match( ( - r"^\s*page=\s*(?P\S+)\s+pfn=(?P[0-9]+)\s+" + r"^\s*page=\s*(?P\S+)\s+pfn=(?P\S+)\s+" r"order=(?P[0-9]+)\s+" r"migratetype=(?P[0-9]+)\s+gfp_flags=(?P\S+)" ), @@ -139096,7 +139112,7 @@ def _printEventWarning(func): else: page = d["page"] - pfn = long(d["pfn"]) + pfn = UtilMgr.convStr2Num(d["pfn"]) flags = d["flags"] order = long(d["order"]) nr = pow(2, order) @@ -152877,7 +152893,7 @@ def _getIntval(item): continue intval = _getIntval(item) - self.checkThreshold("cpu", item, "CPU", "big", intval=intval) + self.checkThreshold("cpu", item, "CPU", None, intval=intval) except SystemExit: sys.exit(0) except: @@ -152984,7 +153000,7 @@ def _getIntval(item): "core", item, "CORE", - "big", + None, target=target, attr=core, intval=intval, @@ -153017,7 +153033,7 @@ def _getIntval(item): "gpu", "total", "GPU", - "big", + None, target, dev, addval=dinfo, @@ -153054,7 +153070,7 @@ def _getIntval(item): continue intval = _getIntval(item) - self.checkThreshold("mem", item, "MEM", "less", intval=intval) + self.checkThreshold("mem", item, "MEM", None, intval=intval) # check memory stats # items = ( @@ -153083,7 +153099,7 @@ def _getIntval(item): continue intval = _getIntval(convTable.get(item, item)) - self.checkThreshold("mem", item, "MEM", "big", intval=intval) + self.checkThreshold("mem", item, "MEM", None, intval=intval) except SystemExit: sys.exit(0) except: @@ -153100,7 +153116,7 @@ def _getIntval(item): if not SysMgr.forceEnable: sys.exit(-1) - self.checkThreshold("gpumem", "total", "GPUMEM", "big") + self.checkThreshold("gpumem", "total", "GPUMEM", None) except SystemExit: sys.exit(0) except: @@ -153129,7 +153145,7 @@ def _getIntval(item): continue intval = _getIntval(item) - self.checkThreshold("swap", item, "SWAP", "big", intval=intval) + self.checkThreshold("swap", item, "SWAP", None, intval=intval) except SystemExit: sys.exit(0) except: @@ -153146,7 +153162,7 @@ def _getIntval(item): continue intval = _getIntval(item) - self.checkThreshold("block", item, "IO", "big", intval=intval) + self.checkThreshold("block", item, "IO", None, intval=intval) except SystemExit: sys.exit(0) except: @@ -153158,15 +153174,7 @@ def _getIntval(item): if not "storage" in SysMgr.thrTarget: raise Exception() - items = ( - ("usagePer", "big"), - ("free", "less"), - ("favail", "less"), - ("readtime", "big"), - ("writetime", "big"), - ) - - for item, op in items: + for item in ("usagePer", "free", "favail", "readtime", "writetime",): # check effective attribute # if not item in SysMgr.thrItemList: continue @@ -153182,7 +153190,7 @@ def _getIntval(item): "storage", item, "STORAGE", - op, + None, target, intval=intval, addval=vals, @@ -153206,7 +153214,7 @@ def _getIntval(item): "storage", item, "STORAGE", - op, + None, target, dev, intval=intval, @@ -153236,7 +153244,7 @@ def _getIntval(item): target = self.reportData["net"][direct] intval = _getIntval(direct) self.checkThreshold( - "net", direct, name, "big", target, intval=intval + "net", direct, name, None, target, intval=intval ) # each devices # @@ -153267,7 +153275,7 @@ def _getIntval(item): "net", bound, "NETWORK", - "big", + None, recv if bound == "recv" else trans, dev, intval=intval, @@ -153298,7 +153306,7 @@ def _getIntval(item): "load", attr, "LOAD", - "big", + None, self.reportData["system"][attr], intval=intval, ) @@ -153354,7 +153362,7 @@ def _checkTaskStatus(stat, lev, val): "task", stat, target, - "big", + None, nrTask, attr=lev, intval=intval, @@ -153366,7 +153374,7 @@ def _checkTaskStatus(stat, lev, val): # context switch # if "nrCtx" in taskData and "nrCtx" in SysMgr.thrItemList: target = taskData["nrCtx"] - self.checkThreshold("task", "nrCtx", "CTXSWC", "big", target) + self.checkThreshold("task", "nrCtx", "CTXSWC", None, target) # lifecycle # for procStat, stat in ( @@ -153402,7 +153410,7 @@ def _checkTaskStatus(stat, lev, val): # check SYSTEM level # self.checkThreshold( - "task", stat, target, "big", nrTask, intval=intval + "task", stat, target, None, nrTask, intval=intval ) # check TASK level # @@ -153474,7 +153482,7 @@ def _checkTaskLife(t, v, commList): if not "fd" in SysMgr.thrTarget: raise Exception() - self.checkThreshold("fd", "curFd", "FD", "big") + self.checkThreshold("fd", "curFd", "FD", None) except SystemExit: sys.exit(0) except: @@ -153486,10 +153494,10 @@ def _checkTaskLife(t, v, commList): raise Exception() # check effective attribute # - if "per" in SysMgr.thrItemList: - self.checkThreshold("battery", "per", "PER", "less") - if "plugged" in SysMgr.thrItemList: - self.checkThreshold("battery", "plugged", "PLUG", None) + for x, y in (("per", "PER"), ("plugged", "PLUG"),): + if not x in SysMgr.thrItemList: + continue + self.checkThreshold("battery", x, y, None) if not "left" in SysMgr.thrItemList: raise Exception() @@ -153513,7 +153521,7 @@ def _checkTaskLife(t, v, commList): self.reportData["battery"]["left"] ) self.checkThreshold( - "battery", "left", "LEFT", "less", leftStat + "battery", "left", "LEFT", None, leftStat ) except SystemExit: sys.exit(0) @@ -153540,7 +153548,7 @@ def _checkTaskLife(t, v, commList): continue intval = _getIntval(item) - self.checkThreshold("sock", item, "SOCK", "big", intval=intval) + self.checkThreshold("sock", item, "SOCK", None, intval=intval) except SystemExit: sys.exit(0) except: @@ -153585,7 +153593,7 @@ def _checkTaskLife(t, v, commList): "psi", name, "psi", - "big", + None, target=target, attr=res, intval=intval, @@ -153621,7 +153629,7 @@ def _check(attr, name, stat): "cgroup", name, "CGROUP", - "big", + None, target=stat, attr=attr, intval=intval, @@ -154468,41 +154476,39 @@ def checkTaskThreshold(self): # cpu # if tt.get("cpu"): if "total" in SysMgr.thrItemList: - maps.append(["cpu", "total", "ttime", "cpuInt", "CPU", "big"]) + maps.append(["cpu", "total", "ttime", "cpuInt", "CPU"]) if "pri" in SysMgr.thrItemList: - maps.append(["cpu", "pri", "pri", None, "CPU", "less"]) + maps.append(["cpu", "pri", "pri", None, "CPU"]) # mem # if tt.get("mem"): if "rss" in SysMgr.thrItemList: - maps.append(["mem", "rss", "rss", "rssInt", "MEM", "big"]) + maps.append(["mem", "rss", "rss", "rssInt", "MEM"]) # gpumem # if tt.get("gpumem"): if "size" in SysMgr.thrItemList: - maps.append(["gpumem", "size", None, None, "GPUMEM", "big"]) + maps.append(["gpumem", "size", None, None, "GPUMEM"]) # fd # if tt.get("fd"): if "fd" in SysMgr.thrItemList: - maps.append(["fd", "fdSize", "fdSize", None, "FD", "big"]) + maps.append(["fd", "fdSize", "fdSize", None, "FD"]) # swap # if tt.get("swap"): if "swap" in SysMgr.thrItemList: - maps.append(["swap", "swap", "swap", "swapInt", "SWAP", "big"]) + maps.append(["swap", "swap", "swap", "swapInt", "SWAP"]) # block # if tt.get("block"): if "read" in SysMgr.thrItemList: maps.append( - ["block", "read", "read", "readInt", "BLOCK", "big"] + ["block", "read", "read", "readInt", "BLOCK"] ) if "write" in SysMgr.thrItemList: maps.append( - ["block", "write", "write", "writeInt", "BLOCK", "big"] + ["block", "write", "write", "writeInt", "BLOCK"] ) # time # if tt.get("time"): - for a, t in (("runtimeBt", "big"), ("runtimeLt", "less")): - if not a in SysMgr.thrItemList: - continue - maps.append(["time", a, "runtime", None, "RUNTIME", t]) + if "runtime" in SysMgr.thrItemList: + maps.append(["time", "runtime", "runtime", None, "RUNTIME"]) # check exit condition # if not maps: @@ -154524,7 +154530,7 @@ def checkTaskThreshold(self): for item in maps: try: - res, cattr, pattr, intname, event, comp = item + res, cattr, pattr, intname, event = item # check skip condition # if not res in td: @@ -154572,7 +154578,7 @@ def checkTaskThreshold(self): res, cattr, event, - comp, + None, value, comm, intval,