ia64/xen-unstable

changeset 427:f05fccef69dc

bitkeeper revision 1.210 (3eb83c4fHs_yAKLhRwEjFTSk2RBfhA)

xi_list:
new file
dom0_core.c, sched.h, domain.c:
Add default domain name and xi_list to list all running domains
author tlh20@elite.cl.cam.ac.uk
date Tue May 06 22:50:55 2003 +0000 (2003-05-06)
parents 62a46bc69cac
children 01249407db23 3972b49a8ed2
files .rootkeys tools/internal/xi_list xen/common/domain.c xen/include/xeno/sched.h xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_core.c
line diff
     1.1 --- a/.rootkeys	Tue May 06 17:20:48 2003 +0000
     1.2 +++ b/.rootkeys	Tue May 06 22:50:55 2003 +0000
     1.3 @@ -39,6 +39,7 @@ 3eb781fdKiQbgozBsgs_zzJQ9ubehw tools/int
     1.4  3eb781fdgbSkh2O6JQS-65Dz4n0ItQ tools/internal/xi_build.c
     1.5  3eb781fdW1SAyiaC4mTsXq_9fRHh-A tools/internal/xi_create.c
     1.6  3eb781fdcJ0fF7rWfzAOArW-x4-gwA tools/internal/xi_destroy.c
     1.7 +3eb83c3bZeECmphOKOJxSu4Lo1LpBw tools/internal/xi_list
     1.8  3eb781fd8oRfPgH7qTh7xvgmwD6NgA tools/internal/xi_start.c
     1.9  3eb781fd0Eo9K1jEFCSAVzO51i_ngg tools/internal/xi_stop.c
    1.10  3eb781fd7211MZsLxJSiuy7W4KnJXg tools/internal/xi_vifinit
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/internal/xi_list	Tue May 06 22:50:55 2003 +0000
     2.3 @@ -0,0 +1,45 @@
     2.4 +#!/bin/bash
     2.5 +#
     2.6 +# xi_list
     2.7 +#
     2.8 +# This is a silly little script to dump the currently running domains.
     2.9 +# The output format is a series of space-separate fields for each domain:
    2.10 +#
    2.11 +#  1. Domain id
    2.12 +#  2. Processor
    2.13 +#  3. Has CPU (1 => true, 0 => false)
    2.14 +#  4. State (RUNNING, INTERRUPTABLE, UNINTERRUPTABLE, WAIT, SUSPENDED, DYING)
    2.15 +#  5. MCU advance
    2.16 +#  6. Total pages
    2.17 +#  7. Name
    2.18 +
    2.19 +INPUT_FILE=/proc/xeno/domains
    2.20 +
    2.21 +awk -f - $INPUT_FILE <<EOF
    2.22 +{
    2.23 +  dom_id = \$1;
    2.24 +
    2.25 +  processor = \$2;
    2.26 +
    2.27 +  has_cpu = \$3;
    2.28 +
    2.29 +  state = "UNKNOWN";
    2.30 +
    2.31 +  if (\$4 == 0)  state = "RUNNING";
    2.32 +  if (\$4 == 1)  state = "INTERRUPTIBLE";
    2.33 +  if (\$4 == 2)  state = "UNINTERRUPTABLE";
    2.34 +  if (\$4 == 4)  state = "WAIT";
    2.35 +  if (\$4 == 8)  state = "SUSPENDED";
    2.36 +  if (\$4 == 16) state = "DYING";
    2.37 +
    2.38 +  mcu_advance = \$6;
    2.39 +
    2.40 +  tot_pages = \$8;
    2.41 +
    2.42 +  printf "%d %d %d %s %d %d %s", dom_id, processor, has_cpu, state, mcu_advance, tot_pages, \$9;
    2.43 +  for (i = 10; i < NF; i ++) {
    2.44 +    printf " %s", \$i;
    2.45 +  }
    2.46 +  printf "\n";
    2.47 +}
    2.48 +EOF 
     3.1 --- a/xen/common/domain.c	Tue May 06 17:20:48 2003 +0000
     3.2 +++ b/xen/common/domain.c	Tue May 06 22:50:55 2003 +0000
     3.3 @@ -48,6 +48,8 @@ struct task_struct *do_newdomain(unsigne
     3.4      p->domain    = dom_id;
     3.5      p->processor = cpu;
     3.6  
     3.7 +    sprintf (p->name, "Domain-%d", dom_id);
     3.8 +
     3.9      spin_lock_init(&p->blk_ring_lock);
    3.10      spin_lock_init(&p->page_lock);
    3.11  
     4.1 --- a/xen/include/xeno/sched.h	Tue May 06 17:20:48 2003 +0000
     4.2 +++ b/xen/include/xeno/sched.h	Tue May 06 22:50:55 2003 +0000
     4.3 @@ -170,6 +170,9 @@ struct task_struct
     4.4   * TASK_WAIT:            Domains CPU allocation expired.
     4.5   * TASK_SUSPENDED:       Domain is in supsended state (eg. start of day)
     4.6   * TASK_DYING:           Domain is about to cross over to the land of the dead.
     4.7 + *
     4.8 + * If you update these then please update the mapping to text names in
     4.9 + * xi_list.
    4.10   */
    4.11  
    4.12  #define TASK_RUNNING            0
     5.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_core.c	Tue May 06 17:20:48 2003 +0000
     5.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_core.c	Tue May 06 22:50:55 2003 +0000
     5.3 @@ -351,6 +351,12 @@ static int xeno_domains_show(struct seq_
     5.4  { 
     5.5    dom0_op_t *di = v;
     5.6    
     5.7 +  /*
     5.8 +   * Output one domain's details to dom0.
     5.9 +   *
    5.10 +   * If you update this format string then change xi_list to match.
    5.11 +   */
    5.12 +
    5.13    seq_printf (s, 
    5.14                "%8d %2d %1d %2d %8d %8ld %p %8d %s\n",
    5.15                di -> u.getdominfo.domain,