diff options
author | George V. Neville-Neil <gnn@FreeBSD.org> | 2012-05-12 20:38:18 +0000 |
---|---|---|
committer | George V. Neville-Neil <gnn@FreeBSD.org> | 2012-05-12 20:38:18 +0000 |
commit | 055173dba4a263acf10325a49eebf82915369ed2 (patch) | |
tree | aec2772e8855e6dbaea6d8136ed0c47bcb825dee /Include/test.ksh | |
parent | 87c8f7aa3a46118212b99f0d58b18aa93c06b02a (diff) |
Notes
Diffstat (limited to 'Include/test.ksh')
-rwxr-xr-x | Include/test.ksh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/Include/test.ksh b/Include/test.ksh new file mode 100755 index 000000000000..a3e1036a2061 --- /dev/null +++ b/Include/test.ksh @@ -0,0 +1,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 |