(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:duration) op: assign_op.Equal rhs: {(0)} spids: [133] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:buckets) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:137) words: [{(1)} {(8)} {(64)} {(128)}] ) } spids: [136] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:secsz) op: assign_op.Equal rhs: {(512)} spids: [147] ) ] ) (C {(trap)} {(SQ (Token id:Id.Lit_Chars val:':' span_id:153))} {(INT)} {(QUIT)} {(TERM)} {(PIPE)} {(HUP)} ) (command.ShFunction name: usage body: (command.BraceGroup children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:176) fd: -1 here_begin: {(END)} here_end_span_id: 194 stdin_parts: [ ('USAGE: bitesize [-h] [-b buckets] [seconds]\n') (' -b buckets # specify histogram buckets (Kbytes)\n') (' -h # this usage message\n') (' eg,\n') (' bitesize # trace I/O size until Ctrl-C\n') (' bitesize 10 # trace I/O size for 10 seconds\n') (' bitesize -b ') (Id.Right_DoubleQuote '"') ('8 16 32') (Id.Right_DoubleQuote '"') (' # specify custom bucket points\n') ] ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:179) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:196) ) ] ) ) (command.ShFunction name: die body: (command.BraceGroup children: [ (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_At '$@'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:210) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:218) arg_word: {(1)} ) ] ) ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:228) cond: [(C {(getopts)} {(b) (Id.Lit_Other ':') (h)} {(opt)})] body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_DollarName '$opt')} arms: [ (case_arm pat_list: [{(b)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:buckets) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:252) words: [{($ Id.VSub_DollarName '$OPTARG')}] ) } spids: [251] ) ] ) ] spids: [248 249 256 -1] ) (case_arm pat_list: [{(h)} {(Id.Lit_QMark '?')}] action: [(C {(usage)})] spids: [259 262 266 -1] ) ] ) ] ) ) (C {(shift)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$OPTIND')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoint) op: assign_op.Equal rhs: {(block) (Id.Lit_Other ':') (block_rq_issue)} spids: [286] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:var) op: assign_op.Equal rhs: {(nr_sector)} spids: [291] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:duration) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [294] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:i) op:assign_op.Equal rhs:{(0)} spids:[301])] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sectors) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:305) words: [ { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:307) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ] ) } spids: [304] ) ] ) (command.DParen child: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:max_i) right: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:321) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:333) cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_LessEqual left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:337)) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:max_i span_id:341) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:345) ) ] body: (command.DoGroup children: [ (command.DParen child: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.IndexedName name: sectors index: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) right: (arith_expr.Binary op_id: Id.Arith_Slash left: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:sectors span_id:360) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1024)}) ) right: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$secsz')}) ) ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:i span_id:386) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:394) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_LessEqual left: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id: Id.VSub_Name val: sectors span_id: 403 ) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) ) ) } ) right: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id: Id.VSub_Name val: sectors span_id: 412 ) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) right: (arith_expr.ArithWord w: {(Id.Lit_Digits 1)} ) ) ) ) } ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:424) ) ] action: [(C {(die)} {(DQ ('ERROR: bucket list must increase in size.'))})] spids: [398 426] ) ] ) ] spids: [382 395] ) ] ) (command.DParen child: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i)) ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:max_b) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:458) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$max_i')}) ) ) } spids: [456] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:max_s) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:sectors span_id:466) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$max_i')}) ) ) } spids: [464] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoints) op: assign_op.Equal rhs: { (DQ ('-e ') ($ Id.VSub_DollarName '$tpoint') (' --filter ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:477) ) ($ Id.VSub_DollarName '$var') (' < ') (braced_var_sub token: (Token id:Id.VSub_Name val:sectors span_id:481) bracket_op: (bracket_op.ArrayIndex expr:(arith_expr.ArithWord w:{(Id.Lit_Digits 0)})) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:486)) ) } spids: [472] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:awkarray) op: assign_op.Equal rhs: (word.Empty) spids: [489] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:i) op:assign_op.Equal rhs:{(0)} spids:[491])] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:494) cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:498)) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:max_i span_id:502) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:506) ) ] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoints) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$tpoints') (' -e ') ($ Id.VSub_DollarName '$tpoint') (' --filter ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:517)) ($ Id.VSub_DollarName '$var') (' >= ') (braced_var_sub token: (Token id:Id.VSub_Name val:sectors span_id:521) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) ) (' && ') ) } spids: [511] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoints) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$tpoints') (' ') ($ Id.VSub_DollarName '$var') (' < ') (braced_var_sub token: (Token id:Id.VSub_Name val:sectors span_id:537) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:546)) ) } spids: [530] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:awkarray) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$awkarray') (' buckets[') ($ Id.VSub_DollarName '$i') (']=') (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:557) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) ) (';') ) } spids: [550] ) ] ) (command.DParen child: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i)) ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:awkarray) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$awkarray') (' buckets[') ($ Id.VSub_DollarName '$max_i') (']=') (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:583) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$max_i')}) ) ) (';') ) } spids: [576] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoints) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$tpoints') (' -e ') ($ Id.VSub_DollarName '$tpoint') (' --filter ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:597)) ($ Id.VSub_DollarName '$var') (' >= ') (braced_var_sub token: (Token id:Id.VSub_Name val:sectors span_id:601) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$max_i')}) ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:606)) ) } spids: [591] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:duration span_id:617) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:621) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:etext) op: assign_op.Equal rhs: {(DQ ('for ') ($ Id.VSub_DollarName '$duration') (' seconds'))} spids: [626] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:cmd) op: assign_op.Equal rhs: {(DQ ('sleep ') ($ Id.VSub_DollarName '$duration'))} spids: [634] ) ] ) ] spids: [613 623] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:etext) op: assign_op.Equal rhs: {(DQ ('until Ctrl-C'))} spids: [643] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:cmd) op: assign_op.Equal rhs: {(DQ ('sleep 999999'))} spids: [649] ) ] ) ] ) (C {(echo)} {(DQ ('Tracing block I/O size (bytes), ') ($ Id.VSub_DollarName '$etext') (...))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:out) op: assign_op.Equal rhs: {(DQ ('-o /dev/stdout'))} spids: [668] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:stat) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:677) command_list: (command.CommandList children: [ (command.Simple words: [ {(eval)} {(perf)} {(stat)} {($ Id.VSub_DollarName '$tpoints')} {(-a)} {($ Id.VSub_DollarName '$out')} {($ Id.VSub_DollarName '$cmd')} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:692) fd: 2 arg_word: {(1)} ) ] ) ] ) ) } spids: [676] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_NEqual left: (arith_expr.ArithWord w:{($ Id.VSub_QMark '$?')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:708) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('ERROR running perf:'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:715) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_DollarName '$stat'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:725) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:733) ) ] spids: [696 710] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:most) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:742) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ Id.VSub_DollarName '$stat'))}) (C {(awk)} {(-v)} {(Id.Lit_VarLike 'tpoint=') ($ Id.VSub_DollarName '$tpoint')} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:759) (Token id: Id.Lit_Chars val: '\t$2 == tpoint { gsub(/,/, ""); if ($1 > m) { m = $1 } }\n' span_id: 760 ) (Token id:Id.Lit_Chars val:'\tEND { print m }' span_id:761) ) } ) ] negated: F ) ] ) ) } spids: [741] ) ] ) (C {(echo)}) (command.Pipeline children: [ (C {(echo)} {(DQ ($ Id.VSub_DollarName '$stat'))}) (C {(awk)} {(-v)} {(Id.Lit_VarLike 'tpoint=') ($ Id.VSub_DollarName '$tpoint')} {(-v)} {(Id.Lit_VarLike 'max_i=') ($ Id.VSub_DollarName '$max_i')} {(-v)} {(Id.Lit_VarLike 'most=') ($ Id.VSub_DollarName '$most')} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:798) (Token id: Id.Lit_Chars val: '\tfunction star(sval, smax, swidth) {\n' span_id: 799 ) (Token id:Id.Lit_Chars val:'\t\tstars = ""\n' span_id:800) (Token id: Id.Lit_Chars val: '\t\t# using int could avoid error on gawk\n' span_id: 801 ) (Token id:Id.Lit_Chars val:'\t\tif (int(smax) == 0) return ""\n' span_id:802) (Token id: Id.Lit_Chars val: '\t\tfor (si = 0; si < (swidth * sval / smax); si++) {\n' span_id: 803 ) (Token id:Id.Lit_Chars val:'\t\t\tstars = stars "#"\n' span_id:804) (Token id:Id.Lit_Chars val:'\t\t}\n' span_id:805) (Token id:Id.Lit_Chars val:'\t\treturn stars\n' span_id:806) (Token id:Id.Lit_Chars val:'\t}\n' span_id:807) (Token id:Id.Lit_Chars val:'\tBEGIN {\n' span_id:808) (Token id:Id.Lit_Chars val:'\t\t' span_id:809) ) (DQ ($ Id.VSub_DollarName '$awkarray')) (SQ (Token id:Id.Lit_Chars val:'\n' span_id:815) (Token id: Id.Lit_Chars val: '\t\tprintf(" %-15s: %-8s %s\\n", "Kbytes", "I/O",\n' span_id: 816 ) (Token id:Id.Lit_Chars val:'\t\t "Distribution")\n' span_id:817) (Token id:Id.Lit_Chars val:'\t}\n' span_id:818) (Token id:Id.Lit_Chars val:'\t/Performance counter stats/ { i = -1 }\n' span_id:819) (Token id: Id.Lit_Chars val: '\t# reverse order of rule set is important\n' span_id: 820 ) (Token id:Id.Lit_Chars val:'\t{ ok = 0 }\n' span_id:821) (Token id: Id.Lit_Chars val: '\t$2 == tpoint { num = $1; gsub(/,/, "", num); ok = 1 }\n' span_id: 822 ) (Token id:Id.Lit_Chars val:'\tok && i >= max_i {\n' span_id:823) (Token id: Id.Lit_Chars val: '\t\tprintf(" %10.1f -> %-10s: %-8s |%-38s|\\n",\n' span_id: 824 ) (Token id:Id.Lit_Chars val:'\t\t buckets[i], "", num, star(num, most, 38))\n' span_id:825) (Token id:Id.Lit_Chars val:'\t\tnext\n' span_id:826) (Token id:Id.Lit_Chars val:'\t}\n' span_id:827) (Token id:Id.Lit_Chars val:'\tok && i >= 0 && i < max_i {\n' span_id:828) (Token id:Id.Lit_Chars val:'\t\tprintf(" %10.1f -> %-10.1f: %-8s |%-38s|\\n",\n' span_id:829) (Token id: Id.Lit_Chars val: '\t\t buckets[i], buckets[i+1] - 0.1, num,\n' span_id: 830 ) (Token id:Id.Lit_Chars val:'\t\t star(num, most, 38))\n' span_id:831) (Token id:Id.Lit_Chars val:'\t\ti++\n' span_id:832) (Token id:Id.Lit_Chars val:'\t\tnext\n' span_id:833) (Token id:Id.Lit_Chars val:'\t}\n' span_id:834) (Token id:Id.Lit_Chars val:'\tok && i == -1 {\n' span_id:835) (Token id:Id.Lit_Chars val:'\t\tprintf(" %10s -> %-10.1f: %-8s |%-38s|\\n", "",\n' span_id:836) (Token id: Id.Lit_Chars val: '\t\t buckets[0] - 0.1, num, star(num, most, 38))\n' span_id: 837 ) (Token id:Id.Lit_Chars val:'\t\ti++\n' span_id:838) (Token id:Id.Lit_Chars val:'\t}\n' span_id:839) ) } ) ] negated: F ) ] )