tst.schedargs.ksh revision 14ea49401f3c8c61422aefbda43809e275f60c6c
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Common Development and Distribution License (the "License").
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# You may not use this file except in compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Use is subject to license terms.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# ASSERTION: Sched probe arguments should be valid.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncif [ $# != 1 ]; then
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# do not fail test in a domU
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $dtrace -c '/usr/bin/sleep 10' -o $outf -qs /dev/stdin <<EOF
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xdt:sched::off-cpu,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xdt:sched::on-cpu,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xdt:sched::block,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xdt:sched::sleep,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xdt:sched::wake,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xdt:sched::yield
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* print domid vcpu pcpu probename */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync printf("%d %d %d %s\n", arg0, arg1, \`xdt_curpcpu, probename);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync while (("/usr/sbin/xm vcpu-list" | getline)) {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if ($1 != "Name") {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync vcpumap[domid, vcpu] = 1
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync split($7, affinity, ",")
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync for (i in affinity) {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if (split(affinity[i], p, "-") > 1) {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync for (pcpu = p[1]; pcpu <= p[2];\
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpumap[domid, vcpu,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpumap[domid, vcpu,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync affinity[i]] = 1
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /^$/ { next }
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if (vcpumap[$1, $2]) {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync print "error: " $0
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if (cpumap[$1, $2, "any"] || cpumap[$1, $2, $3]) {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync print "error: " $0