Skip to content

Commit

Permalink
statement: Apply augmented assignment statements
Browse files Browse the repository at this point in the history
Signed-off-by: Peace Lee <iipeace5@gmail.com>
  • Loading branch information
iipeace committed Oct 2, 2021
1 parent 025e71c commit 86a6653
Showing 1 changed file with 38 additions and 40 deletions.
78 changes: 38 additions & 40 deletions guider/guider.py
Original file line number Diff line number Diff line change
Expand Up @@ -3909,7 +3909,7 @@ def cleanItem(targetList, union=True):
if targetType is str:
targetStr = ''
for val in targetList:
if val: targetStr = '%s%s' % (targetStr, val)
if val: targetStr += val
return targetStr
elif targetType is list:
# remove redundant values #
Expand Down Expand Up @@ -13437,7 +13437,7 @@ def makeKernelSymList(self, subStack, indentLen):
symbolStack = '%s\n%s' % (symbolStack, ' ' * indentLen)
appliedIndentLen = long(0)

symbolStack = '%s%s' % (symbolStack, symbolSet)
symbolStack += symbolSet
except SystemExit:
sys.exit(0)
except:
Expand Down Expand Up @@ -13470,7 +13470,7 @@ def makeUserSymList(self, subStack, indentLen):
'%s\n%s' % (symbolStack, ' ' * indentLen)
appliedIndentLen = long(0)

symbolStack = '%s%s' % (symbolStack, symbolSet)
symbolStack += symbolSet
elif self.sort == 'pos':
for pos in subStack:
if not pos:
Expand Down Expand Up @@ -13625,7 +13625,7 @@ def printSyscallUsage(self):
binary = self.posData[subcall]['binary']
nextCall = ' <- %s[%s]' % (symbol, binary)
if SysMgr.lineLength > nowLen + len(nextCall):
userCall = '%s%s' % (userCall, nextCall)
userCall += nextCall
nowLen += len(nextCall)
else:
userCall = '%s\n%s %s' % \
Expand Down Expand Up @@ -13841,7 +13841,7 @@ def printCustomUsage(self):
binary = self.posData[subcall]['binary']
nextCall = ' <- %s[%s]' % (symbol, binary)
if SysMgr.lineLength > nowLen + len(nextCall):
userCall = '%s%s' % (userCall, nextCall)
userCall += nextCall
nowLen += len(nextCall)
else:
userCall = '%s\n%s %s' % \
Expand All @@ -13867,7 +13867,7 @@ def printCustomUsage(self):
nextCall = \
' <- %s' % (self.posData[subcall]['symbol'])
if SysMgr.lineLength > nowLen + len(nextCall):
kernelCall = '%s%s' % (kernelCall, nextCall)
kernelCall += nextCall
nowLen += len(nextCall)
else:
kernelCall = \
Expand Down Expand Up @@ -14813,7 +14813,7 @@ def printHeapUsage(self):
nextCall = ' <- %s[%s]' % \
(subcall, self.userSymData[subcall]['origBin'])
if SysMgr.lineLength > nowLen + len(nextCall):
userCall = '%s%s' % (userCall, nextCall)
userCall += nextCall
nowLen += len(nextCall)
else:
userCall = '%s\n%s %s' % \
Expand Down Expand Up @@ -14848,7 +14848,7 @@ def printHeapUsage(self):
try:
nextCall = ' <- %s' % (subcall)
if SysMgr.lineLength > nowLen + len(nextCall):
kernelCall = '%s%s' % (kernelCall, nextCall)
kernelCall += nextCall
nowLen += len(nextCall)
else:
kernelCall = '%s\n%s %s' % \
Expand Down Expand Up @@ -15077,7 +15077,7 @@ def printLockUsage(self):
binary = self.posData[subcall]['binary']
nextCall = ' <- %s[%s]' % (symbol, binary)
if SysMgr.lineLength > nowLen + len(nextCall):
userCall = '%s%s' % (userCall, nextCall)
userCall += nextCall
nowLen += len(nextCall)
else:
userCall = '%s\n%s %s' % \
Expand Down Expand Up @@ -29072,7 +29072,7 @@ def _getStats(addrList):
stat = ''

# append status #
item = '%s%s' % (item, stat)
item += stat

# cache string #
SysMgr.tcpListCache[tcp[inodeIdx]] = item
Expand Down Expand Up @@ -35634,7 +35634,7 @@ def getOutput(fd, retLine=False, progress=False):
elif line == '':
return output

output = '%s%s' % (output, line)
output += line



Expand Down Expand Up @@ -58418,7 +58418,7 @@ def getBacktraceStr(self, bt, indent=None, maximum=0, force=False):
pos += len(newStr)

# add a symbol to backtrace #
btStr = '%s%s' % (btStr, newStr)
btStr += newStr

if btStr == '':
self.btStr = '??'
Expand Down Expand Up @@ -60105,7 +60105,7 @@ def handlePyTrap(self, sym, fname, addr):
if not self.entryTime[sym]:
self.entryTime.pop(sym, None)

sym = '%s%s' % (sym, Debugger.RETSTR)
sym += Debugger.RETSTR

# build JSON output #
if SysMgr.jsonEnable:
Expand Down Expand Up @@ -60585,7 +60585,7 @@ def handleSyscallOutput(self, args, defer=False):
# handle call string for enter #
if filtered:
if defer:
self.bufferedStr = '%s%s' % (self.bufferedStr, callString)
self.bufferedStr += callString
else:
self.bufferedStr = callString

Expand Down Expand Up @@ -60879,8 +60879,7 @@ def handleSyscall(self):
# print call string #
if SysMgr.outPath:
if self.callPrint:
self.callPrint[-1] = '%s%s' % \
(self.callPrint[-1], callString)
self.callPrint[-1] += callString
else:
self.callPrint.append(callString)

Expand Down Expand Up @@ -77026,7 +77025,7 @@ def printFsInfo(self):
"{0:^25} {1:>7} {2:>8} {3:>12} {4:>12} "
"{5:>12} {6:<75}\n").format(
'', '', did, '', convSize(totalSize), fs, dev)))
devStr = '%s%s' % (devStr, inodeStr)
devStr += inodeStr

SysMgr.printPipe(
"{0:^25} {1:>7} {2:>8} {3:>12} {4:>12} ".format(
Expand Down Expand Up @@ -77098,7 +77097,7 @@ def printFsInfo(self):
"{0:>25} {1:>7} {2:>8} {3:>12} {4:>12} "
"{5:>12} {6:<75}\n").format(
'', '', did, '', convSize(totalSize), fs, dev)))
devStr = '%s%s' % (devStr, inodeStr)
devStr += inodeStr

# update previous thread info #
if previnfo == tinfo:
Expand Down Expand Up @@ -79117,7 +79116,7 @@ def printCpuInterval():
else:
usage = long(0)

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += margin + 2

SysMgr.printPipe(("{0:1} {1:1}\n").format(procInfo, timeLine))
Expand Down Expand Up @@ -79168,7 +79167,7 @@ def printCpuInterval():
# append lifecycle flag to usage #
usage = '%s%s' % (lflag, usage)

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += margin + 2

# skip process used no CPU #
Expand Down Expand Up @@ -79242,7 +79241,7 @@ def printDlyInterval():
else:
usage = long(0)

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += margin + 2

# skip no delayed procdss #
Expand Down Expand Up @@ -79311,7 +79310,7 @@ def printGpuInterval():
except:
usage = long(0)

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += 7

SysMgr.printPipe(("{0:1} {1:1}\n").format(gpuInfo, timeLine))
Expand Down Expand Up @@ -79375,7 +79374,7 @@ def printRssInterval():
else:
usage = long(0)

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += 7

SysMgr.printPipe(("{0:1} {1:1}\n").format(procInfo, timeLine))
Expand Down Expand Up @@ -79441,7 +79440,7 @@ def printRssInterval():
if maxRss == 0 or maxRss < usage:
maxRss = usage

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += 7

# mark change #
Expand Down Expand Up @@ -79504,7 +79503,7 @@ def printVssInterval():
else:
usage = long(0)

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += 7

SysMgr.printPipe(("{0:1} {1:1}\n").format(procInfo, timeLine))
Expand Down Expand Up @@ -79570,7 +79569,7 @@ def printVssInterval():
if maxVss == 0 or maxVss < usage:
maxVss = usage

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += 7

# mark change #
Expand Down Expand Up @@ -79654,7 +79653,7 @@ def printBlkInterval():
else:
usage = long(0)

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += 7

SysMgr.printPipe(("{0:1} {1:1}\n").format(procInfo, timeLine))
Expand Down Expand Up @@ -79730,7 +79729,7 @@ def printStorageInterval():
except:
usage = '0/0/0/0'

timeLine = '%s%s' % (timeLine, '{0:>21} '.format(usage))
timeLine += '{0:>21} '.format(usage)
lineLen += margin

SysMgr.printPipe(
Expand Down Expand Up @@ -79793,7 +79792,7 @@ def printNetworkInterval():
except:
usage = '0/0'

timeLine = '%s%s' % (timeLine, '{0:>21} '.format(usage))
timeLine += '{0:>21} '.format(usage)
lineLen += margin

SysMgr.printPipe(
Expand All @@ -79818,8 +79817,7 @@ def printTimelineInterval(margin, length, title, more=0):
timeLine += ('\n' + (' ' * (length - 1)) + '| ')
lineLen = length

timeLine = '%s%s' % \
(timeLine, '{0:>{margin}} '.format(i, margin=margin+more))
timeLine += '{0:>{margin}} '.format(i, margin=margin+more)
lineLen += margin + spaces

SysMgr.printPipe(("{0:1} {1:1}\n").format(title, timeLine))
Expand Down Expand Up @@ -79880,7 +79878,7 @@ def printCgCpuInterval():
except:
usage = 0

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += margin + 2

SysMgr.printPipe(
Expand Down Expand Up @@ -79936,7 +79934,7 @@ def printCgMemInterval():
except:
usage = 0

timeLine = '%s%s' % (timeLine, '{0:>6} '.format(usage))
timeLine += '{0:>6} '.format(usage)
lineLen += margin + 2

SysMgr.printPipe(
Expand Down Expand Up @@ -88117,7 +88115,7 @@ def printZoneUsage(self, nrIndent):
(zoneData, ' ' * 7, ' ' * nrIndent)
lenZone = nrIndent

zoneData = '%s%s' % (zoneData, zoneStat)
zoneData += zoneStat
lenZone += lenZoneStat

stat = UtilMgr.convSize2Unit(val << 12)
Expand All @@ -88134,7 +88132,7 @@ def printZoneUsage(self, nrIndent):
(zoneData, ' ' * 7, ' ' * nrIndent)
lenZone = nrIndent

zoneData = '%s%s' % (zoneData, zoneStat)
zoneData += zoneStat
lenZone += lenZoneStat

SysMgr.addPrint("{0:<1}]\n".format(zoneData[:-2]))
Expand Down Expand Up @@ -88176,7 +88174,7 @@ def printIrqUsage(self, nrIndent):
irqData = '%s\n%s %s' % (irqData, ' ' * 7, ' ' * nrIndent)
lenIrq = nrIndent

irqData = '%s%s' % (irqData, newIrq)
irqData += newIrq
lenIrq += lenNewIrq

if nrIrq > 0:
Expand Down Expand Up @@ -89108,7 +89106,7 @@ def _printStackSamples(idx):
except:
pass

fullstack = '%s%s' % (fullstack, line)
fullstack += line
fullstack = fullstack.rstrip(' <- ')

ret = SysMgr.addPrint(
Expand Down Expand Up @@ -89745,7 +89743,7 @@ def _printDelay(self, value):

pstr = '%s' % pstr[slimit:]

tstr = '%s%s' % (tstr, pstr)
tstr += pstr

# count newlines #
newline = tstr.count('\n')+1
Expand Down Expand Up @@ -90840,9 +90838,9 @@ def setThresholdEvent(
addinfo = ''
for pid, data in comval['task'].items():
addinfo += '_%s_%s' % (data['comm'], pid)
ename = '%s%s' % (ename, addinfo)
ename += addinfo
elif 'dev' in comval:
ename = '%s%s' % (ename, comval['dev'])
ename += comval['dev']

if item in comval:
ename = '%s_%s' % (ename, comval[item])
Expand Down

0 comments on commit 86a6653

Please sign in to comment.