9512fe850e98fdd448c638ca63fdd92a8a510255ahl# CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#ident "%Z%%M% %I% %E% SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl #pragma D option quiet
9512fe850e98fdd448c638ca63fdd92a8a510255ahl #pragma D option statusrate=1hz
9512fe850e98fdd448c638ca63fdd92a8a510255ahl uint64_t total;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl int thresh;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl start = timestamp;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl thresh = 10;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl sched:::on-cpu
9512fe850e98fdd448c638ca63fdd92a8a510255ahl /pid == \$pid/
9512fe850e98fdd448c638ca63fdd92a8a510255ahl self->on = vtimestamp;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl sched:::off-cpu
9512fe850e98fdd448c638ca63fdd92a8a510255ahl /self->on/
9512fe850e98fdd448c638ca63fdd92a8a510255ahl total += vtimestamp - self->on;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl /i++ == 10/
9512fe850e98fdd448c638ca63fdd92a8a510255ahl /((total * 100) / (timestamp - start)) > thresh/
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("'%s' buffering policy took %d%% of CPU; ",
9512fe850e98fdd448c638ca63fdd92a8a510255ahl \$\$1, ((total * 100) / (timestamp - start)));
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("expected no more than %d%%!\n", thresh);
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomeeif [ $# != 1 ]; then