Print this page
XXX Remove nawk(1)


  44 outf=/tmp/sched.args.$$
  45 
  46 script()
  47 {
  48         $dtrace -c '/usr/bin/sleep 10' -o $outf -qs /dev/stdin <<EOF
  49         xdt:sched::off-cpu,
  50         xdt:sched::on-cpu,
  51         xdt:sched::block,
  52         xdt:sched::sleep,
  53         xdt:sched::wake,
  54         xdt:sched::yield
  55         {
  56                 /* print domid vcpu pcpu probename */
  57                 printf("%d %d %d %s\n", arg0, arg1, \`xdt_curpcpu, probename);
  58         }
  59 EOF
  60 }
  61 
  62 validate()
  63 {
  64         /usr/bin/nawk '
  65         BEGIN {
  66                 while (("/usr/sbin/xm vcpu-list" | getline)) {
  67                         if ($1 != "Name") {
  68                                 domid = $2
  69                                 vcpu = $3
  70 
  71                                 vcpumap[domid, vcpu] = 1
  72 
  73                                 split($7, affinity, ",")
  74                                 for (i in affinity) {
  75                                         if (split(affinity[i], p, "-") > 1) {
  76                                                 for (pcpu = p[1]; pcpu <= p[2];\
  77                                                     pcpu++) {
  78                                                         cpumap[domid, vcpu,
  79                                                             pcpu] = 1
  80                                                 }
  81                                         } else {
  82                                                 cpumap[domid, vcpu,
  83                                                     affinity[i]] = 1
  84                                         }




  44 outf=/tmp/sched.args.$$
  45 
  46 script()
  47 {
  48         $dtrace -c '/usr/bin/sleep 10' -o $outf -qs /dev/stdin <<EOF
  49         xdt:sched::off-cpu,
  50         xdt:sched::on-cpu,
  51         xdt:sched::block,
  52         xdt:sched::sleep,
  53         xdt:sched::wake,
  54         xdt:sched::yield
  55         {
  56                 /* print domid vcpu pcpu probename */
  57                 printf("%d %d %d %s\n", arg0, arg1, \`xdt_curpcpu, probename);
  58         }
  59 EOF
  60 }
  61 
  62 validate()
  63 {
  64         /usr/xpg4/bin/awk '
  65         BEGIN {
  66                 while (("/usr/sbin/xm vcpu-list" | getline)) {
  67                         if ($1 != "Name") {
  68                                 domid = $2
  69                                 vcpu = $3
  70 
  71                                 vcpumap[domid, vcpu] = 1
  72 
  73                                 split($7, affinity, ",")
  74                                 for (i in affinity) {
  75                                         if (split(affinity[i], p, "-") > 1) {
  76                                                 for (pcpu = p[1]; pcpu <= p[2];\
  77                                                     pcpu++) {
  78                                                         cpumap[domid, vcpu,
  79                                                             pcpu] = 1
  80                                                 }
  81                                         } else {
  82                                                 cpumap[domid, vcpu,
  83                                                     affinity[i]] = 1
  84                                         }