dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / dtrace / test / tst / common / aggs / tst.aggpackbanner.ksh
blobf055a08c13e6f0e0153b9a6fd2c9d2ad58b9963b
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright (c) 2013 Joyent, Inc. All rights reserved.
16 let width=8
18 function outputchar
20 banner $3 | /bin/nawk -v line=$1 -v pos=$2 -v width=$width '{ \
21 for (i = 1; i <= length($0); i++) { \
22 if (substr($0, i, 1) == " ") \
23 continue; \
24 printf("\t@letter%d[%d] = lquantize(%d, 0, 40, 1);\n", \
25 line, NR, i + (pos * width));
26 } \
30 function outputstr
32 let pos=0;
33 let line=0
35 printf "#pragma D option aggpack\n#pragma D option aggsortkey\n"
37 printf "BEGIN\n{\n"
38 for c in `echo "$1" | /bin/nawk '{ \
39 for (i = 1; i <= length($0); i++) { \
40 c = substr($0, i, 1); \
41 printf("%s\n", c == " " ? "space" : \
42 c == "\n" ? "newline" : c); \
43 } \
44 }'`; do
45 if [[ "$c" == "space" ]]; then
46 let line=line+1
47 let pos=0
48 continue
51 outputchar $line $pos $c
52 let pos=pos+1
53 done
55 let i=0
57 while [[ $i -le $line ]]; do
58 printf "\tprinta(@letter%d);\n" $i
59 let i=i+1
60 done
61 printf "\texit(0);\n}\n"
64 dtrace -qs /dev/stdin -x encoding=utf8 <<EOF
65 `outputstr "why must i do this"`
66 EOF
68 dtrace -qs /dev/stdin -x encoding=ascii -x aggzoom <<EOF
69 `outputstr "i am not well"`
70 EOF
72 dtrace -qs /dev/stdin -x encoding=utf8 -x aggzoom <<EOF
73 `outputstr "send help"`
74 EOF