(CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:duration) op:Equal rhs:{(0)} spids:[133])] spids: [133] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:buckets) op: Equal rhs: {(ArrayLiteralPart words:[{(1)} {(8)} {(64)} {(128)}])} spids: [136] ) ] spids: [136] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:secsz) op:Equal rhs:{(512)} spids:[147])] spids: [147] ) (C {(trap)} {(SQ <':'>)} {(INT)} {(QUIT)} {(TERM)} {(PIPE)} {(HUP)}) (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 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 ') (Right_DoubleQuote '"') ('8 16 32') (Right_DoubleQuote '"') (' # specify custom bucket points\n') ] ) (Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)}) ] ) (ControlFlow token:<ControlFlow_Exit exit>) ] spids: [171] ) spids: [167 170] ) (FuncDef name: die body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_At '$@'))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [205] ) spids: [201 204] ) (WhileUntil keyword: <KW_While while> cond: [(C {(getopts)} {(b) (Lit_Other ':') (h)} {(opt)})] body: (DoGroup children: [ (Case to_match: {($ VSub_Name '$opt')} arms: [ (case_arm pat_list: [{(b)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:buckets) op: Equal rhs: {(ArrayLiteralPart words:[{($ VSub_Name '$OPTARG')}])} spids: [251] ) ] spids: [251] ) ] spids: [248 249 256 16777215] ) (case_arm pat_list: [{(h)} {(Lit_Other '?')}] action: [(C {(usage)})] spids: [259 262 266 16777215] ) ] spids: [241 245 269] ) ] spids: [238 271] ) ) (C {(shift)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$OPTIND')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [275 284] ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tpoint) op: Equal rhs: {(block) (Lit_Other ':') (block_rq_issue)} spids: [286] ) ] spids: [286] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:var) op:Equal rhs:{(nr_sector)} spids:[291])] spids: [291] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:duration) op: Equal rhs: {($ VSub_Number '$1')} spids: [294] ) ] spids: [294] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(0)} spids:[301])] spids: [301] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sectors) op: Equal rhs: { (ArrayLiteralPart words: [ { (BracedVarSub token: <VSub_Name buckets> bracket_op: (WholeArray op_id:Arith_Star) spids: [306 311] ) } ] ) } spids: [304] ) ] spids: [304] ) (DParen child: (BinaryAssign op_id: Arith_Equal left: (LhsName name:max_i) right: (ArithBinary op_id: Arith_Minus left: (ArithWord w: { (BracedVarSub token: <VSub_Name buckets> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Arith_Star) spids: [319 325] ) } ) right: (ArithWord w:{(Lit_Digits 1)}) ) ) spids: [314 331] ) (WhileUntil keyword: <KW_While while> cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_LessEqual left: (ArithVarRef name:i) right: (ArithVarRef name:max_i) ) spids: [335 344] ) terminator: <Op_Semi ';'> ) ] body: (DoGroup children: [ (DParen child: (BinaryAssign op_id: Arith_Equal left: (LhsIndexedName name:sectors index:(ArithWord w:{($ VSub_Name '$i')})) right: (ArithBinary op_id: Arith_Slash left: (ArithBinary op_id: Arith_Star left: (ArithWord w: { (BracedVarSub token: <VSub_Name sectors> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$i')})) spids: [359 364] ) } ) right: (ArithWord w:{(Lit_Digits 1024)}) ) right: (ArithWord w:{($ VSub_Name '$secsz')}) ) ) spids: [350 375] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithVarRef name:i) right: (ArithWord w:{(Lit_Digits 0)}) ) spids: [384 393] ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_LessEqual left: (ArithWord w: { (BracedVarSub token: <VSub_Name sectors> bracket_op: (ArrayIndex expr: (ArithWord w:{($ VSub_Name '$i')}) ) spids: [402 407] ) } ) right: (ArithWord w: { (BracedVarSub token: <VSub_Name sectors> bracket_op: (ArrayIndex expr: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) ) spids: [411 420] ) } ) ) spids: [400 423] ) terminator: <Op_Semi ';'> ) ] action: [(C {(die)} {(DQ ('ERROR: bucket list must increase in size.'))})] spids: [16777215 426] ) ] spids: [16777215 436] ) ] spids: [16777215 395] ) ] spids: [16777215 439] ) (DParen child: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) spids: [442 448] ) ] spids: [347 450] ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:max_b) op: Equal rhs: { (BracedVarSub token: <VSub_Name buckets> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$max_i')})) spids: [457 462] ) } spids: [456] ) ] spids: [456] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:max_s) op: Equal rhs: { (BracedVarSub token: <VSub_Name sectors> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$max_i')})) spids: [465 470] ) } spids: [464] ) ] spids: [464] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tpoints) op: Equal rhs: { (DQ ('-e ') ($ VSub_Name '$tpoint') (' --filter ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$var') (' < ') (BracedVarSub token: <VSub_Name sectors> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [480 485] ) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ) } spids: [472] ) ] spids: [472] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:awkarray) op:Equal rhs:{(EmptyPart)} spids:[489])] spids: [489] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(0)} spids:[491])] spids: [491] ) (WhileUntil keyword: <KW_While while> cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithVarRef name:max_i) ) spids: [496 505] ) terminator: <Op_Semi ';'> ) ] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tpoints) op: Equal rhs: { (DQ ($ VSub_Name '$tpoints') (' -e ') ($ VSub_Name '$tpoint') (' --filter ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$var') (' >= ') (BracedVarSub token: <VSub_Name sectors> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$i')})) spids: [520 525] ) (' && ') ) } spids: [511] ) ] spids: [511] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tpoints) op: Equal rhs: { (DQ ($ VSub_Name '$tpoints') (' ') ($ VSub_Name '$var') (' < ') (BracedVarSub token: <VSub_Name sectors> bracket_op: (ArrayIndex expr: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) ) spids: [536 545] ) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ) } spids: [530] ) ] spids: [530] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:awkarray) op: Equal rhs: { (DQ ($ VSub_Name '$awkarray') (' buckets[') ($ VSub_Name '$i') (']=') (BracedVarSub token: <VSub_Name buckets> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$i')})) spids: [556 561] ) (';') ) } spids: [550] ) ] spids: [550] ) (DParen child: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) spids: [566 572] ) ] spids: [508 574] ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:awkarray) op: Equal rhs: { (DQ ($ VSub_Name '$awkarray') (' buckets[') ($ VSub_Name '$max_i') (']=') (BracedVarSub token: <VSub_Name buckets> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$max_i')})) spids: [582 587] ) (';') ) } spids: [576] ) ] spids: [576] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tpoints) op: Equal rhs: { (DQ ($ VSub_Name '$tpoints') (' -e ') ($ VSub_Name '$tpoint') (' --filter ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$var') (' >= ') (BracedVarSub token: <VSub_Name sectors> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$max_i')})) spids: [600 605] ) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ) } spids: [591] ) ] spids: [591] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:duration) spids:[615 620]) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:etext) op: Equal rhs: {(DQ ('for ') ($ VSub_Name '$duration') (' seconds'))} spids: [626] ) ] spids: [626] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cmd) op: Equal rhs: {(DQ ('sleep ') ($ VSub_Name '$duration'))} spids: [634] ) ] spids: [634] ) ] spids: [16777215 623] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:etext) op: Equal rhs: {(DQ ('until Ctrl-C'))} spids: [643] ) ] spids: [643] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cmd) op: Equal rhs: {(DQ ('sleep 999999'))} spids: [649] ) ] spids: [649] ) ] spids: [640 654] ) (C {(echo)} {(DQ ('Tracing block I/O size (bytes), ') ($ VSub_Name '$etext') (...))}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:out) op:Equal rhs:{(DQ ('-o /dev/stdout'))} spids:[668])] spids: [668] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stat) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [ {(eval)} {(perf)} {(stat)} {($ VSub_Name '$tpoints')} {(-a)} {($ VSub_Name '$out')} {($ VSub_Name '$cmd')} ] redirects: [(Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)})] ) ] ) left_token: <Left_CommandSub '$('> spids: [677 694] ) } spids: [676] ) ] spids: [676] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_NEqual left: (ArithWord w:{($ VSub_QMark '$?')}) right: (ArithWord w:{(Lit_Digits 0)}) ) spids: [698 707] ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ('ERROR running perf:'))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$stat'))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit>) ] spids: [16777215 710] ) ] spids: [16777215 735] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:most) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$stat'))}) (C {(awk)} {(-v)} {(Lit_VarLike 'tpoint=') ($ VSub_Name '$tpoint')} { (SQ <'\n'> <'\t$2 == tpoint { gsub(/,/, ""); if ($1 > m) { m = $1 } }\n'> <'\tEND { print m }'> ) } ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [742 764] ) } spids: [741] ) ] spids: [741] ) (C {(echo)}) (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$stat'))}) (C {(awk)} {(-v)} {(Lit_VarLike 'tpoint=') ($ VSub_Name '$tpoint')} {(-v)} {(Lit_VarLike 'max_i=') ($ VSub_Name '$max_i')} {(-v)} {(Lit_VarLike 'most=') ($ VSub_Name '$most')} { (SQ <'\n'> <'\tfunction star(sval, smax, swidth) {\n'> <'\t\tstars = ""\n'> <'\t\t# using int could avoid error on gawk\n'> <'\t\tif (int(smax) == 0) return ""\n'> <'\t\tfor (si = 0; si < (swidth * sval / smax); si++) {\n'> <'\t\t\tstars = stars "#"\n'> <'\t\t}\n'> <'\t\treturn stars\n'> <'\t}\n'> <'\tBEGIN {\n'> <'\t\t'> ) (DQ ($ VSub_Name '$awkarray')) (SQ <'\n'> <'\t\tprintf(" %-15s: %-8s %s\\n", "Kbytes", "I/O",\n'> <'\t\t "Distribution")\n'> <'\t}\n'> <'\t/Performance counter stats/ { i = -1 }\n'> <'\t# reverse order of rule set is important\n'> <'\t{ ok = 0 }\n'> <'\t$2 == tpoint { num = $1; gsub(/,/, "", num); ok = 1 }\n'> <'\tok && i >= max_i {\n'> <'\t\tprintf(" %10.1f -> %-10s: %-8s |%-38s|\\n",\n'> <'\t\t buckets[i], "", num, star(num, most, 38))\n'> <'\t\tnext\n'> <'\t}\n'> <'\tok && i >= 0 && i < max_i {\n'> <'\t\tprintf(" %10.1f -> %-10.1f: %-8s |%-38s|\\n",\n'> <'\t\t buckets[i], buckets[i+1] - 0.1, num,\n'> <'\t\t star(num, most, 38))\n'> <'\t\ti++\n'> <'\t\tnext\n'> <'\t}\n'> <'\tok && i == -1 {\n'> <'\t\tprintf(" %10s -> %-10.1f: %-8s |%-38s|\\n", "",\n'> <'\t\t buckets[0] - 0.1, num, star(num, most, 38))\n'> <'\t\ti++\n'> <'\t}\n'> ) } ) ] negated: F ) ] )