xref: /titanic_52/usr/src/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d (revision e5803b76927480e8f9b67b22201c484ccf4c2bcf)
1 /*
2  * CDDL HEADER START
3  *
4  * This file and its contents are supplied under the terms of the
5  * Common Development and Distribution License ("CDDL"), version 1.0.
6  * You may only use this file in accordance with the terms of version
7  * 1.0 of the CDDL.
8  *
9  * A full copy of the text of the CDDL should have accompanied this
10  * source.  A copy of the CDDL is also available via the Internet at
11  * http://www.illumos.org/license/CDDL.
12  *
13  * CDDL HEADER END
14  */
15 
16 /*
17  * Copyright (c) 2012 by Delphix. All rights reserved.
18  */
19 
20 /*
21  * This test excercises the "remnant" handling of the temporal option.
22  * At the end of one pass of retrieving and printing data from all CPUs,
23  * some unprocessed data will remain, because its timestamp is after the
24  * time covered by all CPUs' buffers.  This unprocessed data is
25  * rearranged in a more space-efficient manner.  If this is done
26  * incorrectly, an alignment error may occur.  To test this, we use a
27  * high-frequency probe so that data will be recorded in subsequent
28  * CPU's buffers after the first CPU's buffer is obtained.  The
29  * combination of data traced here (a 8-byte value and a 4-byte value)
30  * is effective to cause alignment problems with an incorrect
31  * implementation.
32  *
33  * This test needs to be run on a multi-CPU system to be effective.
34  */
35 
36 #pragma D option quiet
37 #pragma D option temporal
38 
39 profile-4997
40 {
41 	printf("%u %u", 1ULL, 2);
42 }
43 
44 tick-1
45 /i++ == 10/
46 {
47 	exit(0);
48 }
49