Add two more VBD statistics into Xentop
PATCH 1/1 Add two more VBD statistics into Xentop
In addition to VBD read/write request#, add VBD read/write sector# also. It makes VBD throughput observation easier. As the method to get such info is OS dependent, just Linux version code is added.
Signed-off-by Yang Xiaowei <[email protected]>
Thanks,
xiaowei
tools/xenstat/libxenstat/src/xenstat.c +12 -0
@@ -653,6 +653,18 @@return vbd->wr_reqs; } +/* Get the number of READ sectors */ +unsigned long long xenstat_vbd_rd_sects (xenstat_vbd * vbd) +{ +return vbd->rd_sects; +} + +/* Get the number of WRITE sectors */ +unsigned long long xenstat_vbd_wr_sects (xenstat_vbd * vbd) +{ +return vbd->wr_sects; +} +static char *xenstat_get_domain_name (xenstat_handle *handle,unsigned int domain_id) {char path[80 ], *vmpath;
tools/xenstat/libxenstat/src/xenstat.h +2 -0
@@ -183,5 +183,7 @@unsigned long long xenstat_vbd_oo_reqs (xenstat_vbd * vbd);unsigned long long xenstat_vbd_rd_reqs (xenstat_vbd * vbd);unsigned long long xenstat_vbd_wr_reqs (xenstat_vbd * vbd); +unsigned long long xenstat_vbd_rd_sects (xenstat_vbd * vbd); +unsigned long long xenstat_vbd_wr_sects (xenstat_vbd * vbd);#endif /* XENSTAT_H */
tools/xenstat/libxenstat/src/xenstat_linux.c +12 -0
@@ -243,6 +243,18 @@continue ; } +if ((read_attributes_vbd (dp->d_name,"statistics/rd_sect" , buf,256 )<=0 ) + || ((ret =sscanf (buf,"%llu" , &vbd.rd_sects)) !=1 )) + { +continue ; + } + +if ((read_attributes_vbd (dp->d_name,"statistics/wr_sect" , buf,256 )<=0 ) + || ((ret =sscanf (buf,"%llu" , &vbd.wr_sects)) !=1 )) + { +continue ; + } +if (domain->vbds ==NULL ) { domain->num_vbds =1 ; domain->vbds =malloc (sizeof (xenstat_vbd));
tools/xenstat/libxenstat/src/xenstat_priv.h +2 -0
@@ -92,6 +92,8 @@unsigned long long oo_reqs;unsigned long long rd_reqs;unsigned long long wr_reqs; +unsigned long long rd_sects; +unsigned long long wr_sects; };extern int xenstat_collect_networks (xenstat_node * node);
tools/xenstat/xentop/xentop.c +71 -24
144 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel