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-changelog

[Xen-changelog] [xen-unstable] Fix libxenstat on Solaris

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix libxenstat on Solaris
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 28 Feb 2008 06:10:08 -0800
Delivery-date: Thu, 28 Feb 2008 06:10:30 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1204117842 0
# Node ID 368d3774a4b5f629f9eb91c77c4a36a436c341e0
# Parent  2a8eaba24bf0482db8d44aa1c638ffa7e3894f43
Fix libxenstat on Solaris

Recent Solaris enhancements have changed the way virtual NIC
statistics are collected - fix libxenstat up for this.

Signed-off-by: John Levon <john.levon@xxxxxxx>
---
 tools/xenstat/libxenstat/src/xenstat_solaris.c |   44 +++++--------------------
 1 files changed, 9 insertions(+), 35 deletions(-)

diff -r 2a8eaba24bf0 -r 368d3774a4b5 
tools/xenstat/libxenstat/src/xenstat_solaris.c
--- a/tools/xenstat/libxenstat/src/xenstat_solaris.c    Tue Feb 26 15:11:51 
2008 +0000
+++ b/tools/xenstat/libxenstat/src/xenstat_solaris.c    Wed Feb 27 13:10:42 
2008 +0000
@@ -113,49 +113,23 @@ static void xenstat_uninit_devs(xenstat_
        priv->kc = NULL;
 }
 
-static int parse_nic(const char *nic, char *module, int *instance)
-{
-       const char *c;
-
-       for (c = &nic[strlen(nic) - 1]; c != nic && isdigit(*c); c--)
-               ;
-
-       if (c == nic)
-               return 0;
-
-       c++;
-
-       if (sscanf(c, "%d", instance) != 1)
-               return 0;
-
-       strncpy(module, nic, c - nic);
-       module[c - nic] = '\0';
-       return 1;
-}
-
 static int update_dev_stats(priv_data_t *priv, stdevice_t *dev)
 {
-       char mod[256];
-       const char *name;
-       int inst;
        kstat_t *ksp;
 
+       if (kstat_chain_update(priv->kc) == -1)
+               return 0;
+
        if (dev->type == DEVICE_NIC) {
-               if (!parse_nic(dev->name, mod, &inst))
-                       return 0;
-               name = "mac";
+               ksp = kstat_lookup(priv->kc, "link", 0, (char *)dev->name);
        } else {
-               strcpy(mod, "xdb");
-               inst = dev->instance;
-               name = "req_statistics";
-       }
-
-       if (kstat_chain_update(priv->kc) == -1)
-               return 0;
-
-       ksp = kstat_lookup(priv->kc, mod, inst, (char *)name);
+               ksp = kstat_lookup(priv->kc, "xdb", dev->instance,
+                   (char *)"req_statistics");
+       }
+
        if (ksp == NULL)
                return 0;
+
        if (kstat_read(priv->kc, ksp, NULL) == -1)
                return 0;
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix libxenstat on Solaris, Xen patchbot-unstable <=