aboutsummaryrefslogtreecommitdiff
path: root/Include/test.ksh
blob: a3e1036a20612e068ecaa1ccae206dbd43077473 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/ksh
/*
 * test.ksh - DTrace include file test script.
 *
 * $Id: test.ksh 36 2007-09-15 06:51:18Z brendan $
 *
 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
 *
 * CDDL HEADER START
 *
 *  The contents of this file are subject to the terms of the
 *  Common Development and Distribution License, Version 1.0 only
 *  (the "License").  You may not use this file except in compliance
 *  with the License.
 *
 *  You can obtain a copy of the license at Docs/cddl1.txt
 *  or http://www.opensolaris.org/os/licensing.
 *  See the License for the specific language governing permissions
 *  and limitations under the License.
 *
 * CDDL HEADER END
 *
 * 16-Sep-2007	Brendan Gregg	Created this.
 */

dtrace -CI . -s /dev/stdin << END

#include "tostr.h"
#include "time.h"

#pragma D option quiet
#pragma D option destructive

dtrace:::BEGIN
{
	i = 1;
	printf("\nNUM_TO_STR   %12d = %s\n", i, NUM_TO_STR(i));
	i = 1100;
	printf("NUM_TO_STR   %12d = %s\n", i, NUM_TO_STR(i));
	i = 1100000;
	printf("NUM_TO_STR   %12d = %s\n", i, NUM_TO_STR(i));
	i = 999999999;
	printf("NUM_TO_STR   %12d = %s\n", i, NUM_TO_STR(i));

	i = 1;
	printf("\nBYTES_TO_STR %12d = %s\n", i, BYTES_TO_STR(i));
	i = 1024;
	printf("BYTES_TO_STR %12d = %s\n", i, BYTES_TO_STR(i));
	i = 1000000;
	printf("BYTES_TO_STR %12d = %s\n", i, BYTES_TO_STR(i));
	i = 999999999;
	printf("BYTES_TO_STR %12d = %s\n", i, BYTES_TO_STR(i));

	i = 1;
	printf("\nUS_TO_STR    %12d = %s\n", i, US_TO_STR(i));
	i = 1100;
	printf("US_TO_STR    %12d = %s\n", i, US_TO_STR(i));
	i = 999999;
	printf("US_TO_STR    %12d = %s\n", i, US_TO_STR(i));

	printf("\nwalltimestamp : %Y\n", walltimestamp);
	printf("TZ=GMT date   : ");
	system("TZ=GMT date '+%%H:%%M:%%S'");
	printf("TIME_HHMMSS   : %s\n", TIME_HHMMSS);

	exit(0);
}
END