# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1228319903 0
# Node ID 7338f6301067c7298eb4b3ff44992c53488b0df7
# Parent bb768351060037735c9ee4dfef996e198cb4d4bb
xentop: Fix xentop for blktap
Blktap devices information isn't shown by xentop currently.
xen-unstable c/s 17813 said "blktap devices have statistics
counters (e.g., rd_req, wr_req, oo_req) prepended by tap_".
In fact, it is as follows.
# ls -l /sys/devices/xen-backend/tap-1-769/statistics/
total 0
-r--r--r-- 1 root root 4096 Dec 3 20:37 oo_req
-r--r--r-- 1 root root 4096 Dec 3 20:37 rd_req
-r--r--r-- 1 root root 4096 Dec 3 20:37 rd_sect
-r--r--r-- 1 root root 4096 Dec 3 20:37 wr_req
-r--r--r-- 1 root root 4096 Dec 3 20:37 wr_sect
The statistics counters haven't had "tap_" because it was removed
by linux-2.6.18-xen c/s 34.
This patch reverts xen-unstable c/s 17813, then we can get the
blktap devices information by using xentop.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
tools/xenstat/libxenstat/src/xenstat_linux.c | 27 +++++++--------------------
1 files changed, 7 insertions(+), 20 deletions(-)
diff -r bb7683510600 -r 7338f6301067
tools/xenstat/libxenstat/src/xenstat_linux.c
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c Wed Dec 03 15:56:33
2008 +0000
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c Wed Dec 03 15:58:23
2008 +0000
@@ -182,12 +182,6 @@ int xenstat_collect_vbds(xenstat_node *
struct dirent *dp;
struct priv_data *priv = get_priv_data(node->handle);
- char *sys_prefix = "statistics/";
-
- /* 23 = "statistics/" + "xxxx_xx_req" */
- char ooreq[23], rdreq[23], wrreq[23];
- char *stat_prefix = NULL;
-
if (priv == NULL) {
perror("Allocation error");
return 0;
@@ -215,16 +209,12 @@ int xenstat_collect_vbds(xenstat_node *
if (ret != 3)
continue;
-
- if (strcmp(buf,"vbd") == 0){
- stat_prefix = "";
+ if (strcmp(buf,"vbd") == 0)
vbd.back_type = 1;
- } else if (strcmp(buf,"tap") == 0){
- stat_prefix = "tap_";
+ else if (strcmp(buf,"tap") == 0)
vbd.back_type = 2;
- } else {
- continue;
- }
+ else
+ continue;
domain = xenstat_node_domain(node, domid);
if (domain == NULL) {
@@ -235,22 +225,19 @@ int xenstat_collect_vbds(xenstat_node *
continue;
}
- snprintf(ooreq, sizeof(ooreq), "%s%soo_req", sys_prefix,
stat_prefix);
- if((read_attributes_vbd(dp->d_name, ooreq, buf, 256)<=0)
+ if((read_attributes_vbd(dp->d_name, "statistics/oo_req", buf,
256)<=0)
|| ((ret = sscanf(buf, "%llu", &vbd.oo_reqs)) != 1))
{
continue;
}
- snprintf(rdreq, sizeof(rdreq),"%s%srd_req", sys_prefix,
stat_prefix);
- if((read_attributes_vbd(dp->d_name, rdreq, buf, 256)<=0)
+ if((read_attributes_vbd(dp->d_name, "statistics/rd_req", buf,
256)<=0)
|| ((ret = sscanf(buf, "%llu", &vbd.rd_reqs)) != 1))
{
continue;
}
- snprintf(wrreq, sizeof(wrreq),"%s%swr_req", sys_prefix,
stat_prefix);
- if((read_attributes_vbd(dp->d_name, wrreq, buf, 256)<=0)
+ if((read_attributes_vbd(dp->d_name, "statistics/wr_req", buf,
256)<=0)
|| ((ret = sscanf(buf, "%llu", &vbd.wr_reqs)) != 1))
{
continue;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|