ia64/xen-unstable

changeset 5666:4b052d8a9a2f

Rename fields in physinfo_t structure and add sockets/nodes
fields.
author kaf24@firebug.cl.cam.ac.uk
date Mon Jul 04 16:02:46 2005 +0000 (2005-07-04)
parents 8bd2e8933277
children 30e0940a2982
files tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/XendNode.py tools/xentrace/xentrace.c xen/arch/x86/dom0_ops.c xen/include/public/dom0_ops.h
line diff
     1.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Mon Jul 04 15:41:21 2005 +0000
     1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Mon Jul 04 16:02:46 2005 +0000
     1.3 @@ -47,7 +47,8 @@ static PyObject *pyxc_domain_dumpcore(Py
     1.4  
     1.5      static char *kwd_list[] = { "dom", "corefile", NULL };
     1.6  
     1.7 -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list, &dom, &corefile) )
     1.8 +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list,
     1.9 +                                      &dom, &corefile) )
    1.10          goto exit;
    1.11  
    1.12      if ( (corefile == NULL) || (corefile[0] == '\0') )
    1.13 @@ -82,7 +83,8 @@ static PyObject *pyxc_domain_create(PyOb
    1.14  
    1.15      static char *kwd_list[] = { "dom", "ssidref", NULL };
    1.16  
    1.17 -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|ii", kwd_list, &dom, &ssidref))
    1.18 +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|ii", kwd_list,
    1.19 +                                      &dom, &ssidref))
    1.20          return NULL;
    1.21  
    1.22      if ( (ret = xc_domain_create(xc->xc_handle, ssidref, &dom)) < 0 )
    1.23 @@ -687,11 +689,13 @@ static PyObject *pyxc_physinfo(PyObject 
    1.24          return PyErr_SetFromErrno(xc_error);
    1.25  
    1.26      return Py_BuildValue("{s:i,s:i,s:l,s:l,s:l}",
    1.27 -                         "ht_per_core", info.ht_per_core,
    1.28 -                         "cores",       info.cores,
    1.29 -                         "total_pages", info.total_pages,
    1.30 -                         "free_pages",  info.free_pages,
    1.31 -                         "cpu_khz",     info.cpu_khz);
    1.32 +                         "threads_per_core", info.threads_per_core,
    1.33 +                         "cores_per_socket", info.cores_per_socket,
    1.34 +                         "sockets_per_node", info.sockets_per_node,
    1.35 +                         "nr_nodes",         info.nr_nodes,
    1.36 +                         "total_pages",      info.total_pages,
    1.37 +                         "free_pages",       info.free_pages,
    1.38 +                         "cpu_khz",          info.cpu_khz);
    1.39  }
    1.40  
    1.41  static PyObject *pyxc_sedf_domain_set(PyObject *self,
    1.42 @@ -702,12 +706,15 @@ static PyObject *pyxc_sedf_domain_set(Py
    1.43      u32 domid;
    1.44      u64 period, slice, latency;
    1.45      u16 extratime, weight;
    1.46 -    static char *kwd_list[] = { "dom", "period", "slice", "latency", "extratime", "weight",NULL };
    1.47 +    static char *kwd_list[] = { "dom", "period", "slice",
    1.48 +                                "latency", "extratime", "weight",NULL };
    1.49      
    1.50 -    if( !PyArg_ParseTupleAndKeywords(args, kwds, "iLLLhh", kwd_list, &domid,
    1.51 -                                     &period, &slice, &latency, &extratime, &weight) )
    1.52 +    if( !PyArg_ParseTupleAndKeywords(args, kwds, "iLLLhh", kwd_list, 
    1.53 +                                     &domid, &period, &slice,
    1.54 +                                     &latency, &extratime, &weight) )
    1.55          return NULL;
    1.56 -   if ( xc_sedf_domain_set(xc->xc_handle, domid, period, slice, latency, extratime,weight) != 0 )
    1.57 +   if ( xc_sedf_domain_set(xc->xc_handle, domid, period,
    1.58 +                           slice, latency, extratime,weight) != 0 )
    1.59          return PyErr_SetFromErrno(xc_error);
    1.60  
    1.61      Py_INCREF(zero);
     2.1 --- a/tools/python/xen/xend/XendNode.py	Mon Jul 04 15:41:21 2005 +0000
     2.2 +++ b/tools/python/xen/xend/XendNode.py	Mon Jul 04 16:02:46 2005 +0000
     2.3 @@ -43,8 +43,8 @@ class XendNode:
     2.4  
     2.5      def physinfo(self):
     2.6          pinfo = self.xc.physinfo()
     2.7 -        info = [['cores', pinfo['cores']],
     2.8 -                ['hyperthreads_per_core', pinfo['ht_per_core']],
     2.9 +        info = [['cores_per_socket', pinfo['cores_per_socket']],
    2.10 +                ['threads_per_core', pinfo['threads_per_core']],
    2.11                  ['cpu_mhz', pinfo['cpu_khz']/1000],
    2.12                  ['memory', pinfo['total_pages']/256],
    2.13                  ['free_memory', pinfo['free_pages']/256]]
     3.1 --- a/tools/xentrace/xentrace.c	Mon Jul 04 15:41:21 2005 +0000
     3.2 +++ b/tools/xentrace/xentrace.c	Mon Jul 04 16:02:46 2005 +0000
     3.3 @@ -273,7 +273,10 @@ unsigned int get_num_cpus()
     3.4  
     3.5      xc_interface_close(xc_handle);
     3.6  
     3.7 -    return op.u.physinfo.ht_per_core * op.u.physinfo.cores;
     3.8 +    return (op.u.physinfo.threads_per_core *
     3.9 +            op.u.physinfo.cores_per_socket *
    3.10 +            op.u.physinfo.sockets_per_node *
    3.11 +            op.u.physinfo.nr_nodes);
    3.12  }
    3.13  
    3.14  
     4.1 --- a/xen/arch/x86/dom0_ops.c	Mon Jul 04 15:41:21 2005 +0000
     4.2 +++ b/xen/arch/x86/dom0_ops.c	Mon Jul 04 16:02:46 2005 +0000
     4.3 @@ -179,11 +179,14 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
     4.4      {
     4.5          dom0_physinfo_t *pi = &op->u.physinfo;
     4.6  
     4.7 -        pi->ht_per_core = smp_num_siblings;
     4.8 -        pi->cores       = boot_cpu_data.x86_num_cores;
     4.9 -        pi->total_pages = max_page;
    4.10 -        pi->free_pages  = avail_domheap_pages();
    4.11 -        pi->cpu_khz     = cpu_khz;
    4.12 +        pi->threads_per_core = smp_num_siblings;
    4.13 +        pi->cores_per_socket = boot_cpu_data.x86_num_cores;
    4.14 +        pi->sockets_per_node = 
    4.15 +            num_online_cpus() / (pi->threads_per_core * pi->cores_per_socket);
    4.16 +        pi->nr_nodes         = 1;
    4.17 +        pi->total_pages      = max_page;
    4.18 +        pi->free_pages       = avail_domheap_pages();
    4.19 +        pi->cpu_khz          = cpu_khz;
    4.20  
    4.21          copy_to_user(u_dom0_op, op, sizeof(*op));
    4.22          ret = 0;
     5.1 --- a/xen/include/public/dom0_ops.h	Mon Jul 04 15:41:21 2005 +0000
     5.2 +++ b/xen/include/public/dom0_ops.h	Mon Jul 04 16:02:46 2005 +0000
     5.3 @@ -19,7 +19,7 @@
     5.4   * This makes sure that old versions of dom0 tools will stop working in a
     5.5   * well-defined way (rather than crashing the machine, for instance).
     5.6   */
     5.7 -#define DOM0_INTERFACE_VERSION   0xAAAA1009
     5.8 +#define DOM0_INTERFACE_VERSION   0xAAAA100A
     5.9  
    5.10  /************************************************************************/
    5.11  
    5.12 @@ -206,8 +206,10 @@ typedef struct {
    5.13   */
    5.14  #define DOM0_PHYSINFO         22
    5.15  typedef struct {
    5.16 -    u32      ht_per_core;
    5.17 -    u32      cores;
    5.18 +    u32      threads_per_core;
    5.19 +    u32      cores_per_socket;
    5.20 +    u32      sockets_per_node;
    5.21 +    u32      nr_nodes;
    5.22      u32      cpu_khz;
    5.23      memory_t total_pages;
    5.24      memory_t free_pages;