[PATCH] kvm_stat: use total count as a secondary sort key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 kvm/kvm_stat |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kvm/kvm_stat b/kvm/kvm_stat
index e32df14..4a16277 100755
--- a/kvm/kvm_stat
+++ b/kvm/kvm_stat
@@ -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
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux