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

[xen staging-4.18] tools/xentop: fix sorting bug for some columns



commit 184d723e7a5d1c021d297e14d19fe5344eac7a56
Author:     Cyril Rébert (zithro) <slack@xxxxxxxxx>
AuthorDate: Tue Feb 27 13:53:42 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Feb 27 13:53:42 2024 +0100

    tools/xentop: fix sorting bug for some columns
    
    Sort doesn't work on columns VBD_OO, VBD_RD, VBD_WR and VBD_RSECT.
    Fix by adjusting variables names in compare functions.
    Bug fix only. No functional change.
    
    Fixes: 91c3e3dc91d6 ("tools/xentop: Display '-' when stats are not 
available.")
    Signed-off-by: Cyril Rébert (zithro) <slack@xxxxxxxxx>
    Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    master commit: 29f17d837421f13c0e0010802de1b2d51d2ded4a
    master date: 2024-02-05 17:58:23 +0000
---
 tools/xentop/xentop.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/xentop/xentop.c b/tools/xentop/xentop.c
index 950e8935c4..545bd5e96d 100644
--- a/tools/xentop/xentop.c
+++ b/tools/xentop/xentop.c
@@ -684,7 +684,7 @@ static int compare_vbd_oo(xenstat_domain *domain1, 
xenstat_domain *domain2)
        unsigned long long dom1_vbd_oo = 0, dom2_vbd_oo = 0;
 
        tot_vbd_reqs(domain1, FIELD_VBD_OO, &dom1_vbd_oo);
-       tot_vbd_reqs(domain1, FIELD_VBD_OO, &dom2_vbd_oo);
+       tot_vbd_reqs(domain2, FIELD_VBD_OO, &dom2_vbd_oo);
 
        return -compare(dom1_vbd_oo, dom2_vbd_oo);
 }
@@ -711,9 +711,9 @@ static int compare_vbd_rd(xenstat_domain *domain1, 
xenstat_domain *domain2)
        unsigned long long dom1_vbd_rd = 0, dom2_vbd_rd = 0;
 
        tot_vbd_reqs(domain1, FIELD_VBD_RD, &dom1_vbd_rd);
-       tot_vbd_reqs(domain1, FIELD_VBD_RD, &dom2_vbd_rd);
+       tot_vbd_reqs(domain2, FIELD_VBD_RD, &dom2_vbd_rd);
 
-       return -compare(dom1_vbd_rd, dom1_vbd_rd);
+       return -compare(dom1_vbd_rd, dom2_vbd_rd);
 }
 
 /* Prints number of total VBD READ requests statistic */
@@ -738,7 +738,7 @@ static int compare_vbd_wr(xenstat_domain *domain1, 
xenstat_domain *domain2)
        unsigned long long dom1_vbd_wr = 0, dom2_vbd_wr = 0;
 
        tot_vbd_reqs(domain1, FIELD_VBD_WR, &dom1_vbd_wr);
-       tot_vbd_reqs(domain1, FIELD_VBD_WR, &dom2_vbd_wr);
+       tot_vbd_reqs(domain2, FIELD_VBD_WR, &dom2_vbd_wr);
 
        return -compare(dom1_vbd_wr, dom2_vbd_wr);
 }
@@ -765,7 +765,7 @@ static int compare_vbd_rsect(xenstat_domain *domain1, 
xenstat_domain *domain2)
        unsigned long long dom1_vbd_rsect = 0, dom2_vbd_rsect = 0;
 
        tot_vbd_reqs(domain1, FIELD_VBD_RSECT, &dom1_vbd_rsect);
-       tot_vbd_reqs(domain1, FIELD_VBD_RSECT, &dom2_vbd_rsect);
+       tot_vbd_reqs(domain2, FIELD_VBD_RSECT, &dom2_vbd_rsect);
 
        return -compare(dom1_vbd_rsect, dom2_vbd_rsect);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.