Skip to contentSkip to conversation

kvm_stat: use total count as a secondary sort key

PATCH New Avi Kivity 1 participant 1 message Sep 1, 2010 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 kvm_stat: use total count as a secondary sort key

This shows events with history in preference to events with none.

---
 kvm/kvm_stat |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kvm/kvm_stat +2 -2
index e32df14..4a16277 100755
@@ -308,9 +308,9 @@ def tui(screen, stats):
         s = stats.get()
         def sortkey(x):
             if s[x][1]:
-                return -s[x][1]
+                return (-s[x][1], -s[x][0])
             else:
-                return x
+                return (0, -s[x][0])
         for key in sorted(s.keys(), key = sortkey):
             if row >= screen.getmaxyx()[0]:
                 break
Signature · 1 line
1.7.1