WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][XENTOP][3/4] Display blktap statistics.

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][XENTOP][3/4] Display blktap statistics.
From: "Satoshi Uchida" <s-uchida@xxxxxxxxxxxxx>
Date: Tue, 5 Jun 2007 19:01:34 +0900
Delivery-date: Tue, 05 Jun 2007 03:01:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcejPg+Qqv/4Qq9PRKKhs0XupEiVdwEGZ1zw
This patch modify collecting of all VBD's statistics.
The libxenstat library is also searched tap-x-y in /sys/devices/xen-backend/ , 
but not only vbd-x-y.


# HG changeset patch
# User s-uchida@xxxxxxxxxxxxx
# Date 1180665629 -32400
# Node ID 1768a89bb87824249827d935d7803d8193bdeb05
# Parent  d06f4b7fec7f132030fa7bd2dbb358c8bd761a6a
XENSTAT: Adding to scan blktap information.

Sigened-off-by: Satoshi UCHIDA <s-uchida@xxxxxxxxxxxxx>

diff -r d06f4b7fec7f -r 1768a89bb878 tools/xenstat/libxenstat/src/xenstat.c
--- a/tools/xenstat/libxenstat/src/xenstat.c    Fri Jun 01 11:38:10 2007 +0900
+++ b/tools/xenstat/libxenstat/src/xenstat.c    Fri Jun 01 11:40:29 2007 +0900
@@ -625,6 +625,12 @@ static void xenstat_free_vbds(xenstat_no
                free(node->domains[i].vbds);
 }
 
+/* Get the back driver type  for Virtual Block Device */
+unsigned int xenstat_vbd_type(xenstat_vbd * vbd)
+{
+       return vbd->back_type;
+}
+
 /* Get the major number of VBD device */
 unsigned int xenstat_vbd_dev(xenstat_vbd * vbd)
 {
diff -r d06f4b7fec7f -r 1768a89bb878 tools/xenstat/libxenstat/src/xenstat.h
--- a/tools/xenstat/libxenstat/src/xenstat.h    Fri Jun 01 11:38:10 2007 +0900
+++ b/tools/xenstat/libxenstat/src/xenstat.h    Fri Jun 01 11:40:29 2007 +0900
@@ -172,6 +172,10 @@ unsigned long long xenstat_network_tdrop
 /*
  * VBD functions - extract information from a xen_vbd
  */
+
+/* Get the back driver type  for Virtual Block Device */
+unsigned int xenstat_vbd_type(xenstat_vbd * vbd);
+
 /* Get the device number for Virtual Block Device */
 unsigned int xenstat_vbd_dev(xenstat_vbd * vbd);
 
diff -r d06f4b7fec7f -r 1768a89bb878 
tools/xenstat/libxenstat/src/xenstat_linux.c
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c      Fri Jun 01 11:38:10 
2007 +0900
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c      Fri Jun 01 11:40:29 
2007 +0900
@@ -204,17 +204,23 @@ int xenstat_collect_vbds(xenstat_node * 
                int ret;
                char buf[256];
 
-
-               ret = sscanf(dp->d_name, "vbd-%u-%u", &domid, &vbd.dev);
-               if (ret != 2)
+               ret = sscanf(dp->d_name, "%3s-%u-%u", buf, &domid, &vbd.dev);
+               if (ret != 3)
+                       continue;
+
+               if (strcmp(buf,"vbd") == 0)
+                       vbd.back_type = 1;
+               else if (strcmp(buf,"tap") == 0)
+                       vbd.back_type = 2;
+               else
                        continue;
 
                domain = xenstat_node_domain(node, domid);
                if (domain == NULL) {
                        fprintf(stderr,
-                               "Found interface vbd-%u-%u but domain %u"
+                               "Found interface %s-%u-%u but domain %u"
                                " does not exist.\n",
-                               domid, vbd.dev, domid);
+                               buf, domid, vbd.dev, domid);
                        continue;
                }
 
diff -r d06f4b7fec7f -r 1768a89bb878 tools/xenstat/libxenstat/src/xenstat_priv.h
--- a/tools/xenstat/libxenstat/src/xenstat_priv.h       Fri Jun 01 11:38:10 
2007 +0900
+++ b/tools/xenstat/libxenstat/src/xenstat_priv.h       Fri Jun 01 11:40:29 
2007 +0900
@@ -87,10 +87,11 @@ struct xenstat_network {
 };
 
 struct xenstat_vbd {
-       unsigned int dev;
-       unsigned long long oo_reqs;
-       unsigned long long rd_reqs;
-       unsigned long long wr_reqs;
+       unsigned int back_type;
+       unsigned int dev;
+       unsigned long long oo_reqs;
+       unsigned long long rd_reqs;
+       unsigned long long wr_reqs;
 };
 
 extern int xenstat_collect_networks(xenstat_node * node);


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][XENTOP][3/4] Display blktap statistics., Satoshi Uchida <=