Skip to content

Commit

Permalink
Sort interripts by number in top profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
iipeace authored May 8, 2018
1 parent 67f705c commit f927742
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions guider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__module__ = "guider"
__credits__ = "Peace Lee"
__license__ = "GPLv2"
__version__ = "3.9.0"
__version__ = "3.9.1"
__maintainer__ = "Peace Lee"
__email__ = "[email protected]"
__repository__ = "https://github.com/iipeace/guider"
Expand Down Expand Up @@ -6352,7 +6352,7 @@ class SystemManager(object):
termGetId = None
termSetId = None
ttyRows = 43
ttyRowsMargin = 2
ttyRowsMargin = 3
ttyCols = 156
magicString = '@@@@@'
procPath = '/proc'
Expand Down Expand Up @@ -24041,7 +24041,9 @@ def printSystemStat(self):
nrIrq = 0
irqData = '%s [IRQ > ' % (' ' * nrIndent)
lenIrq = len(irqData)
for irq, cnt in sorted(self.irqData.items()):
for irq, cnt in sorted(self.irqData.items(), key=lambda e:0 \
if not e[0] in self.prevIrqData \
else e[1] - self.prevIrqData[e[0]], reverse=True):
try:
irqDiff = cnt - self.prevIrqData[irq]
if irqDiff <= 0:
Expand All @@ -24052,7 +24054,7 @@ def printSystemStat(self):
lenNewIrq = len(newIrq)

if lenIrq + lenNewIrq >= len(oneLine):
irqData = '%s\n %s' % (irqData, ' ' * nrIndent)
irqData = '%s\n%s %s' % (irqData, ' ' * 7, ' ' * nrIndent)
lenIrq = nrIndent

irqData = '%s%s' % (irqData, newIrq)
Expand Down

0 comments on commit f927742

Please sign in to comment.