err.D_CLEAR_AGGARG.bad.d revision 256281
1184902Srwatson/*
2184902Srwatson * CDDL HEADER START
3184902Srwatson *
4184902Srwatson * The contents of this file are subject to the terms of the
5184902Srwatson * Common Development and Distribution License (the "License").
6184902Srwatson * You may not use this file except in compliance with the License.
7184902Srwatson *
8184902Srwatson * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9184902Srwatson * or http://www.opensolaris.org/os/licensing.
10184902Srwatson * See the License for the specific language governing permissions
11184902Srwatson * and limitations under the License.
12184902Srwatson *
13184902Srwatson * When distributing Covered Code, include this CDDL HEADER in each
14184902Srwatson * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15184902Srwatson * If applicable, add the following below this CDDL HEADER, with the
16184902Srwatson * fields enclosed by brackets "[]" replaced with your own identifying
17184902Srwatson * information: Portions Copyright [yyyy] [name of copyright owner]
18184902Srwatson *
19184902Srwatson * CDDL HEADER END
20184902Srwatson */
21184902Srwatson
22184902Srwatson/*
23184902Srwatson * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24184902Srwatson * Use is subject to license terms.
25184902Srwatson */
26184902Srwatson
27184902Srwatson
28184902Srwatson#pragma	ident	"%Z%%M%	%I%	%E% SMI"
29184902Srwatson
30184902Srwatson
31184902Srwatson/*
32184902Srwatson * ASSERTION:
33184902Srwatson *	The argument to clear() must be an aggregation.
34184902Srwatson *
35184902Srwatson * SECTION: Aggregations/Clearing aggregations
36184902Srwatson *
37184902Srwatson *
38184902Srwatson */
39184902Srwatson
40184902Srwatson#pragma D option quiet
41184902Srwatson#pragma D option aggrate=10ms
42184902Srwatson#pragma D option switchrate=10ms
43184902Srwatson
44184902SrwatsonBEGIN
45184902Srwatson{
46184902Srwatson	i = 0;
47184902Srwatson	start = timestamp;
48184902Srwatson}
49184902Srwatson
50184902Srwatsontick-100ms
51184902Srwatson/i < 20/
52184902Srwatson{
53184902Srwatson	@func[i%5] = sum(i * 100);
54184902Srwatson	i++;
55184902Srwatson}
56184902Srwatson
57184902Srwatsontick-100ms
58184902Srwatson/i == 10/
59184902Srwatson{
60184902Srwatson	printf("Aggregation data before clear():\n");
61184902Srwatson	printa(@func);
62184902Srwatson
63184902Srwatson	clear(count());
64184902Srwatson
65184902Srwatson	printf("Aggregation data after clear():\n");
66184902Srwatson	printa(@func);
67184902Srwatson	i++;
68184902Srwatson}
69184902Srwatson
70184902Srwatsontick-100ms
71184902Srwatson/i == 20/
72184902Srwatson{
73184902Srwatson	printf("Final aggregation data:\n");
74184902Srwatson	printa(@func);
75184902Srwatson
76184902Srwatson	exit(0);
77184902Srwatson}
78184902Srwatson